No sound output through USB

Just tried an experiment on my Pi4 with fresh install of latest Buster 2020-02-05.
I have a cheap plugin usb dongle 3D SOUND which I plugged in.

It was recognised by the audio select or (which you get to by right clicking the loudspeaker symbol on the desktop.


In order to use it with Sonic Pi you have to configure jackd to work with it. The easiest way to do this is to use the Qjackctl GUI control for jackd. This is installed by default on Buster, but is not enabled in the Menu. This is easily resolved by selecting Main Menu Editor from Preferences on the Main Menu, and then navigating to Sound & Video on the resulting window, and ticking the box beside QjackCtl to enable the entry in the menu. Click on OK to close the Menu Editor, and then you will find QjackCtl on the Sound & Video section of the Main Menu from where you can start it running.


Now click the setup button.


On the parameters tab you can adjust the Sample Rate, Frame/Period and Periods/Buffer.
These will affect the audio latency, and it is a trade off to get low latency, versus the audio breaking up because there is not enough time for it to be processed. With the USB card I had I could use the settings shown, whereas you needed a larger buffer size 1024, 0r 2048 with the built in audio on the Raspberry Pi. If you get a lot of break up on the settings you choose, you can alter then, and restart qjackctl and then Sonic Pi again. If you have an older Pi, you will also find that you need a larger buffer.

The Advanced tab lets you specify which audio card to use. I find it is safer to specify this directly rather than use default. Here I specified USB Headphones for the Output Device and USB Audio (hw,0) for input

You can leave other panels as they are and click OK to save the settings.

BEFORE you click the start button, it is a good idea to make sure that jackd is not already running. If you have used Sonic Pi in the current session (without qjackctl) then it leaves the copy of jackd running that it starts up.
start a terminal window, and type killall jackd in it, then close the window again.

Now click the start button for QjackCtl and the screen will “light up” all being well as jackd starts up.
11JPG
Now you can start Sonic Pi. (For this demonstration I used the version supplied with Buster, although it is in fact cut-down and doesn’t support Midi or OSC calls, and I usually use my own build of Sonic Pi 3.2dev which does).
12JPG

When Sonic Pi has started, bring QjackCtl to the front again.
13JPG

Open the Connext Window.
14JPG

You should see that SuperCollider output is connected to the system audio input.
If your usb card also supports input, you can open the system output (rather confusingly this is your microphone input) and connect it to SuperColliders input ports (by default 2 available in Sonic Pi).
In my case it was a mono input so there is only one connection to make.

15JPG

Now all being well you can start playing Sonic Pi through your audio USB output.

16JPG

Whn you quit Sonic Pi, you can quit jackd in QjackCtl then close that down.

On subsequent runs, QjacCtl will remember your audio settings and you just start jackd from it BEFORE you start Sonic Pi. You will still have to connect the input if you want to use that. It is possible to automate that, but I think this post is long enough already!

Finally to whet your appetite, here is the same setup, this time with Sonic Pi 3.2dev with new scopes and transparent screen.
17

have fun!

4 Likes