balena-io-experimental / balena-sound

Build a single or multi-room streamer for an existing audio device using a Raspberry Pi! Supports Bluetooth, Airplay and Spotify Connect
https://balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/
MIT License
2.44k stars 432 forks source link

USB DAC isn't recognized (SONY UDA-1) #496

Open buzuddha opened 3 years ago

buzuddha commented 3 years ago

Hi all,

I'm working with a SONY UDA-1 connected via USB. I've tried power cycling the pi but I'm still getting audio through the stereo headphone jack.

Anything I can do to force USB audio?

Thanks!

HOST OS VERSION balenaOS 2.83.10+rev1 Raspberry Pi 4 (using 64bit OS)Raspberry Pi 4 (using 64bit OS) CURRENT RELEASE d2a9ae8 SUPERVISOR VERSION 12.9.3

joegibes commented 3 years ago

I don't have that DAC but I had this problem getting my Focusrite Scarlett 2i4 to work over USB.

This solution worked for me: https://github.com/balenalabs/balena-sound/issues/314#issuecomment-715248194 @cpwood

FWIW, I was able to workaround this temporarily by getting an SSH session in the audio service and issuing the following commands:

pactl list

to find the name of the sink for my USB DAC, and then using that name:

pactl set-default-sink alsa_output.usb-soundcard-1.analog-stereo

I actually was able to set Device Variable (in balena dashboard) AUDIO_OUTPUT = alsa_output.usb-soundcard-0.analog-surround-40 (the sink I found from pactl list).

I theorize that I had this problem (even on the latest balenaSound) because the Scarlett 2i4 has 4 outputs - thus making it 'surround' rather than 'stereo'. Maybe the Sony has multiple outputs too?

buzuddha commented 3 years ago

Do I need to install pulseaudio?


root@balena:~# pactl list
bash: pactl: command not found

Slash how do you even install stuffz on the balena via cli? A goog of "balena package manager" doesn't turn up much useful.

Also, would would I just add "AUDIO_OUTPUT" or would I need "BALENA_HOST_CONFIG_AUDIO_OUTPUT"?

eiddor commented 3 years ago

You have to be in the audio container - you will find pactl there.

buzuddha commented 3 years ago

Hmmm from the audio container pactl list | grep usb doesn't produce any result, even after rebooting the pi with the dac plugged in and turned on. pactl list gives: http://ix.io/3AyD

From the OS root lsusb gives

Bus 002 Device 001: ID 1d6b:0003  
Bus 001 Device 001: ID 1d6b:0002 

dmesg gives: http://ix.io/3AyB methinks this line might be relevant usb usb1-port1: unable to enumerate USB device usb-devices gives: http://ix.io/3AyC

Any thoughts?

plisker commented 9 months ago

I actually was able to set Device Variable (in balena dashboard) AUDIO_OUTPUT = alsa_output.usb-soundcard-0.analog-surround-40 (the sink I found from pactl list).

Was going crazy, this worked for me as well with my own USB device after looking up the value with pactl. Thanks!