* How can I make sure the period size is a multiple of 16? @ 2007-09-04 22:50 Timur Tabi 2007-09-05 0:29 ` Eliot Blennerhassett 0 siblings, 1 reply; 7+ messages in thread From: Timur Tabi @ 2007-09-04 22:50 UTC (permalink / raw) To: Alsa-devel To work around a hardware issue, my ASoC driver requires the period size to be a multiple of 16. What is the best way to ensure that? -- Timur Tabi Linux Kernel Developer @ Freescale ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I make sure the period size is a multiple of 16? 2007-09-04 22:50 How can I make sure the period size is a multiple of 16? Timur Tabi @ 2007-09-05 0:29 ` Eliot Blennerhassett 2007-09-05 9:08 ` Clemens Ladisch 2007-09-06 17:07 ` Timur Tabi 0 siblings, 2 replies; 7+ messages in thread From: Eliot Blennerhassett @ 2007-09-05 0:29 UTC (permalink / raw) To: alsa-devel On Wednesday 05 September 2007 10:50:31 Timur Tabi wrote: > To work around a hardware issue, my ASoC driver requires the period size to > be a multiple of 16. What is the best way to ensure that? Well, I was going to refer you to http://www-old.alsa-project.org/~iwai/writing-an-alsa-driver/index.html but I just get a blank page today. Set snd_pcm_hardware.period_bytes_min to 16 or is that 16 * samplesize? You need to add some constraints to your driver, in the open callback. E.g. snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 16); List of hwparams that can be constrained is in asound.h List of constraint helpers in pcm.h, or grep for snd_pcm_hw_constraint to see usage examples. -- Eliot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I make sure the period size is a multiple of 16? 2007-09-05 0:29 ` Eliot Blennerhassett @ 2007-09-05 9:08 ` Clemens Ladisch 2007-09-05 9:55 ` Trent Piepho 2007-09-06 17:07 ` Timur Tabi 1 sibling, 1 reply; 7+ messages in thread From: Clemens Ladisch @ 2007-09-05 9:08 UTC (permalink / raw) To: alsa-devel Eliot Blennerhassett wrote: > Set snd_pcm_hardware.period_bytes_min to 16 or is that 16 * samplesize? This value is measured in bytes. > snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 16); This parameter is measured in frames. HTH Clemens ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I make sure the period size is a multiple of 16? 2007-09-05 9:08 ` Clemens Ladisch @ 2007-09-05 9:55 ` Trent Piepho 2007-09-05 12:58 ` Takashi Iwai 0 siblings, 1 reply; 7+ messages in thread From: Trent Piepho @ 2007-09-05 9:55 UTC (permalink / raw) To: Clemens Ladisch; +Cc: alsa-devel On Wed, 5 Sep 2007, Clemens Ladisch wrote: > Eliot Blennerhassett wrote: > > Set snd_pcm_hardware.period_bytes_min to 16 or is that 16 * samplesize? > > This value is measured in bytes. > > > snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 16); > > This parameter is measured in frames. Isn't SNDRV_PCM_HW_PARAM_PERIOD_SIZE measured in frames, and SNDRV_PCM_HW_PARAM_PERIOD_BYTES in bytes? ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I make sure the period size is a multiple of 16? 2007-09-05 9:55 ` Trent Piepho @ 2007-09-05 12:58 ` Takashi Iwai 0 siblings, 0 replies; 7+ messages in thread From: Takashi Iwai @ 2007-09-05 12:58 UTC (permalink / raw) To: Trent Piepho; +Cc: alsa-devel, perex At Wed, 5 Sep 2007 02:55:32 -0700 (PDT), Trent Piepho wrote: > > On Wed, 5 Sep 2007, Clemens Ladisch wrote: > > Eliot Blennerhassett wrote: > > > Set snd_pcm_hardware.period_bytes_min to 16 or is that 16 * samplesize? > > > > This value is measured in bytes. > > > > > snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 16); > > > > This parameter is measured in frames. > > Isn't SNDRV_PCM_HW_PARAM_PERIOD_SIZE measured in frames, and > SNDRV_PCM_HW_PARAM_PERIOD_BYTES in bytes? Yes, *_BYTES is for bytes. I don't know what happens with www-old.alsa-project.org. Anyway, I'd love to move back the pages to www.alsa-project.org, if possible. If that's difficult due to a technical reason, I'm willing to move the stuff to other web site. Jaroslav, what is the status? thanks, Takashi ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I make sure the period size is a multiple of 16? 2007-09-05 0:29 ` Eliot Blennerhassett 2007-09-05 9:08 ` Clemens Ladisch @ 2007-09-06 17:07 ` Timur Tabi 2007-09-06 17:14 ` Trent Piepho 1 sibling, 1 reply; 7+ messages in thread From: Timur Tabi @ 2007-09-06 17:07 UTC (permalink / raw) To: Eliot Blennerhassett; +Cc: alsa-devel Eliot Blennerhassett wrote: > You need to add some constraints to your driver, in the open callback. > E.g. > snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 16); Thanks. snd_pcm_hw_constraint_step() is not documented anywhere, and the comments in the source code don't provide any clues, either. Even the "ALSA Driver API" document just lists the function, but doesn't actually tell you what it does. -- Timur Tabi Linux Kernel Developer @ Freescale ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I make sure the period size is a multiple of 16? 2007-09-06 17:07 ` Timur Tabi @ 2007-09-06 17:14 ` Trent Piepho 0 siblings, 0 replies; 7+ messages in thread From: Trent Piepho @ 2007-09-06 17:14 UTC (permalink / raw) To: Timur Tabi; +Cc: alsa-devel On Thu, 6 Sep 2007, Timur Tabi wrote: > Eliot Blennerhassett wrote: > > > You need to add some constraints to your driver, in the open callback. > > E.g. > > snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 16); > > Thanks. snd_pcm_hw_constraint_step() is not documented anywhere, and the > comments in the source code don't provide any clues, either. Even the "ALSA > Driver API" document just lists the function, but doesn't actually tell you > what it does. I still haven't figured out what the "condition bits" do. It's always 0 every time one of the constraint functions are called. I looked in the ALSA core code, and it seems that if you specify some condition bits they must match some flag bits in the hw params for the constraint to apply. But the flags bits just get copied from user space, so there is no clue in the kernel code what they are or what they do. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-09-06 17:14 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-09-04 22:50 How can I make sure the period size is a multiple of 16? Timur Tabi 2007-09-05 0:29 ` Eliot Blennerhassett 2007-09-05 9:08 ` Clemens Ladisch 2007-09-05 9:55 ` Trent Piepho 2007-09-05 12:58 ` Takashi Iwai 2007-09-06 17:07 ` Timur Tabi 2007-09-06 17:14 ` Trent Piepho
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.