From 32e6e70af0af7321c6964781f1f67c91e3ac39ba Mon Sep 17 00:00:00 2001 From: duhow Date: Fri, 20 Dec 2024 15:03:20 +0100 Subject: [PATCH] feat: use all codecs available in blue-alsa --- patches/22_bluetooth_add_codecs.patch | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 patches/22_bluetooth_add_codecs.patch diff --git a/patches/22_bluetooth_add_codecs.patch b/patches/22_bluetooth_add_codecs.patch new file mode 100644 index 0000000..9b54710 --- /dev/null +++ b/patches/22_bluetooth_add_codecs.patch @@ -0,0 +1,28 @@ +# When building blue-alsa with more codecs, +# each codec must be specified to be used. +--- a/etc/init.d/bluetooth 2021-06-28 04:23:39.000000000 +0200 ++++ b/etc/init.d/bluetooth 2024-12-20 14:47:01.932052590 +0100 +@@ -15,12 +15,21 @@ + PROG3=/usr/bin/bluez_mibt_classical + PROG5=/usr/bin/bluez_mibt_ble + ++function bluealsa_get_codecs() { ++ CODECS="" ++ for NAME in `bluealsa --help | grep -i -A5 "Available BT audio codecs:" | grep "a2dp-sink:" | awk '{$1=""; print $0}' | tr -d ','` ; do ++ CODECS="${CODECS} -c ${NAME}" ++ done ++} ++ + function bluealsa_start() { ++ bluealsa_get_codecs ++ + procd_open_instance + if [ $DEBUG = "1" ]; then +- procd_set_param command "$PROG1" -i hci0 -p a2dp-sink -S ++ procd_set_param command "$PROG1" -i hci0 -p a2dp-sink -S ${CODECS} + else +- procd_set_param command "$PROG1" -i hci0 -p a2dp-sink ++ procd_set_param command "$PROG1" -i hci0 -p a2dp-sink ${CODECS} + fi + procd_append_param respawn 3600 + procd_append_param respawn 5