openaptx
openaptx copied to clipboard
AptX Adaptive support #2
Following up #1 to track aptX Adaptive support.
@Arkq do you already know the .so and binary files that do aptX Adaptive in a phone?
The only library that I've got is this one: https://github.com/Arkq/openaptx/blob/master/archive/qdsp6/capi_v2_aptX_CLHDAD_Encoder.so Unfortunately, it's for QDSP6 platform which is rater nor suitable (for me) for reverse engineering.
@Arkq you'll probably won't find ARM or X86 versions of aptX Adaptive library. However, QDSP6 (aka Hexagon DSP) is kinda supported in Ghidra and in Binary Ninja. Here are newer V2.2 and V3 QDSP6 encoder libraries. Looks like V2.2 is the latest aptX Adaptive version, and V3 is called aptX Lossless. As for decoder libraries, it's worse. I do have object files for their Kalimba architecture 4 (used in QCC Bluetooth SoCs), but some of them may be stripped. There exists disassembler for this architecture (well, actually full GNU binutils build is also available as well as compiler).
The problem with QDSP6 is that the algorithm in there is not as straightforward as in x86/ARM code. I've been checking it in IDA but I was not able to get anything useful (in a timeframe I can invest in that).
Can you also take a look at Kalimba versions? I added few examples of object files as well as objdump binary. Maybe it will be easier to add support of Kalimba to i.e. Ghidra and only after that try to reverse it.
UPD: There also exists QEMU for Hexagon. Wonder if it would be possible to just use library as-is instead of reverse engineering it. UPD2: There's also Kalimba simulator software (linux binary also exists), maybe it could be used as well
Can you also take a look at Kalimba versions?
Yes, these binaries might be reversible at least based on symbols in them. Anyway Kalimba is not a general purpose CPU, so the assembler code might not be easy to read.
@arkq I think I found x86 executables for decoding aptX Adaptive (looks like this includes aptX Lossless as well, which seems to be v2.2 of aptX Adaptive) and aptX Voice (so maybe finally better quality for calls). Would you be interested in taking a look into them?
Yes, I can take a look at it. You can send it on my email or submit PR for this repo with lib added to archives directory. I'm not sure whether I will be able to reverse it to C code in a reasonable time period (I've got lots of other things on my head currently), but at leas I will check how much effort will be required :)
@arkq PR was submitted. It will probably be a lot of effort, maybe even more than kalimba ones (they at least have the debug information)
Do we have progress on this?
Nope. Maybe if there was Ghidra for Kalimba, it wouldn't be hard to reverse engineer. Using those executables directly (inside of the emulator) might be easier until someone will add it to Ghidra or IDA (ISA docs are not public tho I have them).