On Fri, Feb 13, 2015 at 09:59:47AM +0100, Alexandre Ratchov wrote:
> One second lag is cleary a bug. Could you get this file:
> 
>       http://caoua.org/tmp/beep.wav
> 
> and test the lag with this command:
> 
>       aucat -i beep.wav
> 
> The lag is supposed to be of 0.2 seconds. To debug this, you could
> kill sndiod, run tmux and start:
> 
>       sudo sndiod -dd <your_options_if_any>
> 
> Then, when you start a program it displays information about what
> programs do, example:
> 
>       mplayer0: 48000Hz, s32le, play 0:1, 13 blocks of 960 frames
>       mplayer0: attached at -7680, delta = 0
> 
> which allows to calculate the expected lag:
> 
>       13 * 960 / 48000 = 0.26 seconds of lag

When I do aucat -i beep.wav, this is what I receive:

# sndiod -dd
snd0.default: rec=0:1 play=0:1 vol=23170 dup
snd0: 48000Hz, s16le, play 0:1, rec 0:1, 9 blocks of 960 frames
aucat0: 48000Hz, s16le, play 0:0, 8 blocks of 960 frames
snd0: device started
aucat0: attached at -8640, delta = 0
snd0: device stopped

8 * 960 / 48000 = 0.16, this mean it have no lag, strange.

> Do you see any warning messages?

No.

> Whenever the device starts, sndiod displays:
> 
>       snd0: device started
> 
> when you observe the lag, does above message appear delayed as
> well?

When I start mplayer, cmus, aucat, the first message appear instatly. But the 
others 
that I received during execution come delayed.

For example in mplayer the audio looks synchronize with the video, the delay 
comes when 
I click, for example, in the arrow to jump on the audio/music.

**This is the mplayer output when I start it:

snd0.default: rec=0:1 play=0:1 vol=23170 dup
snd0: 48000Hz, s16le, play 0:1, rec 0:1, 9 blocks of 960 frames
mplayer0: 44100Hz, s32le, play 0:1, 13 blocks of 882 frames
snd0: device started
mplayer0: attached at -7938, delta = 0
** And it stay playing, when I click the arrow key, I receive this two messages 
with 
the delay.
mplayer0: 44100Hz, s32le, play 0:1, 13 blocks of 882 frames
mplayer0: attached at -7938, delta = 0
** So I press quit, mplay quit in the same time, but the audio still playing 
for a while.
And I receive this one with the same delay
snd0: device stopped

In ffplay, that don't lag, this is the messages I get:

# sndiod -dd
snd0.default: rec=0:1 play=0:1 vol=23170 dup
snd0: 48000Hz, s16le, play 0:1, rec 0:1, 9 blocks of 960 frames
snd0: 48000Hz, s16le, play 0:1, rec 0:1, 9 blocks of 960 frames
ffplay0: 44100Hz, s16le, play 0:1, 2 blocks of 882 frames
snd0: device started
ffplay0: attached at -7938, delta = 0
snd0: device stopped

In ffplay, I don't receive any message if I advance the video, and the message
of device stopped come instatly.

First thing I can see is that:
2 * 882 / 44100 = 0.04 -> the value is lower

But looks this isn't the problem, the audio in mplayer is synchronized with the 
video, 
the lag only happens when I advance or quit the app.

> If you let:
> 
>       aucat -i /dev/zero
> 
> running, do cmus and mplayer keep lagging?

Yes, everything continue behaving as before. 

-- 
Regards

Henrique Lengler 

Reply via email to