public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: usb-audio: Fix "cannot set freq 48000 to ep 0x3" msgs
@ 2023-06-01 13:11 Joakim Tjernlund
  2023-06-01 14:28 ` Joakim Tjernlund
  0 siblings, 1 reply; 5+ messages in thread
From: Joakim Tjernlund @ 2023-06-01 13:11 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel,
	Greg Kroah-Hartman
  Cc: Joakim Tjernlund, stable

On some USB speaker devices(Jabra/Logitech) we see above error
msg when connecting device to computer and kernel is probing the device.

Moving the snd_usb_init_sample_rate() to after usb_set_interface() makes
the error go away.

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Cc: stable@vger.kernel.org
---
 sound/usb/stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index f10f4e6d3fb8..d9ac8663a48b 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -1226,8 +1226,8 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip,
 		/* try to set the interface... */
 		usb_set_interface(chip->dev, iface_no, 0);
 		snd_usb_init_pitch(chip, fp);
-		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
 		usb_set_interface(chip->dev, iface_no, altno);
+		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
 	}
 	return 0;
 }
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix "cannot set freq 48000 to ep 0x3" msgs
  2023-06-01 13:11 [PATCH] ALSA: usb-audio: Fix "cannot set freq 48000 to ep 0x3" msgs Joakim Tjernlund
@ 2023-06-01 14:28 ` Joakim Tjernlund
  2023-06-05  7:39   ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Joakim Tjernlund @ 2023-06-01 14:28 UTC (permalink / raw)
  To: gregkh@linuxfoundation.org, perex@perex.cz, michael@ralston.id.au,
	linux-kernel@vger.kernel.org, tiwai@suse.com,
	alsa-devel@alsa-project.org
  Cc: stable@vger.kernel.org

Adding Michael Ralston <michael@ralston.id.au>

He did have problems with his behringer UMC404HD device when this whole seq. was removed.
Ralston, can you try if the below change affects your device?

 Jocke

On Thu, 2023-06-01 at 15:11 +0200, Joakim Tjernlund wrote:
> On some USB speaker devices(Jabra/Logitech) we see above error
> msg when connecting device to computer and kernel is probing the device.
> 
> Moving the snd_usb_init_sample_rate() to after usb_set_interface() makes
> the error go away.
> 
> Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> Cc: stable@vger.kernel.org
> ---
>  sound/usb/stream.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/usb/stream.c b/sound/usb/stream.c
> index f10f4e6d3fb8..d9ac8663a48b 100644
> --- a/sound/usb/stream.c
> +++ b/sound/usb/stream.c
> @@ -1226,8 +1226,8 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip,
>  		/* try to set the interface... */
>  		usb_set_interface(chip->dev, iface_no, 0);
>  		snd_usb_init_pitch(chip, fp);
> -		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
>  		usb_set_interface(chip->dev, iface_no, altno);
> +		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
>  	}
>  	return 0;
>  }


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix "cannot set freq 48000 to ep 0x3" msgs
  2023-06-01 14:28 ` Joakim Tjernlund
@ 2023-06-05  7:39   ` Takashi Iwai
  2023-06-05 13:21     ` Joakim Tjernlund
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2023-06-05  7:39 UTC (permalink / raw)
  To: Joakim Tjernlund
  Cc: gregkh@linuxfoundation.org, perex@perex.cz, michael@ralston.id.au,
	linux-kernel@vger.kernel.org, tiwai@suse.com,
	alsa-devel@alsa-project.org, stable@vger.kernel.org

On Thu, 01 Jun 2023 16:28:05 +0200,
Joakim Tjernlund wrote:
> 
> Adding Michael Ralston <michael@ralston.id.au>
> 
> He did have problems with his behringer UMC404HD device when this whole seq. was removed.
> Ralston, can you try if the below change affects your device?

Sorry for the late reaction, as I've been off in the last weeks.

The code sequence there seems pretty sensitive, and swapping or
dropping the call might break things easily on certain devices,
unfortunately.  So, I guess we can't take the patch as is.  If any, we
need to fiddle the call order depending on the device quirk or such.
I guess we may try to fit with the existing quirk flag.  Let me check
it later.


thanks,

Takashi


>  Jocke
> 
> On Thu, 2023-06-01 at 15:11 +0200, Joakim Tjernlund wrote:
> > On some USB speaker devices(Jabra/Logitech) we see above error
> > msg when connecting device to computer and kernel is probing the device.
> > 
> > Moving the snd_usb_init_sample_rate() to after usb_set_interface() makes
> > the error go away.
> > 
> > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > Cc: stable@vger.kernel.org
> > ---
> >  sound/usb/stream.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/sound/usb/stream.c b/sound/usb/stream.c
> > index f10f4e6d3fb8..d9ac8663a48b 100644
> > --- a/sound/usb/stream.c
> > +++ b/sound/usb/stream.c
> > @@ -1226,8 +1226,8 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip,
> >  		/* try to set the interface... */
> >  		usb_set_interface(chip->dev, iface_no, 0);
> >  		snd_usb_init_pitch(chip, fp);
> > -		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
> >  		usb_set_interface(chip->dev, iface_no, altno);
> > +		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
> >  	}
> >  	return 0;
> >  }
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix "cannot set freq 48000 to ep 0x3" msgs
  2023-06-05  7:39   ` Takashi Iwai
@ 2023-06-05 13:21     ` Joakim Tjernlund
  2023-06-05 13:43       ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Joakim Tjernlund @ 2023-06-05 13:21 UTC (permalink / raw)
  To: tiwai@suse.de
  Cc: stable@vger.kernel.org, gregkh@linuxfoundation.org,
	perex@perex.cz, michael@ralston.id.au,
	linux-kernel@vger.kernel.org, tiwai@suse.com,
	alsa-devel@alsa-project.org

On Mon, 2023-06-05 at 09:39 +0200, Takashi Iwai wrote:
> On Thu, 01 Jun 2023 16:28:05 +0200,
> Joakim Tjernlund wrote:
> > 
> > Adding Michael Ralston <michael@ralston.id.au>
> > 
> > He did have problems with his behringer UMC404HD device when this whole seq. was removed.
> > Ralston, can you try if the below change affects your device?
> 
> Sorry for the late reaction, as I've been off in the last weeks.

NP.

> 
> The code sequence there seems pretty sensitive, and swapping or
> dropping the call might break things easily on certain devices,
> unfortunately.  So, I guess we can't take the patch as is.  If any, we
> need to fiddle the call order depending on the device quirk or such.
> I guess we may try to fit with the existing quirk flag.  Let me check
> it later.

yes, this is tricky. To me it look like this code will always set 48000 sample rate and
not all devices support that on all EPs.
Maybe one can get away with not setting sample rate at all? Just guessing though.

 Jocke

> 
> 
> thanks,
> 
> Takashi
> 
> 
> >  Jocke
> > 
> > On Thu, 2023-06-01 at 15:11 +0200, Joakim Tjernlund wrote:
> > > On some USB speaker devices(Jabra/Logitech) we see above error
> > > msg when connecting device to computer and kernel is probing the device.
> > > 
> > > Moving the snd_usb_init_sample_rate() to after usb_set_interface() makes
> > > the error go away.
> > > 
> > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > > Cc: stable@vger.kernel.org
> > > ---
> > >  sound/usb/stream.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/sound/usb/stream.c b/sound/usb/stream.c
> > > index f10f4e6d3fb8..d9ac8663a48b 100644
> > > --- a/sound/usb/stream.c
> > > +++ b/sound/usb/stream.c
> > > @@ -1226,8 +1226,8 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip,
> > >  		/* try to set the interface... */
> > >  		usb_set_interface(chip->dev, iface_no, 0);
> > >  		snd_usb_init_pitch(chip, fp);
> > > -		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
> > >  		usb_set_interface(chip->dev, iface_no, altno);
> > > +		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
> > >  	}
> > >  	return 0;
> > >  }
> > 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix "cannot set freq 48000 to ep 0x3" msgs
  2023-06-05 13:21     ` Joakim Tjernlund
@ 2023-06-05 13:43       ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2023-06-05 13:43 UTC (permalink / raw)
  To: Joakim Tjernlund
  Cc: stable@vger.kernel.org, gregkh@linuxfoundation.org,
	perex@perex.cz, michael@ralston.id.au,
	linux-kernel@vger.kernel.org, tiwai@suse.com,
	alsa-devel@alsa-project.org

On Mon, 05 Jun 2023 15:21:51 +0200,
Joakim Tjernlund wrote:
> 
> On Mon, 2023-06-05 at 09:39 +0200, Takashi Iwai wrote:
> > On Thu, 01 Jun 2023 16:28:05 +0200,
> > Joakim Tjernlund wrote:
> > > 
> > > Adding Michael Ralston <michael@ralston.id.au>
> > > 
> > > He did have problems with his behringer UMC404HD device when this whole seq. was removed.
> > > Ralston, can you try if the below change affects your device?
> > 
> > Sorry for the late reaction, as I've been off in the last weeks.
> 
> NP.
> 
> > 
> > The code sequence there seems pretty sensitive, and swapping or
> > dropping the call might break things easily on certain devices,
> > unfortunately.  So, I guess we can't take the patch as is.  If any, we
> > need to fiddle the call order depending on the device quirk or such.
> > I guess we may try to fit with the existing quirk flag.  Let me check
> > it later.
> 
> yes, this is tricky. To me it look like this code will always set 48000 sample rate and
> not all devices support that on all EPs.
> Maybe one can get away with not setting sample rate at all? Just guessing though.

I guess it should work without setting the rate explicitly, but as
already mentioned, some devices (firmware) might need it.  Who knows.

The vendors apparently test only with Windows and/or MacOS, and
issuing unexpected commands (or missing the expected command) can
screw up firmware...


Takashi

> 
>  Jocke
> 
> > 
> > 
> > thanks,
> > 
> > Takashi
> > 
> > 
> > >  Jocke
> > > 
> > > On Thu, 2023-06-01 at 15:11 +0200, Joakim Tjernlund wrote:
> > > > On some USB speaker devices(Jabra/Logitech) we see above error
> > > > msg when connecting device to computer and kernel is probing the device.
> > > > 
> > > > Moving the snd_usb_init_sample_rate() to after usb_set_interface() makes
> > > > the error go away.
> > > > 
> > > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > > > Cc: stable@vger.kernel.org
> > > > ---
> > > >  sound/usb/stream.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/sound/usb/stream.c b/sound/usb/stream.c
> > > > index f10f4e6d3fb8..d9ac8663a48b 100644
> > > > --- a/sound/usb/stream.c
> > > > +++ b/sound/usb/stream.c
> > > > @@ -1226,8 +1226,8 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip,
> > > >  		/* try to set the interface... */
> > > >  		usb_set_interface(chip->dev, iface_no, 0);
> > > >  		snd_usb_init_pitch(chip, fp);
> > > > -		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
> > > >  		usb_set_interface(chip->dev, iface_no, altno);
> > > > +		snd_usb_init_sample_rate(chip, fp, fp->rate_max);
> > > >  	}
> > > >  	return 0;
> > > >  }
> > > 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-05 13:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-01 13:11 [PATCH] ALSA: usb-audio: Fix "cannot set freq 48000 to ep 0x3" msgs Joakim Tjernlund
2023-06-01 14:28 ` Joakim Tjernlund
2023-06-05  7:39   ` Takashi Iwai
2023-06-05 13:21     ` Joakim Tjernlund
2023-06-05 13:43       ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox