[pulseaudio-discuss] [RFC PATCH] alsa-sink: Reduce hardware pointer update syscalls

Raymond Yau superquad.vortex2 at gmail.com
Sun Oct 5 19:29:00 PDT 2014


>
> Without patch, with a latency of 48 ms

What is the meaning of 48ms at 44100Hz?

> With the patch, I get the same assertion failed as Peter ("frames > 0").
> With Peter's change, I get this: http://pastebin.com/dWx6fiwT, even with
> no client connected. The reported delay is -5 * default-fragments *
> default-fragment-size-msec.
>

Hwptr of usb audio is calculated from a variable subs->hwptr_done which
update periodically when the  controller submit urbs

This mean this value won't change until next submit

/*
* return the current pcm pointer.  just based on the hwptr_done value.
*/
static snd_pcm_uframes_t snd_usb_pcm_pointer(struct snd_pcm_substream
*substream)
{
struct snd_usb_substream *subs;
unsigned int hwptr_done;

subs = (struct snd_usb_substream *)substream->runtime->private_data;
if (subs->stream->chip->shutdown)
return SNDRV_PCM_POS_XRUN;
spin_lock(&subs->lock);
hwptr_done = subs->hwptr_done;
substream->runtime->delay = snd_usb_pcm_delay(subs,
substream->runtime->rate);
spin_unlock(&subs->lock);
return hwptr_done / (substream->runtime->frame_bits >> 3);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20141006/303709e2/attachment.html>


More information about the pulseaudio-discuss mailing list