* Is params_format() valid in the _hw_params() function?
@ 2008-07-15 22:08 Timur Tabi
2008-07-16 8:40 ` Clemens Ladisch
0 siblings, 1 reply; 2+ messages in thread
From: Timur Tabi @ 2008-07-15 22:08 UTC (permalink / raw)
To: ALSA development
My ASoC driver programs the sample size in the _prepare() callback function,
because I was under the impression that the sample size cannot be known in the
_hw_params() callback function. However, I just ran a test, and it appears that
the params_format() macro does return the right value. Once I know the format,
I can determine the same size.
Is this always true, even in OSS emulation? I know very little about ALSA and
OSS application programming, so I don't know what causes _hw_params() to be
called vs. _prepare(). If it turns out that params_format() does work in
_hw_params(), I can greatly simplify my driver.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Is params_format() valid in the _hw_params() function?
2008-07-15 22:08 Is params_format() valid in the _hw_params() function? Timur Tabi
@ 2008-07-16 8:40 ` Clemens Ladisch
0 siblings, 0 replies; 2+ messages in thread
From: Clemens Ladisch @ 2008-07-16 8:40 UTC (permalink / raw)
To: Timur Tabi; +Cc: ALSA development
Timur Tabi wrote:
> My ASoC driver programs the sample size in the _prepare() callback function,
> because I was under the impression that the sample size cannot be known in the
> _hw_params() callback function. However, I just ran a test, and it appears that
> the params_format() macro does return the right value. Once I know the format,
> I can determine the same size.
>
> Is this always true, even in OSS emulation?
Yes. The OSS emulation pretends to be an ALSA application.
> I know very little about ALSA and OSS application programming, so I
> don't know what causes _hw_params() to be called vs. _prepare().
*_hw_params() is called to set sample format/rate and buffer parameters.
In most cases, it is called once when the device is initialized, but it
can be called multiple times if an application wants to change some of
these parameters. (The latter happens with OSS emulation because the
various OSS ioctl calls change only one of multiple parameters.)
*_prepare() is called before a device is started. It can be called
multiple times without intervening _hw_params() calls when the device
is started/stopped multiple times.
HTH
Clemens
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-16 8:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-15 22:08 Is params_format() valid in the _hw_params() function? Timur Tabi
2008-07-16 8:40 ` Clemens Ladisch
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.