Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: aichao <aichao@kylinos.cn>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	tiwai@suse.com
Subject: Re: [PATCH] ALSA: usb-audio: fix usb camero disconnect issue
Date: Fri, 04 Nov 2022 08:12:08 +0100	[thread overview]
Message-ID: <874jvfkxbr.wl-tiwai@suse.de> (raw)
In-Reply-To: <20221104013236.3480427-1-aichao@kylinos.cn>

On Fri, 04 Nov 2022 02:32:36 +0100,
aichao wrote:
> 
> When current rate is different from the runtime rate,
> snd_usb_endpoint stop and close endpoint to resetting rate.
> if snd_usb_endpoint close the endpoint, sometimes usb will
>  disconnect the device.

What do you mean...?  snd_usb_endpoint_close() never disconnects the
device by itself.

Please elaborate the problem.


Takashi

> 
> Signed-off-by: aichao <aichao@kylinos.cn>
> ---
>  sound/usb/pcm.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
> index 5dc9266180e3..2ae4a55cbaa8 100644
> --- a/sound/usb/pcm.c
> +++ b/sound/usb/pcm.c
> @@ -517,7 +517,6 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
>  		if (snd_usb_endpoint_compatible(chip, subs->data_endpoint,
>  						fmt, hw_params))
>  			goto unlock;
> -		close_endpoints(chip, subs);
>  	}
>  
>  	subs->data_endpoint = snd_usb_endpoint_open(chip, fmt, hw_params, false);
> @@ -546,9 +545,6 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
>  	ret = configure_endpoints(chip, subs);
>  
>   unlock:
> -	if (ret < 0)
> -		close_endpoints(chip, subs);
> -
>  	snd_usb_unlock_shutdown(chip);
>   stop_pipeline:
>  	if (ret < 0)
> @@ -574,7 +570,6 @@ static int snd_usb_hw_free(struct snd_pcm_substream *substream)
>  	if (!snd_usb_lock_shutdown(chip)) {
>  		if (stop_endpoints(subs))
>  			sync_pending_stops(subs);
> -		close_endpoints(chip, subs);
>  		snd_usb_unlock_shutdown(chip);
>  	}
>  
> -- 
> 2.25.1
> 

      reply	other threads:[~2022-11-04  7:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  1:32 [PATCH] ALSA: usb-audio: fix usb camero disconnect issue aichao
2022-11-04  7:12 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jvfkxbr.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=aichao@kylinos.cn \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox