<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Getting PD working with USB soundcard on Raspberry Pi and Satellite CCRMA]]></title><description><![CDATA[<p>I purchased a USB C-Media Audio Adapter found <a href="https://www.adafruit.com/product/1475" rel="nofollow">here</a>, then followed the instructions at <a href="https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/instructions" rel="nofollow">https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/instructions</a> to get it working with the Raspberry Pi Model B and Satellite CCRMA.</p>
<p>In short, I successfully updated the firmware. Small note that I followed the more recent rpi-update instructions found Hexxeh's on <a href="https://github.com/Hexxeh/rpi-update" rel="nofollow">github</a>:</p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ /opt/vc/bin/vcgencmd</strong><br />
<code>version Aug 20 2014 22:50:27</code><br />
<code>Copyright (c) 2012 Broadcom</code><br />
<code>version daf2c8c0795066867ef863d938bbbcc7391f1b4a (tainted) (release)</code></p>
<p>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.</p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ cat /etc/modprobe.d/alsa-base.conf</strong><br />
<code># autoloader aliases</code><br />
<code>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</code><br />
<code># Cause optional modules to be loaded above generic modules</code><br />
<code>install snd /sbin/modprobe --ignore-install snd &amp;&amp; { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; : ; }</code><br />
<code>install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi &amp;&amp; { /sbin/modprobe --quiet snd-seq-midi ; : ; }</code><br />
<code>install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 &amp;&amp; { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }</code><br />
<code># Keep snd-pcsp from beeing loaded as first soundcard</code><br />
<code>options snd-pcsp index=-2</code><br />
<code># Keep snd-usb-audio from beeing loaded as first soundcard</code><br />
<code># options snd-usb-audio index=-2</code><br />
<code># options snd-usb-audio index=0</code><br />
<code># Prevent abnormal drivers from grabbing index 0</code><br />
<code>options bt87x index=-2</code><br />
<code>options cx88_alsa index=-2</code><br />
<code>options snd-atiixp-modem index=-2</code><br />
<code>options snd-intel8x0m index=-2</code><br />
<code>options snd-via82xx-modem index=-2</code><br />
<code>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $</code></p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ cat /proc/asound/cards</strong><br />
<code>0 [Set ]: USB-Audio - C-Media USB Headphone Set</code><br />
<code>C-Media USB Headphone Set at usb-bcm2708_usb-1.2, full speed</code><br />
<code>1 [nanoKONTROL ]: USB-Audio - nanoKONTROL</code><br />
<code>KORG INC. nanoKONTROL at usb-bcm2708_usb-1.3, full speed</code><br />
<code>2 [ALSA ]: bcm2835 - bcm2835 ALSA</code><br />
<code>bcm2835 ALSA</code><br />
<code>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $</code></p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ aplay -l</strong><br />
<code>List of PLAYBACK Hardware Devices</code><br />
<code>card 0: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]</code><br />
<code>Subdevices: 0/1</code><br />
<code>Subdevice #0: subdevice #0</code><br />
<code>card 2: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]</code><br />
<code>Subdevices: 8/8</code><br />
<code>Subdevice #0: subdevice #0</code><br />
<code>Subdevice #1: subdevice #1</code><br />
<code>Subdevice #2: subdevice #2</code><br />
<code>Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7</code><br />
<code>card 2: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]</code><br />
<code>Subdevices: 1/1</code><br />
<code>Subdevice #0: subdevice #0</code></p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ cat /dev/sndstat</strong><br />
<code>Sound Driver:3.8.1a-980706 (ALSA emulation code)</code><br />
<code>Kernel: Linux satellite 3.12.26+ #704 PREEMPT Wed Aug 20 22:35:11 BST 2014 armv6l</code><br />
<code>Config options: 0</code></p>
<p><code>Installed drivers:</code><br />
<code>Type 10: ALSA emulation</code></p>
<p><code>Card config:</code><br />
<code>C-Media USB Headphone Set at usb-bcm2708_usb-1.2, full speed</code><br />
<code>KORG INC. nanoKONTROL at usb-bcm2708_usb-1.3, full speed</code><br />
<code>bcm2835 ALSA</code></p>
<p><code>Audio devices: NOT ENABLED IN CONFIG</code></p>
<p><code>Synth devices: NOT ENABLED IN CONFIG</code></p>
<p><code>Midi devices:</code><br />
<code>1: nanoKONTROL</code></p>
<p><code>Timers:</code><br />
<code>7: system timer</code></p>
<p><code>Mixers: NOT ENABLED IN CONFIG</code></p>
<p>Next I rebooted the rpi, ssh'd back in and success playback through the USB card with both speaker-test and asound:<br />
<strong>speaker-test -c2 -D hw:0,0<br />
aplay /usr/share/sounds/alsa/Front_Center.wav</strong></p>
<p>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:<br />
<strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ pd -nogui -midiindev 1 /home/ccrma/on-startup/sounds.pd</strong><br />
<code>ALSA output error (snd_pcm_open): Device or resource busy</code><br />
<code>priority 6 scheduling enabled.</code><br />
<code>couldn't open MIDI input device 1</code><br />
<code>opened 0 MIDI input device(s) and 1 MIDI output device(s).</code><br />
<code>ALSA output error (snd_pcm_open): Device or resource busy</code><br />
<code>priority 8 scheduling enabled.</code></p>
<p>Oops, so now it looks like I could be running into the dreaded PD delay start <a href="http://puredata.info/docs/faq/why-doesn-t-audio-work-when-i-start-pd-in-nogui-mode" rel="nofollow">bug</a>. So I know change my patch to have a delay before the pd dsp kicks in:</p>
<p><code>[loadbang]</code><br />
<code>|</code><br />
<code>[delay 100]</code><br />
<code>|</code><br />
<code>[; pd dsp 1]</code></p>
<p>To no avail, I'm still getting the error:<br />
<code>ALSA output error (snd_pcm_open): Device or resource busy</code></p>
<p>So lets use lsof to see if something is holding on to the card:<br />
<code>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ lsof | grep snd</code><br />
<code>...nothing...</code></p>
<p>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.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8585/getting-pd-working-with-usb-soundcard-on-raspberry-pi-and-satellite-ccrma</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 22:53:44 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/8585.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 23 Aug 2014 21:36:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Getting PD working with USB soundcard on Raspberry Pi and Satellite CCRMA on Sat, 23 Aug 2014 23:16:10 GMT]]></title><description><![CDATA[<p>I purchased a USB C-Media Audio Adapter found <a href="https://www.adafruit.com/product/1475" rel="nofollow">here</a>, then followed the instructions at <a href="https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/instructions" rel="nofollow">https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/instructions</a> to get it working with the Raspberry Pi Model B and Satellite CCRMA.</p>
<p>In short, I successfully updated the firmware. Small note that I followed the more recent rpi-update instructions found Hexxeh's on <a href="https://github.com/Hexxeh/rpi-update" rel="nofollow">github</a>:</p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ /opt/vc/bin/vcgencmd</strong><br />
<code>version Aug 20 2014 22:50:27</code><br />
<code>Copyright (c) 2012 Broadcom</code><br />
<code>version daf2c8c0795066867ef863d938bbbcc7391f1b4a (tainted) (release)</code></p>
<p>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.</p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ cat /etc/modprobe.d/alsa-base.conf</strong><br />
<code># autoloader aliases</code><br />
<code>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</code><br />
<code># Cause optional modules to be loaded above generic modules</code><br />
<code>install snd /sbin/modprobe --ignore-install snd &amp;&amp; { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; : ; }</code><br />
<code>install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi &amp;&amp; { /sbin/modprobe --quiet snd-seq-midi ; : ; }</code><br />
<code>install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 &amp;&amp; { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }</code><br />
<code># Keep snd-pcsp from beeing loaded as first soundcard</code><br />
<code>options snd-pcsp index=-2</code><br />
<code># Keep snd-usb-audio from beeing loaded as first soundcard</code><br />
<code># options snd-usb-audio index=-2</code><br />
<code># options snd-usb-audio index=0</code><br />
<code># Prevent abnormal drivers from grabbing index 0</code><br />
<code>options bt87x index=-2</code><br />
<code>options cx88_alsa index=-2</code><br />
<code>options snd-atiixp-modem index=-2</code><br />
<code>options snd-intel8x0m index=-2</code><br />
<code>options snd-via82xx-modem index=-2</code><br />
<code>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $</code></p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ cat /proc/asound/cards</strong><br />
<code>0 [Set ]: USB-Audio - C-Media USB Headphone Set</code><br />
<code>C-Media USB Headphone Set at usb-bcm2708_usb-1.2, full speed</code><br />
<code>1 [nanoKONTROL ]: USB-Audio - nanoKONTROL</code><br />
<code>KORG INC. nanoKONTROL at usb-bcm2708_usb-1.3, full speed</code><br />
<code>2 [ALSA ]: bcm2835 - bcm2835 ALSA</code><br />
<code>bcm2835 ALSA</code><br />
<code>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $</code></p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ aplay -l</strong><br />
<code>List of PLAYBACK Hardware Devices</code><br />
<code>card 0: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]</code><br />
<code>Subdevices: 0/1</code><br />
<code>Subdevice #0: subdevice #0</code><br />
<code>card 2: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]</code><br />
<code>Subdevices: 8/8</code><br />
<code>Subdevice #0: subdevice #0</code><br />
<code>Subdevice #1: subdevice #1</code><br />
<code>Subdevice #2: subdevice #2</code><br />
<code>Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7</code><br />
<code>card 2: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]</code><br />
<code>Subdevices: 1/1</code><br />
<code>Subdevice #0: subdevice #0</code></p>
<p><strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ cat /dev/sndstat</strong><br />
<code>Sound Driver:3.8.1a-980706 (ALSA emulation code)</code><br />
<code>Kernel: Linux satellite 3.12.26+ #704 PREEMPT Wed Aug 20 22:35:11 BST 2014 armv6l</code><br />
<code>Config options: 0</code></p>
<p><code>Installed drivers:</code><br />
<code>Type 10: ALSA emulation</code></p>
<p><code>Card config:</code><br />
<code>C-Media USB Headphone Set at usb-bcm2708_usb-1.2, full speed</code><br />
<code>KORG INC. nanoKONTROL at usb-bcm2708_usb-1.3, full speed</code><br />
<code>bcm2835 ALSA</code></p>
<p><code>Audio devices: NOT ENABLED IN CONFIG</code></p>
<p><code>Synth devices: NOT ENABLED IN CONFIG</code></p>
<p><code>Midi devices:</code><br />
<code>1: nanoKONTROL</code></p>
<p><code>Timers:</code><br />
<code>7: system timer</code></p>
<p><code>Mixers: NOT ENABLED IN CONFIG</code></p>
<p>Next I rebooted the rpi, ssh'd back in and success playback through the USB card with both speaker-test and asound:<br />
<strong>speaker-test -c2 -D hw:0,0<br />
aplay /usr/share/sounds/alsa/Front_Center.wav</strong></p>
<p>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:<br />
<strong>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ pd -nogui -midiindev 1 /home/ccrma/on-startup/sounds.pd</strong><br />
<code>ALSA output error (snd_pcm_open): Device or resource busy</code><br />
<code>priority 6 scheduling enabled.</code><br />
<code>couldn't open MIDI input device 1</code><br />
<code>opened 0 MIDI input device(s) and 1 MIDI output device(s).</code><br />
<code>ALSA output error (snd_pcm_open): Device or resource busy</code><br />
<code>priority 8 scheduling enabled.</code></p>
<p>Oops, so now it looks like I could be running into the dreaded PD delay start <a href="http://puredata.info/docs/faq/why-doesn-t-audio-work-when-i-start-pd-in-nogui-mode" rel="nofollow">bug</a>. So I know change my patch to have a delay before the pd dsp kicks in:</p>
<p><code>[loadbang]</code><br />
<code>|</code><br />
<code>[delay 100]</code><br />
<code>|</code><br />
<code>[; pd dsp 1]</code></p>
<p>To no avail, I'm still getting the error:<br />
<code>ALSA output error (snd_pcm_open): Device or resource busy</code></p>
<p>So lets use lsof to see if something is holding on to the card:<br />
<code>ccrma<a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/satellite">@satellite</a> ~ $ lsof | grep snd</code><br />
<code>...nothing...</code></p>
<p>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.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8585/getting-pd-working-with-usb-soundcard-on-raspberry-pi-and-satellite-ccrma</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8585/getting-pd-working-with-usb-soundcard-on-raspberry-pi-and-satellite-ccrma</guid><dc:creator><![CDATA[n6]]></dc:creator><pubDate>Sat, 23 Aug 2014 23:16:10 GMT</pubDate></item><item><title><![CDATA[Reply to Getting PD working with USB soundcard on Raspberry Pi and Satellite CCRMA on Sun, 24 Aug 2014 04:33:56 GMT]]></title><description><![CDATA[<p>try to start pd like this:<br />
<code>sudo pd-extended -rt -alsa -audiodev 1 -r 48000 -audiobuf 32 -channels 2 -nogui -stderr -open youpatch.pd</code></p>
<p>tweak -audiobuf for lower latency using smaller value or bigger value if you hear glitches. keep the delay (maybe using &gt; 100 ie: 1000);</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8585/getting-pd-working-with-usb-soundcard-on-raspberry-pi-and-satellite-ccrma/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8585/getting-pd-working-with-usb-soundcard-on-raspberry-pi-and-satellite-ccrma/2</guid><dc:creator><![CDATA[EEight]]></dc:creator><pubDate>Sun, 24 Aug 2014 04:33:56 GMT</pubDate></item><item><title><![CDATA[Reply to Getting PD working with USB soundcard on Raspberry Pi and Satellite CCRMA on Sun, 24 Aug 2014 05:22:07 GMT]]></title><description><![CDATA[<p>Thanks <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/eeight">@EEight</a>, I've given that a shot and seem to be getting a similar error:</p>
<p><code>ccrma@satellite ~ $ sudo pd-extended -rt -alsa -audiodev 1 -r 48000 -audiobuf 32 -nogui -stderr -open /home/ccrma/on-startup/sounds.pd</code><br />
<code>verbose(5): Using /usr/lib/pd-extended/startup as startup.</code><br />
<code>verbose(4): Loading /usr/lib/pd-extended/startup/0.libdir.pd_linux</code><br />
<code>verbose(3): libdir loader 1.9</code><br />
<code>verbose(3): compiled on Jan 24 2013 at 20:06:34</code><br />
<code>verbose(3): compiled against Pd version 0.43.4.extended</code><br />
...<br />
<code>ALSA input error (snd_pcm_hw_params_set_channels): Invalid argument</code><br />
<code>priority 6 scheduling enabled.</code><br />
<code>ALSA input error (snd_pcm_open): Device or resource busy</code><br />
<code>ALSA output error (snd_pcm_open): Device or resource busy</code><br />
<code>priority 8 scheduling enabled.</code></p>
<p>I've also tried upping the <code>[delay]</code> to much higher value at <code>10000</code> but still to no avail.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8585/getting-pd-working-with-usb-soundcard-on-raspberry-pi-and-satellite-ccrma/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8585/getting-pd-working-with-usb-soundcard-on-raspberry-pi-and-satellite-ccrma/3</guid><dc:creator><![CDATA[n6]]></dc:creator><pubDate>Sun, 24 Aug 2014 05:22:07 GMT</pubDate></item><item><title><![CDATA[Reply to Getting PD working with USB soundcard on Raspberry Pi and Satellite CCRMA on Thu, 28 Aug 2014 23:28:20 GMT]]></title><description><![CDATA[<p>Figured it out, needle in a haystack (or PD patch that is).</p>
<p>One of my sub patches had <code>[loadbang]</code> with no delay.</p>
<p><code>[loadbang]</code><br />
<code>|</code><br />
<code>|;|</code><br />
<code>|pd dsp 1|</code></p>
<p>/slaps_head</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8585/getting-pd-working-with-usb-soundcard-on-raspberry-pi-and-satellite-ccrma/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8585/getting-pd-working-with-usb-soundcard-on-raspberry-pi-and-satellite-ccrma/4</guid><dc:creator><![CDATA[n6]]></dc:creator><pubDate>Thu, 28 Aug 2014 23:28:20 GMT</pubDate></item></channel></rss>