[prev in list] [next in list] [prev in thread] [next in thread] 

List:       alsa-devel
Subject:    [alsa-devel] [PATCH] ALSA: usb: refine delay information with USB	frame counter
From:       pierre-louis.bossart () linux ! intel ! com (Pierre-Louis Bossart)
Date:       2011-08-30 15:34:55
Message-ID: 000901cc672a$5ec86320$1c592960$ () bossart () linux ! intel ! com
[Download RAW message or body]

> /*
>  * Multi-line comments are supposed to use this formatting style.
>  */

Ok

> This could be replaced with just:
> 	frame_diff = (current_frame_number - subs->last_frame_number) &
> 0xff;

ok
 
> Do you know how large the difference actually becomes?
> 
> I'm not sure if it might be possible to construct a scenario where
> rounding errors could accumulate ...

I don't think so. I've use a classic technique, I've seen similar code used
to improve a/v sync when the audio time is updated in steps. The estimate
starts from the delay as computed before (number of samples queued), then
decreased down (possibly to zero) using the frame counter. When the urbs are
retired, the delay is reset as previously. The frame number is only used to
predict the delay more accurately, and the delay is always based on 2 reads
of the frame counter. Worst case one case be off by one ms on each read.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic