Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linuxtv-softmpeg] Re: problems with libsoftmpeg



Hi,

I have exactly the same problems as Juha had with the jerky picture. I've tried to track it down by enabling all possible debug flags and I have found one strange thing with the audio buffer. I get buffer underrun in Fusionsound even when there is enough data to cover the time between a time instant where there is data in the buffer to the time where the underrun is reported.
With an added debug print out of the remaining data in the soundcard buffer I get the following log:

Buffered: 15776
(-) [Sound Mixer 5.964] (16628) FusionSound/Core: sound_thread sleeping...
{-} [16605: 5.348] SoftMPEG/audio_handle_pes_data/Audio PES: current audio buf has 32256 samples
{-} [16605: 5.348] SoftMPEG/audio_handle_pes_data/Audio PES: moving 0 bytes to front
{-} [16605: 5.348] SoftMPEG/audio_handle_pes_data/Audio PES: found new pts: +20:10:08.836
{-} [16605: 5.348] SoftMPEG/audio_handle_pes_data/Audio PES: writing 168 bytes to audio buf
{-} [16605: 5.348] SoftMPEG/audio_handle_pes_data/Audio PES: now 168 bytes in buffer
{-} [16605: 5.348] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.348] SoftMPEG/audio_handle_pes_data/Audio PES: special case: new mpeg audio frame at beginning of pes packet
{-} [16605: 5.348] SoftMPEG/check_and_write_audio_pes/Audio PES: writing 32256 bytes to audio device
write: 32256
(-) [ NO NAME 5.965] (16630) IFusionSoundStream_Write: length 8064, read pos 18432, write pos 40320, filled 21888/64000 (playing)
(-) [ NO NAME 5.965] (16630) IFusionSoundStream_FillBuffer: length 8064
(-) [ NO NAME 5.965] (16630) FusionSound/Core: fs_buffer_lock (0x80815e8, pos 40320, length 8064)
(-) [ NO NAME 5.965] (16630) FusionSound/Core: fs_buffer_unlock (0x80815e8)
a: pts == +20:10:08.836 @ sync pts: +20:10:08.668
{-} [16605: 5.348] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: now 348 bytes in buffer
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: now 528 bytes in buffer
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: now 708 bytes in buffer
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: now 888 bytes in buffer
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.349] SoftMPEG/audio_handle_pes_data/Audio PES: writing 768 bytes to avcodec
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: current audio buf has 4608 samples
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: moving 120 bytes to front
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: now 300 bytes in buffer
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: now 480 bytes in buffer
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: now 660 bytes in buffer
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: now 840 bytes in buffer
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.350] SoftMPEG/audio_handle_pes_data/Audio PES: writing 768 bytes to avcodec
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: current audio buf has 9216 samples
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: moving 72 bytes to front
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: now 252 bytes in buffer
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: now 432 bytes in buffer
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.352] SoftMPEG/feed_thread/Feed: got 48128 bytes
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: now 612 bytes in buffer
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: now 792 bytes in buffer
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.352] SoftMPEG/audio_handle_pes_data/Audio PES: writing 768 bytes to avcodec
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: current audio buf has 13824 samples
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: moving 24 bytes to front
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: now 204 bytes in buffer
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: now 384 bytes in buffer
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: now 564 bytes in buffer
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: now 744 bytes in buffer
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: now 924 bytes in buffer
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.354] SoftMPEG/audio_handle_pes_data/Audio PES: writing 768 bytes to avcodec
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: current audio buf has 18432 samples
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: moving 156 bytes to front
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: now 336 bytes in buffer
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: now 516 bytes in buffer
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: now 696 bytes in buffer
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: now 876 bytes in buffer
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.355] SoftMPEG/audio_handle_pes_data/Audio PES: writing 768 bytes to avcodec
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: current audio buf has 23040 samples
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: moving 108 bytes to front
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: now 288 bytes in buffer
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: now 468 bytes in buffer
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: now 648 bytes in buffer
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: now 828 bytes in buffer
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.357] SoftMPEG/audio_handle_pes_data/Audio PES: writing 768 bytes to avcodec
{-} [16605: 5.358] SoftMPEG/audio_handle_pes_data/Audio PES: current audio buf has 27648 samples
{-} [16605: 5.358] SoftMPEG/audio_handle_pes_data/Audio PES: moving 60 bytes to front
{-} [16605: 5.359] SoftMPEG/feed_thread/Feed: got 48128 bytes
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: now 240 bytes in buffer
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: now 420 bytes in buffer
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: writing 180 bytes to audio buf
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: now 600 bytes in buffer
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: writing 168 bytes to audio buf
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: now 768 bytes in buffer
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: still in sync at beginning of buffer (0,1)
{-} [16605: 5.359] SoftMPEG/audio_handle_pes_data/Audio PES: writing 768 bytes to avcodec
Buffered: 0
(!!!) *** WARNING [device buffer underrun?] *** [core_sound.c:421 in sound_thread()]
(-) [Sound Mixer 5.976] (16628) FusionSound/Core: mix_from_16bit (0x80815e8, pos 18432, stop 48384, max 2048) ...
(-) [Sound Mixer 5.977] (16628) FusionSound/Core: mix_from_16bit ... mixed 2048 (2048).
(-) [Sound Mixer 5.977] (16628) IFusionSoundPlayback_React: playback advanced to position 20480
(-) [Sound Mixer 5.977] (16628) IFusionSoundStream_React: playback advanced by 2048 from 18432 to 20480
writing to device: 8192
Buffered: 8128
(-) [Sound Mixer 5.977] (16628) FusionSound/Core: mix_from_16bit (0x80815e8, pos 20480, stop 48384, max 2048) ...
(-) [Sound Mixer 5.977] (16628) FusionSound/Core: mix_from_16bit ... mixed 2048 (2048).
(-) [Sound Mixer 5.977] (16628) IFusionSoundPlayback_React: playback advanced to position 22528
(-) [Sound Mixer 5.977] (16628) IFusionSoundStream_React: playback advanced by 2048 from 20480 to 22528
writing to device: 8192
Buffered: 16256
(-) [Sound Mixer 5.977] (16628) FusionSound/Core: sound_thread sleeping...


So there is 15776/4 samples left in the buffer and the time that passes is 5.976-5.964s=12ms. So there is samples for an additional 15776/4/48000s=82ms left in the buffer. I have also checked that the audio data is consumed in the expected pace when this doesn't happen.

BTW I'm running this on a EPIA-M10000 with ALSA from 2.6.5 the CVS head version of DirectFB, FusionSound and libsoftmpeg.

Regards

Henrik Johansson


--
Info: To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linuxtv-softmpeg" as subject.



Home | Main Index | Thread Index