Open sydragos opened 1 year ago
rpi-imager
and 16 GiB USB drive)sudo bluealsa -p a2dp-sink -c LDAC
pairable on
and discoverable on
in bluetoothctl, pair your phone once and later use bt-agent --capability=NoInputNoOutput &
bluealsa-aplay
Now it started playing music. There seems to be a bug with changing sampling rate in bluealsa-aplay, but it's definitely issue with BluezALSA, not with my lib. After changing sample rate on phone from i.e. 96 kHz to 48 (or changing codec), music will be still played like with 96 kHz, so constant ALSA playback PCM underrun
will be reported until bluealsa-aplay
is restarted.
UPD: this only happens in qemu and rpi os lite, so some resampling alsa component must be missing.
Report your issue to whatever distro you're using, something is clearly misconfigured.
Do you think there could be an issue with 32 vs 64bit images? I will rebuild/retry on an Rpi OS Lite, and report back.
That might be the case, but it's unlikely.
How do you run bluealsa? It should be sudo bluealsa -p a2dp-sink -c LDAC
I run it with multiple codecs so I can select on my phone later: -c LDAC -c SBC -c aptx-HD Recompiled LDAC with your instructions, it's the only codec that doesn't play any sound (I2S or HDMI speakers).
Tried on Moode and Rpi Lite OS. 32 vs 64bit board issue?
Edit: please let me know how to debug further...
I'd say it's Moode issue, but if you're getting same issue with RPi OS Lite, it might be a problem with I2S or HDMI speakers (LDAC is 96 kHz, other codecs are 44.1/48, so maybe you DAC isn't properly configured). Try 3.5 mm audio output, that's what I've used with my RPi 4
The Pi Zero W has no output jack. I did try putting down the sampling frequency to 44.1 or 48kHz, I see a change in the bluez-alsa logs, but no sound is coming out. What other commands/logs could I look into?
Did you restart everything after changing frequency? bluez-alsa can force everything to be 44.1 kHz IIRC, so try that or remove temporarily disable 96 and 88.2 kHz sampling rates in source code. You can also try changing bitrate or using different phone.
The best way to see what's going on is to run dumpcap to capture Bluetooth packets, this will help understand why is there no sound. You can write simple program to parse the pcap file (or just export it into json and parse it) and feed the data into LDAC decoder (see ldacdec.c as a reference). To turn on debugging info in libldacdec, uncomment CFLAGS += -DDEBUG_ADAPTATION
line in makefile and rebuild. It will print a lot of useful information.
Also, was the MTU set properly by kernel? bluez-alsa should print it
Is this the MTU log line? bluealsa: [20744] D: ../../src/ba-transport.c:724: A2DP socket MTU: 14: R:672 W:1024
With the modded kernel and modules I see it as: bluealsa: [1371] D: ../../src/ba-transport.c:724: A2DP socket MTU: 14: R:1021 W:1024
Yes, that's correct. Modified kernel seems to do the trick
Hey, decided to open a separate issue to track it better.
Build bluez-alsa with: ../configure --enable-aac --enable-ofono --enable-aptx --enable-aptx-hd --with-libopenaptx --enable-ldac --enable-debug --enable-cli --with-alsaplugindir=/usr/lib/arm-linux-gnueabihf/alsa-lib
The syslogs appear identical when switching between aptX-HD and LDAC. But this is interesting:
So even if LDAC was negotiated with the phone, it doesn't actually appear here as so. Moreover, I can use this command to change to any other codec except LDAC:
But it was compiled in as mentioned in the readme:
EDIT: Using latest bluez-alsa or "--with-alsaplugindir=/usr/lib/arm-linux-gnueabihf/alsa-lib" doesn't change anything. Using recompiled kernel with your changes (but moode's original kernel modules, otherwise no audio out).