All of lore.kernel.org
 help / color / mirror / Atom feed
* negative timestamps on pcm?!?
@ 2003-10-20 18:05 Steve deRosier
  2003-10-21 10:25 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Steve deRosier @ 2003-10-20 18:05 UTC (permalink / raw)
  To: alsa-devel

All,

We've noticed a problem with the newest version of Alsa while doing some 
stress testing of our devices.  Basically, the scenerio is we're playing 
through a large library of .ogg files over the weekend.  When we checked 
on the progress upon getting in on Monday, we discovered that the PCM 
had ceased playing, and our ogg player had started a ton of instances 
(one for each song it was supposed to play) and couldn't play on any of 
them.  Looking at /proc/asound/card0/pcm0p/sub0/status:
# cat status
state: OPEN
trigger_time: 642.000000000
tstamp      : -1071072720.-1071072332
delay       : 498
avail       : -1072507698
avail_max   : -1071072720
-----
hw_ptr      : 26942906
appl_ptr    : 26942906

It seems that our ogg player is set to blocking behavior and each one is 
blocked on the call to open the pcm.  The intrieging thing is the 
timestamp is negative.  It jumped out that this just looks wrong!

Hypothesis 1:  After a really long time playing, the timestamp on the 
pcm wraps to negative.  alsa can't handle this and blocks on the output. 
  It's no longer running, but is still in an OPEN state so nothing else 
can open it.  alsa should either use an unsigned value so large that it 
is impossable to overflow (???), use an unsigned and detect overflow and 
handle it gracefully, or use a signed value and detect the overflow/wrap 
and handle it.
Hypothesis 2:  We're barking up the wrong tree and the only thing wrong 
is that the proc entry is formmated poorly.  (but even if that is the 
case, the problem still happens where after prolonged time alsa stops us).

This didn't happen with earlier versions of alsa using the same playing 
software.

I hope this helps the developers in tracking down any bugs.

Thanks,
- Steve



-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-21 18:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-20 18:05 negative timestamps on pcm?!? Steve deRosier
2003-10-21 10:25 ` Takashi Iwai
2003-10-21 17:05   ` Steve deRosier
2003-10-21 18:03     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.