sonic-pi-net / sonic-pi

Code. Music. Live.
https://sonic-pi.net
Other
10.76k stars 921 forks source link

Sonic Pi locks USB audio device (Raspbian) #1070

Closed enajski closed 6 years ago

enajski commented 8 years ago

Hey,

I noticed that when running Sonic Pi on a Raspberry Pi 3 with a USB sound card the audio device is unavailable to other programs in ALSA:

Before opening Sonic Pi:

pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: USB [MAYA44 USB], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

With Sonic Pi started:

pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: USB [MAYA44 USB], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Notice Subdevices: 0/1. I'd like to use darkice to stream the audio to an Icecast2 server but the USB audio device is not available to darkice. As a sidenote: I plugged the output of the card back into the input using a cable, setting up streaming of the input seems a far less painful endeavour then trying to stream the mixed output.

I have my USB sound card set as the default in ~/.asoundrc:

pcm.!default {
        type hw
        card 1
}

ctl.!default {
        type hw
        card 1
}

Is there any way to configure Sonic Pi so that it does not lock the audio device? Or is this just because of JACK / USB audio on Linux in general?

Thanks, Wojtek

samaaron commented 8 years ago

Very good question - personally I don't know the answer to this. I only ever tend to use Sonic Pi as the sole app on my RP and I use an audio card HAT rather than a USB device.

If you could have a dig around to see if you can find out what's up then let me know. If not, I'll try and look at it after v2.10 has been released.

enajski commented 8 years ago

Thanks Sam,

I'll post here if I find anything.

hzulla commented 8 years ago

jackd blocks the audio device it is using. If you want multiple programs to connect to your audio device, they all have to use a jackd audio driver.

samaaron commented 6 years ago

Closing this for now.