05-16-2023, 09:16 PM
Edit: Updated on 06/20/2023 to reflect version 8.3.3 of Moode which already has built-in support for aptX and aptX-HD.
Starting with version 8.3.3, Moode already has built-in support for the bluetooth codecs SBC, aptX, aptX-HD (each for receive & playback) and LDAC (playback only) which is provided by the bluez-alsa package. Moode version 8.3.3 includes bluez-alsa in version 4.1.0.
The following guide shows how to additionally include support for the bluetooth codec AAC (receive & playback) by building a modified version of the included bluez-alsa package. Note that this guide is based on section 5 "Build packages" of Moode's "Master development guide". The modification is finally installed as a normal package, so there should be no side effects on future in-place updates of Moode other than that the modified package might be upgraded to a newer (unmodified) bluez-alsa version.
The build process can be performed directly in Moode using ssh access, e.g. on a fresh installation.
1) After logging into Moode via ssh, we start with installing some additional building tools and dependencies:
2) Then we download Moode's source package for bluez-alsa to the current directory and change into its configuration directory:
3) Two files need to be modified here (e.g. using "nano <filename>"):
instead of the default parameters
3) Build the modified package:
If the build process was successful, the parent directory of "bluez-alsa-4.1.0" should contain a set of modified deb packages.
4) Install the modified deb packages to replace the preinstalled versions of "bluez-alsa-utils" and "libasound2-plugin-bluez" and finally reboot:
The additional codec should now be used automatically when a supported bluetooth device is connected.
You can easily check which codec is in use with the command:
Final note: In case you want to remove the modification again, just reinstall the unmodified versions provided by Moode from the package repository (currently version 4.1.0-2moode2).
Starting with version 8.3.3, Moode already has built-in support for the bluetooth codecs SBC, aptX, aptX-HD (each for receive & playback) and LDAC (playback only) which is provided by the bluez-alsa package. Moode version 8.3.3 includes bluez-alsa in version 4.1.0.
The following guide shows how to additionally include support for the bluetooth codec AAC (receive & playback) by building a modified version of the included bluez-alsa package. Note that this guide is based on section 5 "Build packages" of Moode's "Master development guide". The modification is finally installed as a normal package, so there should be no side effects on future in-place updates of Moode other than that the modified package might be upgraded to a newer (unmodified) bluez-alsa version.
The build process can be performed directly in Moode using ssh access, e.g. on a fresh installation.
1) After logging into Moode via ssh, we start with installing some additional building tools and dependencies:
Code:
# update the package repository
sudo apt update
# install build tools for deb packages
sudo apt install build-essential fakeroot devscripts
# install missing build dependencies for the bluez-alsa package
sudo apt install dh-exec libasound2-dev libbluetooth-dev libsbc-dev pandoc python3-docutils
# install codec libraries and development files for LDAC, AAC and aptx
sudo apt install libldacbt-abr2 libldacbt-abr-dev libldacbt-enc2 libldacbt-enc-dev libfdk-aac2 libfdk-aac-dev libopenaptx0 libopenaptx-dev
2) Then we download Moode's source package for bluez-alsa to the current directory and change into its configuration directory:
Code:
# download bluez-alsa source package
apt source bluez-alsa
# change to its configuration directory
cd bluez-alsa-4.1.0/debian
3) Two files need to be modified here (e.g. using "nano <filename>"):
- File "rules":
Add a flag for the additional AAC codec at the end of the CONFIGURE_FLAGS section, so that it reads
Code:
CONFIGURE_FLAGS := \
--enable-ldac \
--enable-libopenaptx \
--enable-ofono \
--enable-systemd \
--enable-manpages \
--enable-debug \
--enable-cli \
--enable-aptx \
--enable-aptx-hd \
--with-libopenaptx \
--enable-aac
instead of the default parameters
Code:
CONFIGURE_FLAGS := \
--enable-ldac \
--enable-libopenaptx \
--enable-ofono \
--enable-systemd \
--enable-manpages \
--enable-debug \
--enable-cli \
--enable-aptx \
--enable-aptx-hd \
--with-libopenaptx
- File "changelog":
Edit the version of the package in the first line of the file to distinguish it from the original version provided by moode, e.g. by adding "+aac" at the end of the version string, resulting in "4.1.0-2moode2+aac" instead of the default "4.1.0-2moode2".
3) Build the modified package:
Code:
# change back to the directory bluez-alsa-4.1.0/
cd ..
# build the modified package
dpkg-buildpackage -us -uc
# change back to the parent directory
cd ..
If the build process was successful, the parent directory of "bluez-alsa-4.1.0" should contain a set of modified deb packages.
4) Install the modified deb packages to replace the preinstalled versions of "bluez-alsa-utils" and "libasound2-plugin-bluez" and finally reboot:
Code:
# install modified packages from local source
sudo apt install ./bluez-alsa-utils_4.1.0-2moode2+aac_arm64.deb ./libasound2-plugin-bluez_4.1.0-2moode2+aac_arm64.deb
# reboot
sudo reboot
The additional codec should now be used automatically when a supported bluetooth device is connected.
You can easily check which codec is in use with the command:
Code:
# check codec of connected bluetooth device
bluealsa-cli --verbose list-pcms
Final note: In case you want to remove the modification again, just reinstall the unmodified versions provided by Moode from the package repository (currently version 4.1.0-2moode2).
Code:
sudo apt install bluez-alsa-utils=4.1.0-2moode2 libasound2-plugin-bluez=4.1.0-2moode2