[alsa-devel] [PATCH v2 0/1] *** SUBJECT HERE ***

Peter Ujfalusi peter.ujfalusi at nokia.com
Thu Jul 22 13:07:18 CEST 2010


Hi,

to give Takashi the context ;)

On Thursday 22 July 2010 13:57:16 Ujfalusi Peter (Nokia-MS/Tampere) wrote:
> So let's ask Takashi:
> Is it possible to use the constraint API for placing HALF_DUPLEX on a
> stream (modifying bits in the info_flags)?

Is there a clean way to do:

+       switch (wl1273->mode) {
+       case WL1273_MODE_BT:
+               pcm->info_flags &= ~SNDRV_PCM_INFO_HALF_DUPLEX;
+               break;
+       case WL1273_MODE_FM_RX:
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+                       pr_err("Cannot play in RX mode.\n");
+                       return -EINVAL;
+               }
+               pcm->info_flags |= SNDRV_PCM_INFO_HALF_DUPLEX;
                 ^
                 This

+               break;
+       case WL1273_MODE_FM_TX:
+               if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+                       pr_err("Cannot capture in TX mode.\n");
+                       return -EINVAL;
+               }
+               pcm->info_flags |= SNDRV_PCM_INFO_HALF_DUPLEX;
                 ^
                 and this

+               break;
+       default:

with for example the ALSA constraint API?

The info_flags are modified at stream open time.

Thanks, 
Péter


More information about the Alsa-devel mailing list