Hi Christophe, I gave your script a try on Python 3 and it works OK here. Your app is pretty basic, so it's nothing you're doing wrong. I do get the same errors with "directaudio" and "oledll", so that's probably normal on Linux.
Some ideas: - It's possible your audio file is causing trouble. Could you try another file, or post your file here so I can test it? - It's possible the PulseAudio bindings are having an issue. This is likely, as the PulseAudio backend is currently being re-written. I'm running Arch, so my PulseAudio client version is 8.0, compared to your 4.0. One of the core developers is working on this now, so I'm sure he'd appreciate a ticket opened if this is the case. If possible, can you try the OpenAL backend instead of PulseAudio? You'll probably need to install OpenAL from your system package manager. Instructions on how to choose this different backend are available in the Pyglet documentation. It also might be worth a try to test the latest development pyglet version from Bitbucket. This already has a lot of fixes in there. -Ben On Sunday, April 24, 2016 at 11:04:52 PM UTC+9, Christophe Pallier wrote: > > Hello, > > I am running Ubuntu 14.04 > > I unstalled the pygame-pyglet package which had a version dated from 2009 > an ran 'pip install pyglet' to install a more up to date version of pyglet. > > Now, the attached python script crashes when playing audio (while it > worked with the 2009 version of pyglet) > > Below is the console's output (with debug_media set to True): > > I do not know if it is the origin of the probleme but I noticed the odd > message "Error importing driver directsound: 'module' object has no > attribute 'oledll'" (as I am running under linux). > > chrplr@is151214:~/code/testsā« python test-pyglet-0.py > get_audio_data > Got an audio packet at 0.0 > Got requested audio packet at 0.0 > get_audio_data returning ts 0.000000 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 0.09288 > Got requested audio packet at 0.09288 > get_audio_data returning ts 0.092880 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 0.18576 > Got requested audio packet at 0.18576 > get_audio_data returning ts 0.185760 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 0.278639 > Got requested audio packet at 0.278639 > get_audio_data returning ts 0.278639 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 0.371519 > Got requested audio packet at 0.371519 > get_audio_data returning ts 0.371519 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 0.464399 > Got requested audio packet at 0.464399 > get_audio_data returning ts 0.464399 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 0.557279 > Got requested audio packet at 0.557279 > get_audio_data returning ts 0.557279 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 0.650159 > Got requested audio packet at 0.650159 > get_audio_data returning ts 0.650159 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 1.486077 > Got requested audio packet at 1.486077 > get_audio_data returning ts 1.486077 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 1.578957 > Got requested audio packet at 1.578957 > get_audio_data returning ts 1.578957 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 1.671837 > Got requested audio packet at 1.671837 > get_audio_data returning ts 1.671837 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 1.764717 > Got requested audio packet at 1.764717 > get_audio_data returning ts 1.764717 with events [] > remaining events are [] > get_audio_data > Got an audio packet at 1.857596 > Got requested audio packet at 1.857596 > get_audio_data returning ts 1.857596 with events [] > remaining events are [] > get_audio_data > get_audio_data returning None > del avbin source > Error importing driver directsound: > 'module' object has no attribute 'oledll' > context state cb > context state cb > context state cb > context state cb > Client version: 4.0.0 > Server: unix:/run/user/1000/pulse/native > Protocol: 28 > Server protocol: 28 > Local context: Yes > write callback: 11024 bytes > packet 0.0 > Traceback (most recent call last): > File "source/callbacks.c", line 206, in 'calling callback function' > File > "/usr/local/lib/python2.7/dist-packages/pyglet/media/drivers/pulse/__init__.py", > > line 357, in _write_cb > pa.pa_free_cb_t(0), # Data is copied > SystemError: NULL result without error in PyObject_Call > stream ready > play > Traceback (most recent call last): > File "test-pyglet-0.py", line 29, in <module> > sound.play() > File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py", > line 473, in play > player.play() > File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py", > line 1012, in play > self._set_playing(True) > File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py", > line 994, in _set_playing > self._audio_player.play() > File > "/usr/local/lib/python2.7/dist-packages/pyglet/media/drivers/pulse/__init__.py", > > line 477, in play > pa.pa_stream_success_cb_t(0), None) > SystemError: NULL result without error in PyObject_Call > > > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.
