Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* SNDRV_PCM_INFO_BATCH
@ 2014-03-04 14:20 David Henningsson
  2014-03-04 14:34 ` SNDRV_PCM_INFO_BATCH Takashi Iwai
  2014-03-04 14:50 ` SNDRV_PCM_INFO_BATCH Clemens Ladisch
  0 siblings, 2 replies; 3+ messages in thread
From: David Henningsson @ 2014-03-04 14:20 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org
  Cc: Takashi Iwai, Clemens Ladisch, General PulseAudio Discussion

So, PulseAudio removed timer scheduling for drivers with
SNDRV_PCM_INFO_BATCH, and released 5.0. Meanwhile, USB drivers still
have SNDRV_PCM_INFO_BATCH, so this leads to performance regressions for
USB sound cards.

The question remains - what does SNDRV_PCM_INFO_BATCH really mean?

In the documentation, we have this:
"int snd_pcm_hw_params_is_batch (const snd_pcm_hw_params_t *params) 	
Check, if hardware does double buffering for data transfers for given
configuration."

What PulseAudio was looking for was more something like "what accuracy
does the pointer callback give us". When we asked this question at the
latest audio meeting, SNDRV_PCM_INFO_BATCH was given as the answer, i e,
if this flag is set, pointer callback have no more accuracy than period
boundaries. At least that's how I understood it.

So, either the documentation for snd_pcm_hw_params_is_batch is correct,
in which case PulseAudio should revert the tsched patch. Or the answer
given at the audio meeting was correct, in which case we need to fix the
USB driver to stop sending the SNDRV_PCM_INFO_BATCH flag.

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

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

* Re: SNDRV_PCM_INFO_BATCH
  2014-03-04 14:20 SNDRV_PCM_INFO_BATCH David Henningsson
@ 2014-03-04 14:34 ` Takashi Iwai
  2014-03-04 14:50 ` SNDRV_PCM_INFO_BATCH Clemens Ladisch
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2014-03-04 14:34 UTC (permalink / raw)
  To: David Henningsson
  Cc: alsa-devel@alsa-project.org, Clemens Ladisch,
	General PulseAudio Discussion

At Tue, 04 Mar 2014 15:20:08 +0100,
David Henningsson wrote:
> 
> So, PulseAudio removed timer scheduling for drivers with
> SNDRV_PCM_INFO_BATCH, and released 5.0. Meanwhile, USB drivers still
> have SNDRV_PCM_INFO_BATCH, so this leads to performance regressions for
> USB sound cards.
> 
> The question remains - what does SNDRV_PCM_INFO_BATCH really mean?
> 
> In the documentation, we have this:
> "int snd_pcm_hw_params_is_batch (const snd_pcm_hw_params_t *params) 	
> Check, if hardware does double buffering for data transfers for given
> configuration."
> 
> What PulseAudio was looking for was more something like "what accuracy
> does the pointer callback give us". When we asked this question at the
> latest audio meeting, SNDRV_PCM_INFO_BATCH was given as the answer, i e,
> if this flag is set, pointer callback have no more accuracy than period
> boundaries. At least that's how I understood it.
> 
> So, either the documentation for snd_pcm_hw_params_is_batch is correct,
> in which case PulseAudio should revert the tsched patch. Or the answer
> given at the audio meeting was correct, in which case we need to fix the
> USB driver to stop sending the SNDRV_PCM_INFO_BATCH flag.

The flag is being used in the sense explained in the previous audio
meeting -- the data transfer granularity isn't fine enough but aligned
to the period size (or less).  So its meaning is more generic, and the
double-buffer is one of such cases.

And, it's correct to set this flag for USB-audio.  USB-audio can't
transfer the data contiguously but only via packets, thus the update
granularity is also limited.  Although it can provide the actual
played position as "delay", the point where you can write the data 
(i.e. avail) is updated only in period size order.


Takashi

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

* Re: SNDRV_PCM_INFO_BATCH
  2014-03-04 14:20 SNDRV_PCM_INFO_BATCH David Henningsson
  2014-03-04 14:34 ` SNDRV_PCM_INFO_BATCH Takashi Iwai
@ 2014-03-04 14:50 ` Clemens Ladisch
  1 sibling, 0 replies; 3+ messages in thread
From: Clemens Ladisch @ 2014-03-04 14:50 UTC (permalink / raw)
  To: David Henningsson, alsa-devel@alsa-project.org
  Cc: Takashi Iwai, Lars-Peter Clausen, General PulseAudio Discussion

David Henningsson wrote:
> So, PulseAudio removed timer scheduling for drivers with
> SNDRV_PCM_INFO_BATCH, and released 5.0. Meanwhile, USB drivers still
> have SNDRV_PCM_INFO_BATCH, so this leads to performance regressions for
> USB sound cards.
>
> The question remains - what does SNDRV_PCM_INFO_BATCH really mean?

For your purposes, it means that the pointer accuracy is likely to be
worse than that of other sound cards.

There should be a mechanism to report the actual granularity.


Regards,
Clemens

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

end of thread, other threads:[~2014-03-04 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 14:20 SNDRV_PCM_INFO_BATCH David Henningsson
2014-03-04 14:34 ` SNDRV_PCM_INFO_BATCH Takashi Iwai
2014-03-04 14:50 ` SNDRV_PCM_INFO_BATCH Clemens Ladisch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox