Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide Moode 8: Add bluetooth codec support for AAC, aptX & aptX-HD to bluez-alsa package
#3
(05-16-2023, 09:16 PM)jenzd Wrote: By default Moode 8 already has built-in support for the bluetooth codecs SBC (receive & playback) and LDAC (playback only) which is provided by the bluez-alsa package. At the time of writing Moode version 8.3.2 includes bluez-alsa in version 4.0.0.

The following guide shows how to additionally include support for the bluetooth codecs AAC, aptX and aptX-HD (each for 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". It follows a slightly different route than the previous guide by scblock which showed how to build & install everything directly from the source code without building a package (see https://moodeaudio.org/forum/showthread.php?tid=3683). In the current approach, the modification is finally installed as a normal package instead. 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.0.0/debian


3) Two files need to be modified here (e.g. using "nano <filename>"):
  • File "rules":

    Add flags for the additional codecs in the CONFIGURE_FLAGS section, so that it reads

Code:
CONFIGURE_FLAGS := \
       --enable-ldac \
       --enable-ofono \
       --enable-manpages \
       --enable-debug \
       --enable-cli \
       --enable-aac \
       --enable-aptx \
       --enable-aptx-hd \
       --with-libopenaptx


instead of the default parameters


Code:
CONFIGURE_FLAGS := \
       --enable-ldac \
       --enable-ofono \
       --enable-manpages \
       --enable-debug \
       --enable-cli

  • 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 "+codecs" at the end of the version string, resulting in "4.0.0-2moode1+codecs" instead of the default "4.0.0-2moode1".

3) Build the modified package:

Code:
# change back to the directory bluez-alsa-4.0.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.0.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 reboot finally)

Code:
# install modified packages from local source
sudo apt install ./bluez-alsa-utils_4.0.0-2moode1+codecs_arm64.deb ./libasound2-plugin-bluez_4.0.0-2moode1+codecs_arm64.deb

# reboot
sudo reboot


The additional codecs should now be used automatically when a supported bluetooth device is connected.



Final note: In case you want to remove the modification again, just reinstall the unmodified versions provided by Moode from the package repository.

Hello,

I followed your clear guide however when I connect my aptX HD/LDAC capable POCO F5 Pro to moOde it defaults to AAC codec. I removed AAC from the rules source file, repackaged bluez-alsa-utils and reinstalled it and it defaults to SBC.

Note, that my phone successfully negotiates the LDAC codec with my SMSL SU-9 PRO DAC.

Did I miss something to get LDAC or AptX HD instead of ACC or SBC by default ?

Thanks in advance,
Romain
Reply


Messages In This Thread
RE: Moode 8: Add bluetooth codec support for AAC, aptX & aptX-HD to bluez-alsa package - by romain - 05-18-2023, 01:06 PM

Forum Jump: