Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HD audio codec instead of lossy SBC #141

Open
saddy001 opened this issue Aug 9, 2022 · 1 comment
Open

HD audio codec instead of lossy SBC #141

saddy001 opened this issue Aug 9, 2022 · 1 comment

Comments

@saddy001
Copy link

saddy001 commented Aug 9, 2022

It would be nice if an HD audio codec would be used instead of the lossy SBC. If the source material is lossy too (mp3) the overall quality doesn't improve ;-)
I have tested AAC myself and it works, although I have tested with alsa, not pulseaudio. Even better would be aptX HD.

Resources:
https://codeberg.org/epinez/raspi-bt-hd-audio-receiver
https://forums.raspberrypi.com/viewtopic.php?t=283158

@rriemann
Copy link

Back in December 2020, I changed the rpi-audio-receiver to cover aptX. I do not have the device in my home, but these are my notes from back then:

  • export PKG_CONFIG_PATH=/home/pi/ffmpeg_build/lib/pkgconfig

  • sudo apt install libdbus-1-dev glib-2-dev libbluetooth-dev libasound2-dev autoconf libtool libsbc-dev libmp3lame-dev libavcodec-dev libsndfile-dev

  • ../configure --enable-aac --enable-msbc

  • https://github.com/Arkq/openaptx for aptx support

  • ../configure --enable-aac --enable-msbc --prefix=/usr/local --program-suffix=-debug --enable-mp3lame --enable-debug --enable-aptx --enable-aptx-hd

To check Hardware support for Codecs:

  • pactl list to get MAC
  • deconnect the device
  • avinfo 20:74:CF:36:C4:83 with own MAC

Back then, I did not know yet about SBC-XQ:

Looking at Df medians we can safely conclude that audio quality of SBC XQ is comparable to aptX HD. And for BT EDR3 devices SBC XQ slightly surpasses aptX HD. It will be impossible to tell them apart in a blind listening test. SBC codec uses primitive psychoacoustic model for encoding and aptX does not use it at all, so their perceived audio quality is determined mostly by bitrate. Different settings of SBC, including SBC XQ, can be compared to aptX and aptX HD aurally with the help of Bluetooth A2DP SBC/aptX online encoder [5].

All current BT stereo devices could use this higher quality encoding. It just suffices to modify BT stack of sending device. Receiving BT devices that support only mandatory SBC codec will benefit most from this trick.

At the moment the required patch is included into LineageOS, Resurrection Remix and crDroid forks of Android. The patch for Linux PulseAudio from Pali Rohár besides SBC XQ also adds support for aptX, aptX HD and FastStream codecs [6]. This extra quality is for free. It's hard to imagine any objection to including this option into all BT stacks and the main Android branch.

I invite you to read the entire article at: http://soundexpert.org/articles/-/blogs/audio-quality-of-sbc-xq-bluetooth-audio-codec

Does blueALSA has support for SBC-XQ? There is a related issue in their Github arkq/bluez-alsa#548 which suggests that it is just a matter of proper configuration.

In any way, I suggest to mention the currently supported audio codecs in the README.md and if need be, add documentation of how more audio codecs can be enabled. I will do some tests myself in the next days and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants