OF 0.9.0 Rasberry Pi B+ sound problem

I am running clean installation of jessie on raspberry pi B+ and found the following problem.
My OF application uses ofSoundPlayer but I can’t hear any sound.

On start application reports:
AL lib: (WW) alc_initconfig: Failed to initialize backend “pulse”
On exit application reports:
AL lib: (EE) alc_cleanup: 1 device not closed

soundPlayerExample doesn’t generate sound either and produces following log:
AL lib: (WW) alc_initconfig: Failed to initialize backend “pulse”
[warning] ofSoundPlayer: ofSoundUpdate() not implemented on this platform

[warning] ofSoundPlayer: ofSoundUpdate() not implemented on this platform
AL lib: (EE) alc_cleanup: 1 device not closed

I have the same problem as well running Ubuntu 14.04

it seems you need to install pulseaudio, we’ll include it in next release but you can install it manually with:

sudo apt-get install pulseaudio
1 Like

You are right about pulseaudio - just installed it. First error "AL lib: (WW) alc_initconfig: Failed to initialize backend “pulse” disappeard, but there is still no sound. Following is the output from aplay command - maybe this has something to do with it:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
dmix:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample mixing device
dmix:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample snooping device
hw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Hardware device with all software conversions

Regards,

Michal

Can we force OF to use alsa directly instead of pulseaudio? There are a couple of suggestions around the internet that pulseaudio shoud not be installed on Rasberry Pi.

Michal

yes using alsa directly on the rpi would be ideal. something that i’ve found out lately in linux machines is that the sound goes by default to the hdmi out if you don’t specify a device it might be already working without installing pulse but the sound going to the hdmi device instead of the speakers connector. with the sound stream usually selecting the correct device (in my computer usually device 3) makes the soudn go out thorugh the speakers but not sure about the sound player

Should I remove libpulse-dev and recompile OF without it?

Michal

not sure i haven’t seen this problem before, there might be some setting for openAL to select alsa or the correct output device, also if you have a connected screen i would try disconnecting it and running the application over ssh to see if you get sound output that way.

Ok I’ll give it a try.

My question about libpulse-dev comes from the fact (as per my initial message) i downloaded 0.9.0 source and compiled it on Raspberry Pi, without having pulseaudio installed. And then the problem with: AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse" appeard. So I think during compilation pulseaudio has been chosen as a default audio output.

Did you tried this fix : [solved] RPi + sound synthesis

I’m getting the same errors that @forcecode is with the same aplay -l and aplay -L output he is receiving.

[warning] ofSoundPlayer: ofSoundUpdate() not implemented on this platform

I’ve also made sure to

sudo apt-get install pulseaudio

I have removed the connection to the hdmi output and set the mini jack as the audio output and confirmed audio plays with:

omxplayer example.mp3

from: raspberry pi audio test recompiled, no dice at run time.

@cgiles I also modified the ~/.asoundrc file to include the “device 1”, rebooted and tested.
The openFrameworks/examples/sound/soundPlayerFFTExample continues to throw “[warning] ofSoundPlayer: ofSoundUpdate() not implemented on this platform” messages, but I can hear audio from omxplayer.

@forcecode any luck? Perhaps I missed something.

Running ARMv7.
model name : ARMv7 Processor rev 5 (v7l)

Happy to help test other scenarios; thanks for your assistance,

-nate

omxPlayer is speaking with the hardware directly and ignores everything else like ALSA and Pulseaudio. So that usually always works correctly.
The error about ofSoundUpdate() seems to be something you can ignore. Just remove the function, for me audio works just fine without it on the Pi on Jessie.

@Prof_Sparkles Thanks for the heads up on omxPlayer, I guess it at least confirms that I’m able to get sound from the device.

Does the openFrameworks/examples/sound/soundPlayerFFTExample run for you? For me when it runs I can bounce the cursor off the app walls but no FFT visualization appears seemingly related to the ofSoundUpdate not being implemented error(?). I’m mostly interested in the FFT data for input level processing more so than sound playback.

I’ve recompiled OF after the pulse audio installation and recompiled the soundPlayerFFTExample without a change.

Thanks,

-nate

Yes, this is working for me. I can’t get sound right now but I know that sound playback worked before in a different app using ofSoundPlayer.
Though the visualization is happening.

Have you run both the dependencies script aswell as the codec install script from the script folder?

@Prof_Sparkles I have run both scripts. Tried running them again and both scripts state that all the dependencies are at the newest versions: “0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.”

Tried recompiling OF, but it appears to not recompile as the compiled copy is cached. Is there a way to force OF to recompile?

Thanks again,

-nate

Just delete the content of openFrameworks/libs/openFrameworksCompiled/lib/linuxarmv6l/

on the pi2:
openFrameworks/libs/openFrameworksCompiled/lib/linuxarmv7l/

Hi,

I’m facing the same problem. Did anyone find a solution yet?

Hi,

I’ve exactly have the same problem. Found any solution?