Friday, July 10, 2020

Raspberry Pi 4 4GB and USB Audio

There have been a number of reports of issues with USB on the Raspberry Pi 4. I am however encountering an USB audio-related issue that has not been described. I'm running Raspberry Pi OS (32-bit) Lite Version:May 2020. I've connected a USB speaker to the Pi. Sometimes when I play an audio file, aplay complains that it cannot open the audio device. In the terminal output below, you can see that the first two commands were successful but fails on the third. The state of audio system remains in this state indefinitely.

I have attempted the same exercise on the Raspberry Pi 3, and aplay never fails. If anyone has a solution, please let me know.

root@jazz:~# aplay piano2.wav
Playing WAVE 'piano2.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
root@jazz:~# alsamixer
root@jazz:~# aplay piano2.wav
Playing WAVE 'piano2.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
root@jazz:~# aplay piano2.wav
ALSA lib pcm_direct.c:1271:(snd1_pcm_direct_initialize_slave) unable to install hw params
ALSA lib pcm_dmix.c:1120:(snd_pcm_dmix_open) unable to initialize slave
aplay: main:828: audio open error: Broken pipe
root@jazz:~# aplay piano2.wav
ALSA lib pcm_direct.c:1271:(snd1_pcm_direct_initialize_slave) unable to install hw params
ALSA lib pcm_dmix.c:1120:(snd_pcm_dmix_open) unable to initialize slave
aplay: main:828: audio open error: Broken pipe

I have attempted using the Ubuntu Raspberry Pi OS as well as limiting the memory of the 4GB Pi to 3GB. None of these attempts were successful.

No comments: