Skip to content

Commit

Permalink
feat: use all codecs available in blue-alsa
Browse files Browse the repository at this point in the history
  • Loading branch information
duhow committed Dec 20, 2024
1 parent ea0b5a6 commit 32e6e70
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions patches/22_bluetooth_add_codecs.patch
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 32e6e70

Please sign in to comment.