Ecurb
Posts: 25
Joined: Sun Oct 06, 2013 6:31 pm

Sound not working - releaseALC: 1 device not closed

Thu Oct 24, 2013 7:48 pm

Hello,

I'm trying to use the pyglet library to play an mpf file in my program. After a good amount of fooling with it, it now works on my computer, however it does not work on the RP. The error message I get is "releaseALC: 1 device not closed". And the code I'm using is:

Code: Select all

music = pyglet.media.load("pig_sound1.mp3")
music.play()
pyglet.clock.schedule_once(exiter, music.duration)
pyglet.app.run()
Any ideas?

Bruce

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: Sound not working - releaseALC: 1 device not closed

Fri Oct 25, 2013 8:30 am

Bruce,

Is that the full extent of the error message?

The reason I ask is that this page shows that there might be another error when trying to play compressed media.

Please post the full error message and someone with some pyglet experience may be able to help.

el_P
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

Ecurb
Posts: 25
Joined: Sun Oct 06, 2013 6:31 pm

Re: Sound not working - releaseALC: 1 device not closed

Fri Oct 25, 2013 8:43 pm

hi el_P,

the full error says "AL lib: releaseALC: 1 device not closed"

maybe it has something to do with the library?

Bruce

Ecurb
Posts: 25
Joined: Sun Oct 06, 2013 6:31 pm

Re: Sound not working - releaseALC: 1 device not closed

Fri Oct 25, 2013 9:51 pm

or maybe there is an easier way to play some audio? I don't care if it's wav or mp3, just need to play some small clips.

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: Sound not working - releaseALC: 1 device not closed

Sat Oct 26, 2013 8:13 am

Did you also install AVbin?
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: Sound not working - releaseALC: 1 device not closed

Sat Oct 26, 2013 10:38 am

I get the following error:

Code: Select all

>>> import pyglet
>>> music = pyglet.media.load("immunity.mp3")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py", line 1386, in load
    source = _source_class(filename, file)
  File "/usr/local/lib/python2.7/dist-packages/pyglet/media/riff.py", line 202, in __init__
    'AVbin is required to decode compressed media')
pyglet.media.riff.WAVEFormatException: AVbin is required to decode compressed media
and I've installed AVBin.

Let me know how you installed it and we can try to work through this.

As for other ways of playing media, I suspect searching the forums will give you some results - it's not something I use my Pis for.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: Sound not working - releaseALC: 1 device not closed

Sat Oct 26, 2013 11:01 am

Tried using pygame to play audio (see this post) and it worked for me.

Pygame docs are here: http://www.pygame.org/docs/ref/music.html
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

Ecurb
Posts: 25
Joined: Sun Oct 06, 2013 6:31 pm

Re: Sound not working - releaseALC: 1 device not closed

Sat Oct 26, 2013 7:10 pm

thanks all for the help! I ended up using pygame like in elParaguayo thread, worked perfect right away so just went with that.

Bruce

Return to “Python”