[alsa-devel] [PATCH v2 2/9] ALSA: line6: Add LINE6_CAP_IN_NEEDS_OUT, a void playback stream during capture

Takashi Iwai tiwai at suse.de
Wed Aug 24 16:53:55 CEST 2016


On Fri, 19 Aug 2016 00:20:32 +0200,
Andrej Krutak wrote:
> 
> E.g. POD X3 seems to require playback data to be sent to it to generate
> capture data. Otherwise the device stalls and doesn't send any more capture
> data until it's reset.
> 
> Signed-off-by: Andrej Krutak <dev at andree.sk>

Only minor issues below:

> diff --git a/sound/usb/line6/driver.h b/sound/usb/line6/driver.h
> index 2d32139..69658dc 100644
> --- a/sound/usb/line6/driver.h
> +++ b/sound/usb/line6/driver.h
> @@ -100,8 +100,10 @@ enum {
>  	LINE6_CAP_CONTROL =	1 << 0,
>  	/* device supports PCM input/output via USB */
>  	LINE6_CAP_PCM =		1 << 1,
> -	/* device support hardware monitoring */
> +	/* device supports hardware monitoring */
>  	LINE6_CAP_HWMON =	1 << 2,
> +	/* device requires output data when input is read */
> +	LINE6_CAP_IN_NEEDS_OUT = 1 << 4,

Any reason to skip 3?


> @@ -242,6 +242,15 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd)
>  		switch (cmd) {
>  		case SNDRV_PCM_TRIGGER_START:
>  		case SNDRV_PCM_TRIGGER_RESUME:
> +			if ((s->stream == SNDRV_PCM_STREAM_CAPTURE) &&

The parentheses are superfluous around (a == b).

> +				(line6pcm->line6->properties->capabilities &
> +					LINE6_CAP_IN_NEEDS_OUT)
> +			) {

Move the close parenthesis and the brace to the previous line.


> @@ -250,6 +259,13 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd)
>  
>  		case SNDRV_PCM_TRIGGER_STOP:
>  		case SNDRV_PCM_TRIGGER_SUSPEND:
> +			if ((s->stream == SNDRV_PCM_STREAM_CAPTURE) &&
> +				(line6pcm->line6->properties->capabilities &
> +					LINE6_CAP_IN_NEEDS_OUT)
> +			) {
> +				line6_stream_stop(line6pcm, SNDRV_PCM_STREAM_PLAYBACK,
> +					  LINE6_STREAM_CAPTURE_HELPER);
> +			}

Ditto.


thanks,

Takashi


More information about the Alsa-devel mailing list