Bluetooth codec/bitrates logging? - Android Software Development

My android device (currently Note 5) has both aptx and SBC codecs for bluetooth. SBC has varying bitrates (High quality, medium quality, etc).
Obviously, the android system needs to handshake with the bluetooth sink to find a mutually compatible codec.
How can I log the actual codec and bitrate used by my (rooted, 6.0.1)) android phone when it is sending bluetooth audio?

Related

Bluetooth A2DP mp3 codec

Hi to all Devs and Pros here in the Forum,
I have recently been staying at a friend who owns an iPad and has a setup where he listens to all his music on his iPad and Online Radio via A2DP streaming to his Stereo via a relatively cheap belkin Bluetooth A2DP receiver.
The quality is absolutely perfect and ti sounds as though he has a wired connection.
I had my Iconia with me and also gave it a try. Unfortunately the sound quality was best said acceptable and nothing near the one of the iPad.
So I did some googling about it and found out that A2DP supports various codecs but only enforced one: SBC which seems to be a rather low quality option.
So my guess is Android / our Iconia is only using the SBC codec instead e.g. MP3 which is supported by most HW A2DP receivers todays (also the cheaper ones)
I found that there is a possibility to allow non-SBC codecs in Android to some degree by changing the following settings in '/system/etc/bluetooth/audio.conf'
Code:
[A2DP]
SBCSources=[COLOR="Red"][0|1][/COLOR]
MPEG12Sources=[COLOR="Red"][0|1][/COLOR]
I tried this but when enabling the MPEG12Sources I am not able to connect to any A2DP device at all (I tried 2-3 different ones).
On some place I read that to use e.g. MP3 as a codec license fees for the device manufacturer would apply.
So here are my questions:
Could it be that Acer has simply left this unimplemented? If yes do we have any chance to add this somehow to the system?
Or is it possible to change the settings for SBC to a higher quality?
I am looking forward to any of your thoughts or ideas about this...
/schaze
schaze said:
Hi to all Devs and Pros here in the Forum,
I have recently been staying at a friend who owns an iPad and has a setup where he listens to all his music on his iPad and Online Radio via A2DP streaming to his Stereo via a relatively cheap belkin Bluetooth A2DP receiver.
The quality is absolutely perfect and ti sounds as though he has a wired connection.
I had my Iconia with me and also gave it a try. Unfortunately the sound quality was best said acceptable and nothing near the one of the iPad.
So I did some googling about it and found out that A2DP supports various codecs but only enforced one: SBC which seems to be a rather low quality option.
So my guess is Android / our Iconia is only using the SBC codec instead e.g. MP3 which is supported by most HW A2DP receivers todays (also the cheaper ones)
I found that there is a possibility to allow non-SBC codecs in Android to some degree by changing the following settings in '/system/etc/bluetooth/audio.conf'
Code:
[A2DP]
SBCSources=[COLOR="Red"][0|1][/COLOR]
MPEG12Sources=[COLOR="Red"][0|1][/COLOR]
I tried this but when enabling the MPEG12Sources I am not able to connect to any A2DP device at all (I tried 2-3 different ones).
On some place I read that to use e.g. MP3 as a codec license fees for the device manufacturer would apply.
So here are my questions:
Could it be that Acer has simply left this unimplemented? If yes do we have any chance to add this somehow to the system?
Or is it possible to change the settings for SBC to a higher quality?
I am looking forward to any of your thoughts or ideas about this...
/schaze
Click to expand...
Click to collapse
I changed the MPEG12Sources to 1 and I can connect my Nokia BH-214 and it works fine.

A2DP Bluetooth Codecs Support?

Dears,
I need your help.
As we all might know, A2DP Bluetooth profile supports only few codecs for transmitting audio stream:
SBS - general, supported by all bluetooth devices with A2DP profile, has the lowest sound quality coding
APTX - closed by license, good quality coding, but it is paid, lot of devices don't use it.
AAC, MP3 - good quality coding, free, but also not supported by lot of devices.
What kinds of BT coding does NOTE3 Bluetooth stack support? I realy know that SBC and APTX.
What about ACC and MP3?
Thank you in advance!
I am sorry! please, move it to Q&A thread! I am really sorry!

[Q] Does LG G2 support Audio Tunneling to DSP on kitkat?

[Q] Does LG G2 support Audio tunneling on kitkat? Just like Nexus 5?
Audio Tunneling to DSP
For high-performance, lower-power audio playback, Android 4.4 adds platform support for audio tunneling to a digital signal processor (DSP) in the device chipset. With tunneling, audio decoding and output effects are off-loaded to the DSP, waking the application processor less often and using less battery.
Audio tunneling can dramatically improve battery life for use-cases such as listening to music over a headset with the screen off. For example, with audio tunneling, Nexus 5 offers a total off-network audio playback time of up to 60 hours, an increase of over 50% over non-tunneled audio.
Media applications can take advantage of audio tunneling on supported devices without needing to modify code. The system applies tunneling to optimize audio playback whenever it's available on the device.
Visualizer showing loudness enhancer audio effect
Visualization of how the LoudnessEnhancer effect can make speech content more audible.
Audio tunneling requires support in the device hardware. Currently audio tunneling is available on Nexus 5 and we're working with our chipset partners to make it available on more devices as soon as possible.
Click to expand...
Click to collapse
https://developer.android.com/about/versions/kitkat.html
I'd also like to know that.

What's better to use, aptX HD, aptX or SBC for Bluetooth?

The OnePlus 5 has those 3 options but I do not know the difference between them or which is best to use. Any help would be appreciated. Thank you!
+1
Both the phone and Bluetooth device have to support AptX for it to work, so often your issue resolved by that.
AptX will provide better sound than SBC. SBC is the default codec used by the A2DP Bluetooth profile.
So, in short, if your headphones/speakers have AptX, use that. If they don't, SBC.
What happens if you choose aptX if your device doesn't support it?
yubimusubi said:
What happens if you choose aptX if your device doesn't support it?
Click to expand...
Click to collapse
It will probably just switch to SBC so the connection will work, as that's the baseline standard in Bluetooth. I couldn't say with absolute certainty, as my OP5 hasn't arrived yet.
AptX is a proprietary thing - someone other than the Bluetooth consortium developed it and licenses it. That's why not everything has it - you have to pay to use it in the products you make. They created AptX because the default Bluetooth audio profile pretty much sucks when you start to examine how it butchers bit depth and sample rates just to cram audio data across a low power wireless signal.
On the flip side of that coin - yeah, AptX is better (and I'd use it if both devices supported it) but the audio quality differences are probably not going to readily apparent when listening to $20 to $50 Bluetooth devices. It's been my experience that it takes a somewhat trained ear and better-than-good equipment to be able to easily spot the difference. So, if you're an audiophile, you probably already know to stay away from Bluetooth for the best quality sound. If you're not an audiophile, try to use the best Bluetooth profile you can, but don't sweat it too much.
The A2DP profile is negociated at pairing and the best supported by both devices is picked (SBC < AptX < AptX HD). Problem is that the codec is just one link in the whole daisy chain. Other equally important aspects:
- music source quality (don't expect 128 kbps CBR mp3 to sound good)
- DAC and amplifier (each and every sound system that converts bits to sound has these!)
- speakers (from those in IEM's to those in BT boom boxes - they are all speakers)
So just that you're using AptX doesn't imply you are listening to high quality sound and probably implementing AptX and putting its logo on the product is the cheapest and least development intensive way to raise the price of a product.
Just my two (euro) cents...
Hi,
The question here is how the phone behaves when a higher quality codec has been selected (eg aptX) and a standard bluetooth headset (SBC - only )has been connected?
So far it seems to work (but then the question is why there is a selection available)
Best Regards
Joerg
My wild guess is that tis setting acts like a low-pass filter threshold. The phone will negotiate the highest available option without going above setting.
If the setting is AptX, the phone and speaker support AptX HD, the connection will be made at AptX quality. If the speaker only supports SBC, the connection will be made with SBC.
Honestly I don't see the point in such a setting. 99% of the people would want the best quality available anyway.
Is there a power consumption difference?
Sent from my ONEPLUS A5000 using Tapatalk
daniel_loft said:
My wild guess is that tis setting acts like a low-pass filter threshold. The phone will negotiate the highest available option without going above setting.
If the setting is AptX, the phone and speaker support AptX HD, the connection will be made at AptX quality. If the speaker only supports SBC, the connection will be made with SBC.
Honestly I don't see the point in such a setting. 99% of the people would want the best quality available anyway.
Click to expand...
Click to collapse
It makes sense to have the setting *if* for some reason you want to force SBC or the non-HD aptX. I have it set to aptX HD right now and it seems to work with my car (I'm about 95% sure it doesn't support aptX).
The real question is, if it fails back appropriately, why on Earth would OnePlus set the *default* to SBC?
@aa_chow: There surely is a consumption difference. SBC was designed decades ago with low computational complexity in mind (among others). On the current smartphone hardware (which is probably on par with a medium desktop from 5-6 years ago) the difference would be so small that measurements are impossible (you might see a difference on the battery life of the speakers, but I wouldn't loose my time there) .
@yubimusubi: I cannot even find the reason why that setting is even there! It only limits the best usable codec, which makes no sense to me. Maybe you can find more answers on the oneplus forums.
lag
with the sb, i experience music lag from when i have played in 1 minute and it continues, is it low power consumption or something on sbc? I'm gonna try the apex option when i get home to check if its better.
I'm suffering micro breaks on HD audio (320 bitrate MP3) from aptX HD, aptX or SBC.
Is there a way to correct it?
All my files are stored at 320 and I doesn't have time to convert to a bitrate of 128
Edit: No issues with iPhone 7+ and Huawei P10 using the same BT headset and MP3 files
bartito said:
I'm suffering micro breaks on HD audio (320 bitrate MP3) from aptX HD, aptX or SBC.
Is there a way to correct it?
All my files are stored at 320 and I doesn't have time to convert to a bitrate of 128
Edit: No issues with iPhone 7+ and Huawei P10 using the same BT headset and MP3 files
Click to expand...
Click to collapse
I have an issue on my International LG G6 where it sounds like the 24 bit lossless tracks are essentially dropping frames to borrow a gaming term. Then it will correct itself. It happened on my VW and the problem persists in my wife's new Subaru.
The LG G6 sports Aptx HD. Any ideas?
i prefer aptX but then again ive been using it quite a while now
APTX-HD do not work on One Plus 5. The music hacks constant.

Bluetooth Audio codec in developer options reverting to default setting

https://forums.oneplus.com/threads/...ault-setting-after-5-1-0-update-in-5t.821840/
According to this topic in the Oneplus forums, it has been down by design. Is there a mod or something that you can do in order to unable it?
saar17 said:
https://forums.oneplus.com/threads/...ault-setting-after-5-1-0-update-in-5t.821840/
According to this topic in the Oneplus forums, it has been down by design. Is there a mod or something that you can do in order to unable it?
Click to expand...
Click to collapse
No, since otherwise, your headphones wouldn't work. You can't use AptX HD on a headphone that only supports AAC or SBC. If your headphones support both AptX and AAC, the system will let you change that. The same goes for the rest of the settings. Every BT headphone supports the SBC standard, headphones that are Apple branded (AirPods, Beats) and others use AAC and higher priced BT headphones with Qualcomm chips support AptX (HD) and AAC. Higher end Sony headphones use LDAC. All of these support the lowest quality standard SBC. There's absolutely no need to any of these, since it would just break things.

Categories

Resources