Invalid audio device #2 -- USB Audio on Raspberrian Stretch

J
Joe posted Mar 28, 01:36:

Got everything up and running using the onboard audio jack.

Ordered and plugged in a small USB Audio jack, but I can't get it to work.

System ids and recognizes the USB Audio device, but I can't get audio to route to it.

aplay -l output:

List of PLAYBACK Hardware Devices
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

configured /usr/share/alsa/alsa.conf with the following lines:

defaults.ctl.card 1
defaults.pcm.card 1

When i set the AUDIO_DEVICE_ID = 2 and then try to run python samplebox.py I get

'Invalid audio device #2'

same result with 3

1 seems to be working, but not to the USB audio device... maybe that is HDMI?

not sure what to try next, thanks for your help in advance.

J
Joe posted Mar 28, 15:56:

I got the USB audio working.. not entirely sure how.. but I have some guesses...

previously I had used 'amixer cset numid=3 1' to force audio to the onboard jack from HDMI before I had the USB audio adapter.

I set this back to "auto" using 'amixer cset numid=3 0'

I also rebooted...

and also, I had modified the samplerbox py to only accept midi on a specific channel... so some of my earlier tests might have worked and I didn't realize it because it wasn't actually getting any midi notes.

Z
Zplosiw posted Jul 20, 08:44:

Hey,

I had the same problem: bought a USB dac but it didn't work with any AUDIO_DEVICE_ID numbers (I tried 0 - 5) in tye samplerbox.py

But then I did the alsa configuration you mentioned:

/usr/share/alsa/alsa.conf with the following lines:

defaults.ctl.card 1
defaults.pcm.card 1

And now it works with audio_device_id 2!

Z
Zplosiw posted Jul 20, 08:46:

The way I did it, btw, was to plug the microsd containing the OS to my windows laptop and open it with EXT2FS program so I'm able to access it. The rest was easy.

...

  (not published)
  I want to post as guest
 

Post