![]() |
[How to do instruction] Moode 9: Add AAC bluetooth codec support - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: FAQ and Guides (https://moodeaudio.org/forum/forumdisplay.php?fid=9) +--- Thread: [How to do instruction] Moode 9: Add AAC bluetooth codec support (/showthread.php?tid=6724) |
Moode 9: Add AAC bluetooth codec support - jenzd - 07-17-2024 Moode 9 already has built-in support for a wide range of common bluetooth codecs (SBC, aptX, aptX-HD both as source and sink; LDAC just as source) via bluez-alsa. Moode version 9.0.4 includes bluez-alsa in version 4.2.0. AAC support (e.g. widely used by Apple devices) is missing, however, since the necessary codec library libfdk-aac2 is marked as "non-free" in Debian Bookworm so that it is not allowed to distribute binaries linking against it. The following guide shows how to manually add the missing AAC codec support (both as source and sink) by building a modified version of Moode's bluez-alsa package. The resulting .deb files are finally installed via apt like any other normal package. They can easily be copied to other (fresh or existing) installations of Moode to directly install them there without the need to rebuild every time. Note also that there should not be any 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 is performed directly in Moode using ssh access, e.g. on a fresh installation: 1) After logging into Moode via ssh, we start with installing the necessary build dependencies: Code: # update package repository 2) Then we download the bluez-alsa source package to the current directory and change into its configuration directory: Code: # download bluez-alsa source package 3) Two files need to be modified here - rules and changelog (e.g. using nano <filename>): - File rules: Add a flag for the AAC codec at the end of the CONFIGURE_FLAGS section so that it reads: Code: CONFIGURE_FLAGS := \ - File changelog: Edit the version string in the first line of the file to distinguish it from the version provided by Moode, e.g. by adding "+aac" to the end of the version string, resulting in: Code: bluez-alsa (4.2.0-2moode1+aac) UNRELEASED; urgency=medium 4) Build the modified package: Code: # change back to the directory bluez-alsa-4.2.0/ If the build process was successful, the parent directory of bluez-alsa-4.2.0/ should now contain a set of modified .deb packages. The following two files are the important ones, as only these two are necessary for the final installation step (which could as well be performed on a separate Moode installation - just copy these two to the new destination): Code: bluez-alsa-utils_4.2.0-2moode1+aac_arm64.deb 5) Install the modified .deb packages via apt and finally reboot: Code: # install modified packages from local source The AAC codec should now be used automatically when a supported bluetooth device is connected. Final notes: - You can easily check which codecs are supported by bluez-alsa using the command Code: bluealsa-cli status - After connecting a bluetooth device you can also check which codec is actually in use using the command Code: bluealsa-cli -v list-pcms - As the modification was installed as a package, it can easily be uninstalled by reinstalling Moode's original version (currently version 4.2.0-2moode1). Code: sudo apt install bluez-alsa-utils=4.2.0-2moode1 libasound2-plugin-bluez=4.2.0-2moode1 Best regards Jens RE: Moode 9: Add AAC bluetooth codec support - halverhahn - 07-24-2024 Thank you very much for this guide, it works flawlessly! Code: Service: org.bluealsa Code: /org/bluealsa/hci0/dev_80_54_9C_0C_5F_A4/a2dpsnk/source RE: Moode 9: Add AAC bluetooth codec support - funkster - 11-14-2024 @jenzd thanks ![]() Code: funkster@moodepod:~ $ bluealsa-cli status I'm guessing that after every in-place 9.x update we will have to rebuild and reinstall from scratch, yes? RE: Moode 9: Add AAC bluetooth codec support - TheOldPresbyope - 11-14-2024 @funkster I haven’t looked at the code recently, so don’t hold me to this, but I expect you can save and keep reinstalling the altered bluez-alsa package until such time as Tim bumps moOde to a new version of bluez-alsa (currently 4.2.0) or the libraries on which the build is dependent change significantly. Anyway, there no harm in trying the same build. This guide tells how to revert if necessary. Regards, Kent RE: Moode 9: Add AAC bluetooth codec support - jenzd - 11-14-2024 (11-14-2024, 12:38 PM)funkster Wrote: I'm guessing that after every in-place 9.x update we will have to rebuild and reinstall from scratch, yes? No, that's actually not necessary as long as Tim does not bump Moode to a newer version of bluez-alsa (which he hasn't for quite some time). The version string of the modified package "4.2.0-2moode1+aac" is technically higher than the original version "4.2.0-2moode1". It's therefore not overwritten/downgraded during the in-place update. Even if you decide to reinstall Moode 9.x from scratch it is not necessary to rebuild the package. Just save the two .deb files bluez-alsa-utils_4.2.0-2moode1+aac_arm64.deb and libasound2-plugin-bluez_4.2.0-2moode1+aac_arm64.deb of the old installation, copy them to the new Moode installation and run sudo apt install ./bluez-alsa-utils_4.2.0-2moode1+aac_arm64.deb ./libasound2-plugin-bluez_4.2.0-2moode1+aac_arm64.deb again. That's the benefit of using packages. ![]() Cheers, Jens RE: Moode 9: Add AAC bluetooth codec support - jenzd - 03-09-2025 Update: Tim fixed the issue in the current Moode version 9.3.0. There is no need to downgrade to the original bluez-alsa version berfore running the in-place update anymore. Unfortunately, the in-place update to the recently released Moode version 9.2.6 currently fails in "** Step 05-32: Install bluez-alsa-utils=4.2.0-2moode1" if the modified version of the bluez-alsa package is installed. Before running this update, you first have to reinstall Moode's original version Code: sudo apt install bluez-alsa-utils=4.2.0-2moode1 libasound2-plugin-bluez=4.2.0-2moode1 In case the update has already failed, you can, however, easily repeat/repair it by then issuing the command Code: sudo /var/www/util/system-updater.sh moode9 After the update to Moode 9.2.6 succeeded, you can safely reinstall the modified .deb files again Code: sudo apt install ./bluez-alsa-utils_4.2.0-2moode1+aac_arm64.deb ./libasound2-plugin-bluez_4.2.0-2moode1+aac_arm64.deb Note that Tim Curtis has already wrote that he is considering to fix this in a future version of the update script. Best regards, Jens RE: Moode 9: Add AAC bluetooth codec support - Tim Curtis - 03-09-2025 Have a look at updated install script. https://github.com/moode-player/updates/blob/main/moode-player/update9/install.sh See the section commented # 4 Install package updates. Theres a bit of code that skips the package updates if installed +acc packages exist. RE: Moode 9: Add AAC bluetooth codec support - jenzd - 03-15-2025 The solution works, yet relies on "+aac" appearing in the package name. A more flexible solution could be to keep any newer version which a user might have installed by hand. After playing around with dpkg a bit, I found the following method to compare the installed version against a requested version ("4.2.0-2moode1" in this case): Code: if dpkg --compare-versions $(dpkg-query -W -f='${Version}' bluez-alsa-utils) ge "4.2.0-2moode1"; then echo "Newer or equal version"; else echo "Older version"; fi Best regards, Jens RE: Moode 9: Add AAC bluetooth codec support - Tim Curtis - 03-15-2025 (03-15-2025, 02:38 AM)jenzd Wrote: The solution works, yet relies on "+aac" appearing in the package name. I'll test it out, thanks. |