LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   If you want AptX and other high(er) quality codec support... (https://www.linuxquestions.org/questions/slackware-14/if-you-want-aptx-and-other-high-er-quality-codec-support-4175649747/)

alex14641 03-07-2019 04:20 PM

If you want AptX and other high(er) quality codec support...
 
Give this a try: https://github.com/EHfive/pulseaudio-modules-bt. I'm currently using with some AptX compatible headphones, and I can tell the difference. You will have to upgrade ffmpeg to 4.x.

1337_powerslacker 03-08-2019 08:04 AM

Quote:

Originally Posted by alex14641 (Post 5971424)
Give this a try: https://github.com/EHfive/pulseaudio-modules-bt. I'm currently using with some AptX compatible headphones, and I can tell the difference. You will have to upgrade ffmpeg to 4.x.

I've got a Denon AVR-S510BT with 2 front and 2 rear speakers, and I've already had great sound come out of it, and honestly, I can't tell a whole lot of difference. Maybe it makes a bigger difference with headphones than with a stereo system. But I'm of the opinion that it's better to have such options available. Thanks for letting us know about this, alex.

alex14641 03-08-2019 02:09 PM

Quote:

Originally Posted by 1337_powerslacker (Post 5971645)
I've got a Denon AVR-S510BT with 2 front and 2 rear speakers, and I've already had great sound come out of it, and honestly, I can't tell a whole lot of difference. Maybe it makes a bigger difference with headphones than with a stereo system. But I'm of the opinion that it's better to have such options available. Thanks for letting us know about this, alex.

What codecs does the device support?

1337_powerslacker 03-08-2019 02:20 PM

Quote:

Originally Posted by alex14641 (Post 5971799)
What codecs does the device support?

As suggested by the project's Wiki page, I ran the following command:

Code:


pactl list sinks | grep -e bluez -e a2dp_codec

Part of that output is the following:

Code:

bluetooth.a2dp_codec = "AAC"
Is there a way to get pulseaudio to accept a different codec, or does it just use what it detects the bluetooth device can support?

alex14641 03-08-2019 03:03 PM

Quote:

Originally Posted by 1337_powerslacker (Post 5971806)
As suggested by the project's Wiki page, I ran the following command:
Is there a way to get pulseaudio to accept a different codec, or does it just use what it detects the bluetooth device can support?

Per the docs, the modules will automatically choose the best supported codec for the device. My headphones actually show 'AptX' when I ran the same command.

1337_powerslacker 03-08-2019 03:47 PM

Quote:

Originally Posted by alex14641 (Post 5971828)
Per the docs, the modules will automatically choose the best supported codec for the device. My headphones actually show 'AptX' when I ran the same command.

After going through the instructions outlined in the docs, it looks like AAC is the only codec supported by my receiver.

EDIT: Since the AAC codec was stated as having been added as part of those modules, it looks like it was not effort wasted.

1337_powerslacker 03-08-2019 08:52 PM

ffmpeg 4.x can be installed alongside 3.x!
 
From the SlackBuilds page:

Quote:

ffmpeg4 should be installable alongside ffmpeg 3.x without conflict.

By default it will not build the ffmpeg binaries or man-pages, in order
not to conflict with an ffmpeg 3.x package.

To link to this version of the ffmpeg libraries, you'll need to set
the PKG_CONFIG_PATH to "/usr/lib${LIBDIRSUFFIX}/ffmpeg4/pkgconfig"
where ${LIBDIRSUFFIX} is either 64 or an empty string, depending on
your architecture.

Following the instructions, I was able to install support for AptX & other codecs supported in ffmpeg 4.x without touching the installed 3.x. I rebuilt the pulseaudio-modules-bt package, and it detected the libraries and installed support for the codecs. So I don't disrupt support for packages that require (and depend upon) 3.x to operate. I could re-compile packages for 4.x support, but on balance, it's much easier to install a sister package for 4.x support.

alex14641 03-09-2019 04:17 PM

Thanks for the info about ffmpeg version coexistence. I've created and installed packages for both.

1337_powerslacker 03-10-2019 07:28 AM

Quote:

Originally Posted by alex14641 (Post 5972177)
Thanks for the info about ffmpeg version coexistence. I've created and installed packages for both.

You're welcome!

alex14641 03-11-2019 04:35 PM

Note: In order for multiple versions of ffmpeg to coexist, you must do either
1) Add the directory containing the ffmpeg 4 libs to /etc/ld.so.conf
2) Set the LDFLAGS environment variable to '-Wl,-rpath=/usr/lib64/ffmpeg4' before configuring the ffmpeg4 and bluetooth modules for building. Replace /usr/lib64/ffmpeg4 with the directory containing your ffmpeg 4 libs.

I did 2) to ensure no conflict with existing applications.

To determine whether the modules support all codecs, look for the following in /var/log/messages:
Code:

Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/VENDOR/LDAC
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/VENDOR/APTXHD
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/VENDOR/APTX
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/AAC
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/SBC
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSink/VENDOR/APTXHD
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSink/VENDOR/APTX
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSink/AAC
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSink/SBC

These are the codecs the modules support, not what a particular device supports. Note the presence of APTX and APTXHD codecs

If the module can't load the correct ffmpeg libraries, you will see the following:
Code:

Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSource/VENDOR/LDAC
Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSource/AAC
Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSource/SBC
Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSink/AAC
Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSink/SBC

You cannot verify that the modules link to the correct ffmpeg version by looking at the output of ldd, as the modules load the ffmpeg libraries via dlopen.

1337_powerslacker 03-12-2019 07:54 AM

Quote:

Originally Posted by alex14641 (Post 5972807)
Note: In order for multiple versions of ffmpeg to coexist, you must do either
1) Add the directory containing the ffmpeg 4 libs to /etc/ld.so.conf
2) Set the LDFLAGS environment variable to '-Wl,-rpath=/usr/lib64/ffmpeg4' before configuring the ffmpeg4 and bluetooth modules for building. Replace /usr/lib64/ffmpeg4 with the directory containing your ffmpeg 4 libs.

I did 2) to ensure no conflict with existing applications.

To determine whether the modules support all codecs, look for the following in /var/log/messages:
Code:

Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/VENDOR/LDAC
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/VENDOR/APTXHD
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/VENDOR/APTX
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/AAC
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSource/SBC
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSink/VENDOR/APTXHD
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSink/VENDOR/APTX
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSink/AAC
Mar 11 18:01:26 boss4 bluetoothd[11960]: Endpoint registered: sender=:1.171 path=/MediaEndpoint/A2DPSink/SBC

These are the codecs the modules support, not what a particular device supports. Note the presence of APTX and APTXHD codecs

If the module can't load the correct ffmpeg libraries, you will see the following:
Code:

Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSource/VENDOR/LDAC
Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSource/AAC
Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSource/SBC
Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSink/AAC
Mar 10 23:15:03 boss4 bluetoothd[1053]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSink/SBC

You cannot verify that the modules link to the correct ffmpeg version by looking at the output of ldd, as the modules load the ffmpeg libraries via dlopen.

Thanks for the info, alex! Something to keep in mind. My configuration works to my satisfaction.


All times are GMT -5. The time now is 11:08 PM.