[solved] RPi + sound synthesis

Hi all,
does ne1 have pointers on how to do generative audio on the Rpi ?
(without using an external sound card)

1- I’ve tried the bundled example audioOutputExample, but I’ve got:
RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (default), No such file or directory
using soundStream.setDeviceID(1); works for the HDMI audio out
using soundStream.setDeviceID(0); doesn’t produce any output (mini Jack)

2- I’ve tryied ofxTonic -> doesn’t compile on linux arm

3- I’ve tried the regular of. way (ofSoundStream), but I can output only on the HDMI audio - which is no good for me -, BUT after a short time, the RPi hangs. (“unable to write to buffer”)

4 -ofxSuperCollider and ofxPd do look overkill and way too complicated for my purpose.

Note #1: I’ve got a RPi B, not the B+ (which is supposed to have better audio).
Note #2: the ALSA driver seems to be locked on device_1, which is the HDMI audio. I can’t find a way to force output on device_0 (mini jack).

Any help truly welcome.

I’ve had to use this in order to get the mini jack to work

$ sudo modprobe snd_bcm2835
$ sudo amixer cset numid=3 1

Awesome !
it works.
Thanks you so much.

i have the same problem here on a Rpi with audioOutputExample.
(with oF 0.8.4)

setting the device id to 0 or 1 or not setting it produces the same error:

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (default), No such file or directory.

module snd_bcm2835 is loaded, i did the above mentioned steps.
the error stays the same.

testing alsa with “aplay” works for mini jack output.

any ideas?

Got it.

There was simply not default alsa device specified.

adding .asoundrc in the home folder solved the issue. this is also described here:

to use the mini-jack output as the default ALSA device, the content of .asoundrc looks like this:

pcm.!default {
        type hw
        card 0
        device 1
ctl.!default {
        type hw
        card 0
        device 1

alternatively to ~/.asoundrc it can be set system-wide in /etc/asound.conf

I tried these steps and it did not solve the problem for me.
Also, when making the file proposed by @inx i got errors in the alsamixer. The oF app runs, but no sound comes out.
Then I found a forum stating that this shouldn’t be done

anyone one has an idea of what I could try?

UPDATE: actually, it does solve and the alsamixer is still acessible using alsamixer -c 0

1 Like