From: Takashi Iwai Subject: Re: [PATCH v2 2/9] ALSA: line6: Add LINE6_CAP_IN_NEEDS_OUT, a void playback stream during capture Date: Wed, 24 Aug 2016 16:53:55 +0200 Message-ID: References: <1470942147-19848-1-git-send-email-dev@andree.sk> <1471558839-14120-1-git-send-email-dev@andree.sk> <1471558839-14120-3-git-send-email-dev@andree.sk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 93606269FCD for ; Wed, 24 Aug 2016 16:53:55 +0200 (CEST) In-Reply-To: <1471558839-14120-3-git-send-email-dev@andree.sk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Andrej Krutak Cc: stefanha@gmail.com, alsa-devel@alsa-project.org, grabner@icg.tugraz.at List-Id: alsa-devel@alsa-project.org 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 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