Re: [PATCH] ALSA: usb-audio: Logitech P710e: Add quirk to fix setting sample rate.

From: Joakim Tjernlund
Date: Thu Jun 01 2023 - 07:02:02 EST


On Thu, 2023-06-01 at 12:39 +0200, Joakim Tjernlund wrote:
> On Wed, 2023-05-31 at 14:51 +0200, Joakim Tjernlund wrote:
> > P710e, will throw an "cannot set freq 48000 to ep 0x3" error, no
> > matter adding mdelays around setting sample rate.
>
> Please ignore this patch, the "cannot set freq 48000 to ep 0x3" only happens when
> kernel(6.1.31) initially probes the device:
>
> [ 555.200166] usb 3-1: USB disconnect, device number 14
> [ 560.906553] usb 3-1: new full-speed USB device number 15 using xhci_hcd
> [ 561.104340] usb 3-1: 2:1: cannot set freq 48000 to ep 0x3
> [ 566.342420] usb 3-1: 2:1: cannot get freq at ep 0x3
> [ 566.497056] input: Logitech Speakerphone P710e Consumer Control as /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.3/0003:046D:0A4E.0008/input/input29
> [ 566.548828] input: Logitech Speakerphone P710e as /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.3/0003:046D:0A4E.0008/input/input30
> [ 566.549086] hid-generic 0003:046D:0A4E.0008: input,hiddev97,hidraw5: USB HID v1.11 Device [Logitech Speakerphone P710e] on usb-0000:00:14.0-1/input3
>
> I have a Jabra SPEAK 510 which behaves the same.
> Once attached setting sample rate works.
>
> Seems like the devices are not ready to handle sample rate
> this early when device is beeing attached. Does the kernel need to manage
> sample rate before device is fully attached?

This swap appears to make the initial error go away:
diff -u stream.c.org stream.c
--- stream.c.org 2023-06-01 12:54:41.229145989 +0200
+++ stream.c 2023-06-01 12:57:46.427514638 +0200
@@ -1226,8 +1226,8 @@
/* 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;
}

But I don't really now what I am doing w.r.t USB/Audio

Jocke