* How do I use SNDRV_PCM_INFO_JOINT_DUPLEX?
@ 2007-12-18 19:50 Timur Tabi
2007-12-19 8:27 ` Clemens Ladisch
0 siblings, 1 reply; 2+ messages in thread
From: Timur Tabi @ 2007-12-18 19:50 UTC (permalink / raw)
To: alsa-devel
I'm working on an ASoC driver. I have a limitation in my hardware that if I
have an active substream, I cannot re-program the hardware registers that
control the sample size.
This means, for example, if I'm playing 16-bit audio, and I want to start
capture, I cannot program the sample size into the hardware. My only choice is
to have already programmed the capture sample size *before* I started playback.
The easiest way to implement this is to make sure that the second stream has the
same sample size as the first. That way, I won't need to reprogram the
registers, because they'll already be programmed correctly.
I discovered the SNDRV_PCM_INFO_JOINT_DUPLEX option, but I can't figure out how
to use it. I know it needs to be set in my snd_pcm_hardware.info, but then
what? How do I tell ALSA that the "joint" part is just that the sample sizes
must be the same?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How do I use SNDRV_PCM_INFO_JOINT_DUPLEX?
2007-12-18 19:50 How do I use SNDRV_PCM_INFO_JOINT_DUPLEX? Timur Tabi
@ 2007-12-19 8:27 ` Clemens Ladisch
0 siblings, 0 replies; 2+ messages in thread
From: Clemens Ladisch @ 2007-12-19 8:27 UTC (permalink / raw)
To: Timur Tabi, alsa-devel
Timur Tabi wrote:
> I discovered the SNDRV_PCM_INFO_JOINT_DUPLEX option, but I can't figure out how
> to use it. I know it needs to be set in my snd_pcm_hardware.info, but then
> what? How do I tell ALSA that the "joint" part is just that the sample sizes
> must be the same?
This flag just tells applications that this device may behave
somewhat differently when playback and capture are used at the same
time.
The actual behaviour must be implemented by the driver. In the PCM open
callbacks, set a constraint on the sample format if the other stream is
already configured:
snd_pcm_hw_constraint_mask(runtime, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FMTBIT_xxx);
Since it is possible to open both streams at the same time without yet
configuring them, you have to check again in the hw_params callback.
HTH
Clemens
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-19 8:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-18 19:50 How do I use SNDRV_PCM_INFO_JOINT_DUPLEX? Timur Tabi
2007-12-19 8:27 ` 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.