[Q] apt-X and other vendor-specific A2DP codecs

Search This thread

magickone

Member
Jun 18, 2010
22
6
Considering P880's mediocre analog audio output, I'm wondering would it be possible to stream high-quality apt-X or AAC encoded music over A2DP to a stereo bluetooth headphones/headset? Samsung Galaxy S III and HTC One X have apt-X support but it seems that P880 doesn't.

I'm not particularly familiar with Android, but I'm a Linux power user (admin). I've seen this piece of code and it seems to me that Android uses Linux 'BlueZ' bluetooth stack.

Code:
./android/external/bluetooth/bluez/audio/a2dp.h:  
#define A2DP_CODEC_SBC          0x00
#define A2DP_CODEC_MPEG12       0x01
#define A2DP_CODEC_MPEG24       0x02
#define A2DP_CODEC_ATRAC        0x03

Considering that audio codecs for A2DP bluetooth profile on Android are implemented in software, we could (easily?) add support for AAC, MP3 or any other codec supported by targeting receiver, besides SBC which is mandatory. The only problem with apt-X is IP and licensing issues so free distribution of such hack would be out of question, but I still wonder... If some end user is willing to pay for the license, is there any way to add support for apt-X by installing some software package on this phone? Licesing issues aside (just for educational purposes), would it be possible to copy "Vendor-Specific A2DP codec" from lets say Samsung Galaxy SIII and paste it into another vendor's Android smartphone (BlueZ stack)?

Harman Kardon has a BT headphones which support AAC streaming through A2DP, so at least there's a chance for OSS improvement over SBC.
 

OS_Hacking

Senior Member
Sep 10, 2012
529
957
Welcome to our forum , I hope you will find what you need .
Personally ... I didn't understand any thing :D:D . OSS ,A2DP,SBC,AAC (it's like a DNA code :D )

But generally the problem with kernel or modules (/system/lib/modules/*.ko) .
You can call modules as an "extra" things complied by developers . For example Bluetooth mouse or keyboard . As I understand it's a headphone ??

Good to see a good linux user ,, maybe you can made kernels (it's mostly based on linux) .



Sent From My LG-P880 (O4X) .
By Pressing "THANKS" You Will Help Me ;) .
 
Last edited:

magickone

Member
Jun 18, 2010
22
6
Welcome to our forum , I hope you will find what you need .
Thank you for your reply and warm welcome. :)

Personally ... I didn't understand any thing :D:D . OSS ,A2DP,SBC,AAC (it's like a DNA code :D )
OSS - Open Source Software :)
A2DP - Advanced Audio Distribution Profile is a Bluetooth standard which defines how high quality audio is streamed wirelessly
SBC - Subband Coding is a default audio codec in A2DP (and it's not very good one but it's free for Bluetooth applications)
AAC - Advanced Audio Coding is an audio codec which could be considered successor to MP3 (good for higher bitrates - not so much for low bitrates)
apt-X is a proprietary audio codec which achieves good compression rates with low computational overhead and short coding latency without sacrificing subjective audio quality (in short awesome :))

A2DP uses SBC by default (and sounds terrible) but it can also use AAC (much better) and any other "vendor-specific codec" such as apt-X (preferably) or even Opus (very good open source audio codec for low bitrate voice and audio applications).

But generally the problem with kernel or modules (/system/lib/modules/*.ko) .
You can call modules as an "extra" things complied by developers . For example Bluetooth mouse or keyboard . As I understand it's a headphone ??
Kernel modules are loadable parts of kernel which are in essence drivers for hardware or complex subsystems.

I don't need driver for my Bluetooth controller, I just need software (apt-X) codec so my P880 can stream better quality audio. :)

Good to see a good linux user ,, maybe you can made kernels (it's mostly based on linux) .
I hope so. :)
 
Last edited:

OS_Hacking

Senior Member
Sep 10, 2012
529
957
Thanks for those informations ,, relly useful .
About modules I thought you meant a new hardware (special headphone or something like that) .
If it's a software , it can be ported (but I don't know how :D) .
There is beats audio and xLoud MODs in xda and it should work on any android .



Sent From My LG-P880 (O4X) .
By Pressing "THANKS" You Will Help Me ;) .
 
Last edited:

pierg75

Senior Member
I was thinking to use the 4X as source media (thanks to the SD card slot and all flac files) too, but ATM I'm just waiting for the unlocked boot loader and then cm10.1 to use an external USB DAC to completely bypass the internal one (very mediocre).


Sent from my Nexus 7 using Tapatalk 2
 

magickone

Member
Jun 18, 2010
22
6
Thanks for those informations ,, relly useful .
You're welcome. :)

About modules I thought you meant a new hardware (special headphone or something like that).
Bluetooth headphones and headsets don't need any drivers because they comply with the standard and negotiate connection parameters with a host device. But, if one of them doesn't support proposed codec then connection will default to mandatory one (SBC in case of A2DP).

Optimus 4X HD supports A2DP but it seems that it lacks apt-X codec so it will fallback to SBC even with most advanced and most expensive headphones. I'm trying to solve that.

If it's a software , it can be ported (but I don't know how :D) .
There is beats audio and xLoud MODs in xda and it should work on any android .
Theoretically it could be solved but there's an IP (intellectual property) issue. I'm afraid that CSR's (company which supplies it to HTC and Samsung) apt-X codec is distributed as a binary library or compiled by phone manufacturers for their respective smartphone models and Android versions, and possibly even encrypted or obfuscated in order to protect licensed IP.

Our best shot would be to "steal" apt-X codec from HTC One X, or any other Tegra 3 device which supports it and runs Ice Cream Sandwich. That way there is a good chance it will load and run even if we had simply copied precompiled library.
 
Last edited:

magickone

Member
Jun 18, 2010
22
6
I was thinking to use the 4X as source media (thanks to the SD card slot and all flac files) too, but ATM I'm just waiting for the unlocked boot loader and then cm10.1 to use an external USB DAC to completely bypass the internal one (very mediocre).
If you are willing to go with wires (USB) couldn't you simply use MTP for audio reproduction?

Of course, for home or office music listening we always have DLNA (Wi-Fi) option.

I'm trying enable this phone (P880) to transmit high-quality audio (voice/music) "on the go", with low-power wireless interconnection (Bluetooth A2DP with apt-X codec). In car I could use USB charger and stream music to my stereo over DLNA or simply through mass storage mode (need rooting), but while I'm walking... there is no much options.
 

OS_Hacking

Senior Member
Sep 10, 2012
529
957
For LG-P880 forum you are a developer .
I don't think you will get help ,, most of xda developers don't hear music .
Try contact "team acid" it is a team on xda their work is on music and they have their own music MOD (like beats , xloud ...) maybe they can help . Or maybe they are already did that .
Good Luck .


Sent From My LG-P880 (O4X) .
By Pressing "THANKS" You Will Help Me ;) .
 
  • Like
Reactions: magickone

AAlchemy

New member
Feb 25, 2013
1
0
I'm pretty sure the library that handles aptX is called libbt-aptx-4.1.1.so (probably with a different version number).
I got a few hits on a google searching for "libbt-aptx-*.so"
 

dmk0

Member
Jun 28, 2011
31
0
I don't own any LG phones. But figured it is suited to this topic since I cannot find a good enough thread in other forums.
Many new Samsung and HTC phone has apt-x but when installing a custom rom is this function no longer valid? This is the number one bummer for a tinkerer who wants to install a custom rom on their device if this is true :(.

It would be great if true if someone could give a way to transfer that license to a new custom rom, after all it is the same phone you purchased with the license. However I can see this being abused, use on unlicensed phones.

But maybe where lucky and I don't know what I'm talking about, maybe the software isn't in the rom and is in the kernal or on the bluetooth chip in the phone and you only need a driver for the custom rom software.

Wishful thinking, I guess...
 

AltekLeo

Member
May 6, 2011
6
0
The code "Android ROM for EVO LTE based on Android 4.0.4 ICS, Sense 4.1, Sprint 2.13.651.1 RUU - Google Project Hosting" can be found searching for "libbt-aptx-4.0.4.so andoid inbreded-lte-rom". Hope to be of help for someone who...
 
Last edited:

BenG7

Senior Member
Jun 24, 2009
562
73
The code "Android ROM for EVO LTE based on Android 4.0.4 ICS, Sense 4.1, Sprint 2.13.651.1 RUU - Google Project Hosting" can be found searching for "libbt-aptx-4.0.4.so andoid inbreded-lte-rom". Hope to be of help for someone who...

Hi
I'm also interested in keeping the Apt-X support on my GS3 while moving away from the stock rom, but the rom I use, AOKP, will not implement a proprietary codec.
Could it be as simple as extracting the libbt-aptx-4.0.4.so from /system/lib from the default rom and copy it into the /system/lib of the desired rom with the same permissions?
Thanks
Beng
 

AltekLeo

Member
May 6, 2011
6
0
BenG7,
yes that could be possible but no one in this thread reported success.
Magickone quoted CSR could have inserted model specific check code to prevent a driver transfer to a different phone.
In that case the check code has to be taken out of the source code, and the library has to be recompiled with the appropriate development system, if that is available from google.
If someone has done that I would like to see a detailed report.
But if you use the library on the same model GS3 it might work well (and might be legal), if the support for apt-x has not been taken out elsewhere.
I am not familiar enough to making and debugging android or linux driver libraries to determine if there are any further restrictions or obstacles.
Thanks
 

LocutusEstBorg

Senior Member
Jul 25, 2011
351
62
You probably have a crap phone or crap Bluetooth receiver. SBC supports bit rates up to 320 kb/s. Using my Galaxy S2, HS3000 (supports aptX but my S2 doesn't) and Klipsch Image X10i, I honestly cannot tell the difference between SBC and a wired external DAC. 320 kb/s SBC must be at least as good as 128 kb/s MP3.

aptX should only be used to reencode incompatible sources such as uncompressed real time audio or other codecs. AAC files should be streamed directly over A2DP without using aptX. Of couse, the receiver should support AAC.
 

CZ Eddie

Senior Member
Sep 27, 2011
6,397
2,442
Austin, TX
Hi folks, I hope you'll take a look at my thread for APT-X development. The idea is to get APT-X working for AOSP ROM's on phones that originally shipped with the APT-X codec.

APT-X for AOSP Developement thread:
http://xdaforums.com/showthread.php?p=48157222#post48157222

Considering P880's mediocre analog audio output, I'm wondering would it be possible to stream high-quality apt-X or AAC encoded music over A2DP to a stereo bluetooth headphones/headset?

I'm pretty sure the library that handles aptX is called libbt-aptx-4.1.1.so (probably with a different version number).
I got a few hits on a google searching for "libbt-aptx-*.so"

The code "Android ROM for EVO LTE based on Android 4.0.4 ICS, Sense 4.1, Sprint 2.13.651.1 RUU - Google Project Hosting" can be found searching for "libbt-aptx-4.0.4.so andoid inbreded-lte-rom". Hope to be of help for someone who...

You probably have a crap phone or crap Bluetooth receiver. SBC supports bit rates up to 320 kb/s. Using my Galaxy S2, HS3000 (supports aptX but my S2 doesn't) and Klipsch Image X10i, I honestly cannot tell the difference between SBC and a wired external DAC. 320 kb/s SBC must be at least as good as 128 kb/s MP3.

aptX should only be used to reencode incompatible sources such as uncompressed real time audio or other codecs. AAC files should be streamed directly over A2DP without using aptX. Of couse, the receiver should support AAC.

??
APTX is a clearly audible difference when playing the same source file over standard Bluetooth (SBC) vs. APTX.
Even the numbers show the difference:

aptx.jpg
 

Attachments

  • aptx.jpg
    aptx.jpg
    52.4 KB · Views: 296

erotavlas

Senior Member
Apr 23, 2014
78
3
Hi,
I read that blueZ support A2DP 1.3. I would like to know if only SBC is supported or also AAC and apt-x. I took a look at source code of latest version 5.30 and I found that file a2dp-codecs.h contains many define of AAC and apt-x and it should support both even if the latter has IP issue.
However, how can I know if I'm using SBC or AAC or apt-x with my smartphone and on my linux server?
Thank you
 

Antaroo

Senior Member
Aug 9, 2014
149
11
Whats the difference beetwen 4.0.3 and 4.1.1 version. Older is kinda f**** up. Music skips/stutter over bluetooth. So i wonder if i can just replace new codec over the old one.
What ya think ?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Welcome to our forum , I hope you will find what you need .
    Thank you for your reply and warm welcome. :)

    Personally ... I didn't understand any thing :D:D . OSS ,A2DP,SBC,AAC (it's like a DNA code :D )
    OSS - Open Source Software :)
    A2DP - Advanced Audio Distribution Profile is a Bluetooth standard which defines how high quality audio is streamed wirelessly
    SBC - Subband Coding is a default audio codec in A2DP (and it's not very good one but it's free for Bluetooth applications)
    AAC - Advanced Audio Coding is an audio codec which could be considered successor to MP3 (good for higher bitrates - not so much for low bitrates)
    apt-X is a proprietary audio codec which achieves good compression rates with low computational overhead and short coding latency without sacrificing subjective audio quality (in short awesome :))

    A2DP uses SBC by default (and sounds terrible) but it can also use AAC (much better) and any other "vendor-specific codec" such as apt-X (preferably) or even Opus (very good open source audio codec for low bitrate voice and audio applications).

    But generally the problem with kernel or modules (/system/lib/modules/*.ko) .
    You can call modules as an "extra" things complied by developers . For example Bluetooth mouse or keyboard . As I understand it's a headphone ??
    Kernel modules are loadable parts of kernel which are in essence drivers for hardware or complex subsystems.

    I don't need driver for my Bluetooth controller, I just need software (apt-X) codec so my P880 can stream better quality audio. :)

    Good to see a good linux user ,, maybe you can made kernels (it's mostly based on linux) .
    I hope so. :)
    1
    For LG-P880 forum you are a developer .
    I don't think you will get help ,, most of xda developers don't hear music .
    Try contact "team acid" it is a team on xda their work is on music and they have their own music MOD (like beats , xloud ...) maybe they can help . Or maybe they are already did that .
    Good Luck .


    Sent From My LG-P880 (O4X) .
    By Pressing "THANKS" You Will Help Me ;) .