On 9/3/08, Ragzouken <[EMAIL PROTECTED]> wrote:
>
> It seems to have changed :P I'm now getting:
>
> Traceback (most recent call last):
> File "soundtest.py", line 30, in <module>
> app.run()
> File "/usr/lib/python2.5/site-packages/pyglet/app/__init__.py", line
> 263, in run
> EventLoop().run()
> File "/usr/lib/python2.5/site-packages/pyglet/app/xlib.py", line 91,
> in run
> sleep_time = self.idle()
> File "/usr/lib/python2.5/site-packages/pyglet/app/__init__.py", line
> 187, in idle
> dt = clock.tick(True)
> File "/usr/lib/python2.5/site-packages/pyglet/clock.py", line 679,
> in tick
> return _default.tick(poll)
> File "/usr/lib/python2.5/site-packages/pyglet/clock.py", line 294,
> in tick
> item.func(ts - item.last_ts, *item.args, **item.kwargs)
> File "soundtest.py", line 29, in <lambda>
> clock.schedule_once(lambda dt: PLAYER.on_music_skip(), 10)
> File "soundtest.py", line 20, in on_music_skip
> self.next()
> File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
> line 863, in next
> self._next_source()
> File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
> line 874, in _next_source
> self._begin_source()
> File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
>
> line 883, in _begin_source
>
> self._fill_audio()
> File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
> line 715, in _fill_audio
> self._audio.write(audio_data)
> File "/usr/lib/python2.5/site-packages/pyglet/media/drivers/alsa/
>
> __init__.py", line 155, in write
> raise ALSAException(asound.snd_strerror(samples_out))
> pyglet.media.drivers.alsa.ALSAException: File descriptor in bad state
>
>
> On Sep 2, 3:07 pm, Ragzouken <[EMAIL PROTECTED]> wrote:
> > Right, I know have a different problem, but it can be demonstrated
> > with a modified version of the same test.
> >
> > from itertools import cycle
> > from pyglet import window, app, options, clock
> >
> > options['audio'] = ["alsa", "openal"]
> >
> > from pyglet.media import Player, load
> >
> > class SoundTest(Player):
> > def __init__(self, tracks):
> > super(SoundTest, self).__init__()
> >
> > self.iter = cycle(tracks)
> > self.queue_next()
> > self.queue_next()
> >
> > def queue_next(self):
> > self.queue(load(self.iter.next()))
> >
> > def on_music_skip(self):
> >
> > self.next()
> >
> > self.queue_next()
> >
> > def on_eos(self):
> >
> > self.queue_next()
> >
> > WINDOW = window.Window(640, 480, "Sound Test")
> > PLAYER = SoundTest(("sounds/music/menu/defense theme.ogg", "sounds/
> > music/menu/ronima.ogg"))
> > PLAYER.play()
> > clock.schedule_once(lambda dt: PLAYER.on_music_skip(), 10)
> > app.run()
> >
> > Once the track is skipped to the next one, it all goes wrong:
> > [EMAIL PROTECTED]:~/defence-pyg$ python soundtest.py
> > Traceback (most recent call last):
> > File "soundtest.py", line 30, in <module>
> > app.run()
> > File "/usr/lib/python2.5/site-packages/pyglet/app/__init__.py", line
> > 263, in run
> > EventLoop().run()
> > File "/usr/lib/python2.5/site-packages/pyglet/app/xlib.py", line 91,
> > in run
> > sleep_time = self.idle()
> > File "/usr/lib/python2.5/site-packages/pyglet/app/__init__.py", line
> > 187, in idle
> > dt = clock.tick(True)
> > File "/usr/lib/python2.5/site-packages/pyglet/clock.py", line 679,
> > in tick
> > return _default.tick(poll)
> > File "/usr/lib/python2.5/site-packages/pyglet/clock.py", line 294,
> > in tick
> > item.func(ts - item.last_ts, *item.args, **item.kwargs)
> > File "soundtest.py", line 29, in <lambda>
> > clock.schedule_once(lambda dt: PLAYER.on_music_skip(), 10)
> > File "soundtest.py", line 20, in on_music_skip
> > self.next()
> > File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
> > line 863, in next
> > self._next_source()
> > File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
> > line 874, in _next_source
> > self._begin_source()
> > File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
> > line 889, in _begin_source
> > self.play()
> > File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
> > line 804, in play
> > self.dispatch_events()
> > File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
> > line 924, in dispatch_events
> > self._fill_audio()
> > File "/usr/lib/python2.5/site-packages/pyglet/media/__init__.py",
> > line 715, in _fill_audio
> > self._audio.write(audio_data)
> > File "/usr/lib/python2.5/site-packages/pyglet/media/drivers/alsa/
> > __init__.py", line 158, in write
> > check(asound.snd_pcm_delay(self.pcm, delay))
> > File "/usr/lib/python2.5/site-packages/pyglet/media/drivers/alsa/
> > __init__.py", line 58, in check
> > raise ALSAException(asound.snd_strerror(err))
> > pyglet.media.drivers.alsa.ALSAException: Input/output error
> >
> > alsa.log:
> > New device: default
> > ALSA <-> PulseAudio PCM I/O Plugin
> > Its setup is:
> > stream : PLAYBACK
> > access : RW_INTERLEAVED
> > format : S16_LE
> > subformat : STD
> > channels : 2
> > rate : 44100
> > exact rate : 44100 (44100/1)
> > msbits : 16
> > buffer_size : 13230
> > period_size : 64
> > period_time : 1451
> > tick_time : 0
> > tstamp_mode : NONE
> > period_step : 1
> > sleep_min : 0
> > avail_min : 64
> > xfer_align : 64
> > start_threshold : 1
> > stop_threshold : 13230
> > silence_threshold: 0
> > silence_size : 0
> > boundary : 1734082560
Ok, clearly a problem with pyglet's ALSA implementation. I'm not
interested in debugging it though, as I've dropped support for ALSA in
1.2 (for reasons like this).
Alex.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---