Newly installed Patchbox - No Sound out from ALSA!

Hey :slight_smile:

I had an old RPI3 lying that I tried to make a Pure data box out of years ago and never really got it fully working.

And today I stumbled upon Patchbox and was very happy to see that.

I installed it and had it up and running with in half an hour. Which is awesome, thinking about how much time I spend on it years ago.

So a huge thanks for Patchbox :slight_smile:

Anyway to the point:
I am not getting any sounds!

ATM I am trying to use ALSA driver, cause I don’t have an audio interfaces that works with RPI3 yet, but I am planning to get a Pisound. But for now I just want to play around and get the feeling of this little box and can do with just ALSA drivers.

I followed the installation wizard. But my Jack settings didn’t work, so I opened

sudo patchbox-config

And made my Jack settings and started Jack. I had to make buffer setting for 1024 for jack to be able to start.

Then I opened Pure Data and set it to use Jack for audio. In PD I get an error for the Jack midi drivers, but I guess that should matter on the audio, right?

The error:
JACK: cannot connect input ports system:midi_capture_1 -> pure_data:input0
JACK: cannot connect input ports system:midi_capture_2 -> pure_data:input1

I did a quick test patch in pure data and I am sure the audio processing is turned on, so Jack ins running, the audio rate objects are working.

But…

I still can not HEAR any audio from PD. I connected headphones for the audio out of the RPI 3, but no sounds comes out.

I also check audio from the web browser, opening a youtube video and there is also no sound from the browser.

So it might be some overall audio interface setting I am missing here. I know ALSA is working not very well, but I just want to play around a bit until I get the Pisound.

I also updated Patchbox OS, but that didn’t change anything.

Any suggestions to what it might be the problem?

Thanks!

Hey, see https://blokas.io/patchbox-os/docs/GettingStarted/#initial-setup-wizard for suggested audio configuration to use the built-in analog audio output.

Make sure that Jack is running successfully:

sudo systemctl status jack

Feel free to share the output of above command.

Check the volume level in alsamixer too, to see if it’s not muted or silent.

Hey Giederius!

Thank you for the quick answer. I did the command you told and this is the log.

patch@patchbox:~ $ sudo systemctl status jack
● jack.service - JACK Server
Loaded: loaded (/lib/systemd/system/jack.service; enabled; vendor preset: ena
Active: active (running) since Wed 2020-07-15 14:08:20 CEST; 20s ago
Main PID: 1190 (jackd)
Tasks: 5 (limit: 2199)
Memory: 86.1M
CGroup: /system.slice/jack.service
└─1190 /usr/bin/jackd -t 2000 -R -P 95 -d alsa -d hw:ALSA -r 44100 -p

Jul 15 14:08:21 patchbox jackdrc[1190]: ALSA: Cannot open PCM device alsa_pcm fo
Jul 15 14:08:21 patchbox jackdrc[1190]: configuring for 44100Hz, period = 1024 f
Jul 15 14:08:21 patchbox jackdrc[1190]: ALSA: final selected sample format for p
Jul 15 14:08:21 patchbox jackdrc[1190]: ALSA: use 2 periods for playback
Jul 15 14:08:21 patchbox jackdrc[1190]: port created: Midi-Through:midi/playback
Jul 15 14:08:21 patchbox jackdrc[1190]: port created: Midi-Through:midi/capture_
Jul 15 14:08:21 patchbox jackdrc[1190]: port created: RtMidiIn-Client:midi/captu
Jul 15 14:08:21 patchbox jackdrc[1190]: port created: RtMidiOut-Client:midi/play
Jul 15 14:08:21 patchbox jackdrc[1190]: port created: Pure-Data:midi/capture_1
Jul 15 14:08:21 patchbox jackdrc[1190]: port created: Pure-Data:midi/playback_2

patch@patchbox:~ $

I am guessing that “ALSA: Cannot open PCM device alsa_pcm fo” is probably the issue.

But not sure what to do about it, to be honest.

And not sure where to find the alsamixer. It doesnt show in any of the menues in top left corner of the desktop. Maybe thats part of the issue, that ALSA is not installed correctly. Or is the alsa mixer the fader in top right corner? If so it’s not muted and it is turned up.

I tried restarting the PI and launch JACK again. This time I get this log, which doesnt seem to have any errors.

jack.service - JACK Server
Loaded: loaded (/lib/systemd/system/jack.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-07-15 14:30:54 CEST; 10s ago
Main PID: 2319 (jackd)
Tasks: 5 (limit: 2199)
Memory: 86.1M
CGroup: /system.slice/jack.service
└─2319 /usr/bin/jackd -t 2000 -R -P 95 -d alsa -d hw:ALSA -r 44100 -p 1024 -n 2 -X seq -s

Jul 15 14:30:55 patchbox jackdrc[2319]: port created: Midi-Through:midi/playback_1
Jul 15 14:30:55 patchbox jackdrc[2319]: port created: Midi-Through:midi/capture_1
Jul 15 14:30:55 patchbox jackdrc[2319]: port created: RtMidiIn-Client:midi/capture_1
Jul 15 14:30:55 patchbox jackdrc[2319]: port created: RtMidiOut-Client:midi/playback_1
Jul 15 14:30:55 patchbox jackdrc[2319]: port created: Pure-Data:midi/capture_1
Jul 15 14:30:55 patchbox jackdrc[2319]: port created: Pure-Data:midi/playback_2
Jul 15 14:30:55 patchbox jackdrc[2319]: port created: Pure-Data:midi/capture_1
Jul 15 14:30:55 patchbox jackdrc[2319]: port created: Pure-Data:midi/playback_2
Jul 15 14:31:00 patchbox jackdrc[2319]: port deleted: Pure-Data:midi/capture_1
Jul 15 14:31:00 patchbox jackdrc[2319]: port deleted: Pure-Data:midi/playback_2

But I still get no sound neither from PD or the web browser.

alsamixer is just a terminal command.

Try running the Patchage program, see whether the Pure Data appears there and whether it’s routed to system playback correctly. You may attach a screenshot of what you see there.

I checked the Patchage program.

Pure Data output 0 and output 1 are routed to playback_1 and playback_2. Those are the green audio boxes.

When i select the system drop down menu in Patchage, it says:
Disconnect from JACK
Disconnect from ALSA

So they seem like they are both running.

I also opened alsamixer in terminal. I did F6 and set the sound card to the ALSA soundcard.

But still no sound.

I will try another restart, after chaing the sound card in alsamixer and see if that helps.

That sounds like it should be fine. Is PD itself producing audio? Are you sure the patch you use is fine and that DSP is enabled? :slight_smile:

You may try opening this patch on your system: /usr/local/puredata-patches/GarageBeat/0_START.pd, it should definitely be producing audio automatically as long as DSP is ticked.

You may check the jack log for any errors:

sudo journalctl -u jack

hit ‘end’ key to go to the very latest lines.

Yes I am pretty sure the audio is running in Pure data. I use Pd a lot so I am fairly sure that I got that part right.

I made an osc~ and a bang~ and connected them to a snapshot~ and then a number box to see if anything is happening and the number box moves, so I am sure it is running. and when I turn off dsp, it stops moving and start moving when turning on again.

And then I connected the osc~ to a dac~ 1 2 to get the sound out of pd.

Here is the log from frm the journalctl command

– Logs begin at Wed 2020-07-15 14:17:01 CEST, end at Wed 2020-07-15 15:00:41 CEST. –
Jul 15 14:42:29 patchbox systemd[1]: Started JACK Server.
Jul 15 14:42:29 patchbox jackdrc[438]: Failed to create secure directory (/home/jack/.config/pulse): No such file or directory
Jul 15 14:42:29 patchbox jackdrc[438]: jackdmp 1.9.12
Jul 15 14:42:29 patchbox jackdrc[438]: Copyright 2001-2005 Paul Davis and others.
Jul 15 14:42:29 patchbox jackdrc[438]: Copyright 2004-2016 Grame.
Jul 15 14:42:29 patchbox jackdrc[438]: Copyright 2016-2017 Filipe Coelho.
Jul 15 14:42:29 patchbox jackdrc[438]: jackdmp comes with ABSOLUTELY NO WARRANTY
Jul 15 14:42:29 patchbox jackdrc[438]: This is free software, and you are welcome to redistribute it
Jul 15 14:42:29 patchbox jackdrc[438]: under certain conditions; see the file COPYING for details
Jul 15 14:42:29 patchbox jackdrc[438]: JACK server starting in realtime mode with priority 95
Jul 15 14:42:29 patchbox jackdrc[438]: self-connect-mode is “Don’t restrict self connect requests”
Jul 15 14:42:30 patchbox jackdrc[438]: creating alsa driver … hw:ALSA|hw:ALSA|1024|2|44100|0|0|nomon|swmeter|soft-mode|16bit
Jul 15 14:42:30 patchbox jackdrc[438]: ALSA: Cannot open PCM device alsa_pcm for capture. Falling back to playback-only mode
Jul 15 14:42:30 patchbox jackdrc[438]: configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 2 periods
Jul 15 14:42:30 patchbox jackdrc[438]: ALSA: final selected sample format for playback: 16bit little-endian
Jul 15 14:42:30 patchbox jackdrc[438]: ALSA: use 2 periods for playback
Jul 15 14:42:30 patchbox jackdrc[438]: port created: Midi-Through:midi/playback_1
Jul 15 14:42:30 patchbox jackdrc[438]: port created: Midi-Through:midi/capture_1
Jul 15 14:42:46 patchbox jackdrc[438]: port created: RtMidiIn-Client:midi/capture_1
Jul 15 14:42:46 patchbox jackdrc[438]: port created: RtMidiOut-Client:midi/playback_1
Jul 15 14:42:50 patchbox jackdrc[438]: port created: Pure-Data:midi/capture_1
Jul 15 14:42:50 patchbox jackdrc[438]: port created: Pure-Data:midi/playback_2
lines 1-23

I just remembered, that the audio seems to prefer going out through the HDMI port, see this topic: Getting no sound output from Raspberry's built in analog output

Maybe it’s the same issue in your case as well :slight_smile: The solution seems to be to start the system with HDMI unplugged, then connect it.

Yes was just looking into that and got it working now.

It had to do these two terminal commands to force the RPI to use headphones output. I think it was using the output in the HDMI display.

where n is 0=auto, 1=headphones, 2=hdmi:
For alsa
amixer cset numid=3 <1>
For Pulse audio, which was the one that made it work:
amixer -c 0 cset numid=3 <1>

And then use PulseAudio in alsa mixer.

All good now :slight_smile:

And thank you so much @ Giedrius

Wauw. I am so amazed how “easy” it was to get working compared to the hell I went through years ago. Patchbox is AWESOME :slight_smile:

This is going to be great partner for my Organelle :slight_smile:

1 Like