I purchased a USB C-Media Audio Adapter found here, then followed the instructions at https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/instructions to get it working with the Raspberry Pi Model B and Satellite CCRMA.
In short, I successfully updated the firmware. Small note that I followed the more recent rpi-update instructions found Hexxeh's on github:
ccrma@satellite ~ $ /opt/vc/bin/vcgencmd
version Aug 20 2014 22:50:27
Copyright (c) 2012 Broadcom
version daf2c8c0795066867ef863d938bbbcc7391f1b4a (tainted) (release)
Then commented out: # options snd-usb-audio index=-2. I am told you can either comment out the -2 line or add 'options snd-usb-audio index=0' and should yield the same selection results.
ccrma@satellite ~ $ cat /etc/modprobe.d/alsa-base.conf
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0 install sound-slot-1 /sbin/modprobe snd-card-1 install sound-slot-2 /sbin/modprobe snd-card-2 install sound-slot-3 /sbin/modprobe snd-card-3 install sound-slot-4 /sbin/modprobe snd-card-4 install sound-slot-5 /sbin/modprobe snd-card-5 install sound-slot-6 /sbin/modprobe snd-card-6 install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; : ; }
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }
# Keep snd-pcsp from beeing loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
# options snd-usb-audio index=-2
# options snd-usb-audio index=0
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
ccrma@satellite ~ $
ccrma@satellite ~ $ cat /proc/asound/cards
0 [Set ]: USB-Audio - C-Media USB Headphone Set
C-Media USB Headphone Set at usb-bcm2708_usb-1.2, full speed
1 [nanoKONTROL ]: USB-Audio - nanoKONTROL
KORG INC. nanoKONTROL at usb-bcm2708_usb-1.3, full speed
2 [ALSA ]: bcm2835 - bcm2835 ALSA
bcm2835 ALSA
ccrma@satellite ~ $
ccrma@satellite ~ $ aplay -l
List of PLAYBACK Hardware Devices
card 0: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 2: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
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 Subdevice #7: subdevice #7
card 2: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
ccrma@satellite ~ $ cat /dev/sndstat
Sound Driver:3.8.1a-980706 (ALSA emulation code)
Kernel: Linux satellite 3.12.26+ #704 PREEMPT Wed Aug 20 22:35:11 BST 2014 armv6l
Config options: 0
Installed drivers:
Type 10: ALSA emulation
Card config:
C-Media USB Headphone Set at usb-bcm2708_usb-1.2, full speed
KORG INC. nanoKONTROL at usb-bcm2708_usb-1.3, full speed
bcm2835 ALSA
Audio devices: NOT ENABLED IN CONFIG
Synth devices: NOT ENABLED IN CONFIG
Midi devices:
1: nanoKONTROL
Timers:
7: system timer
Mixers: NOT ENABLED IN CONFIG
Next I rebooted the rpi, ssh'd back in and success playback through the USB card with both speaker-test and asound:
speaker-test -c2 -D hw:0,0
aplay /usr/share/sounds/alsa/Front_Center.wav
Ok great, since the above tests passed now it looks like I'm ready to try PD with the new USB soundcard. Let's do it:
ccrma@satellite ~ $ pd -nogui -midiindev 1 /home/ccrma/on-startup/sounds.pd
ALSA output error (snd_pcm_open): Device or resource busy
priority 6 scheduling enabled.
couldn't open MIDI input device 1
opened 0 MIDI input device(s) and 1 MIDI output device(s).
ALSA output error (snd_pcm_open): Device or resource busy
priority 8 scheduling enabled.
Oops, so now it looks like I could be running into the dreaded PD delay start bug. So I know change my patch to have a delay before the pd dsp kicks in:
[loadbang]
|
[delay 100]
|
[; pd dsp 1]
To no avail, I'm still getting the error:
ALSA output error (snd_pcm_open): Device or resource busy
So lets use lsof to see if something is holding on to the card:
ccrma@satellite ~ $ lsof | grep snd
...nothing...
I've started to run out of ideas, it seems to be a problem specific to Pure Data and not an issue with the soundcard itself as I'm able to play audio through it with aplay.