Bug 252434 - for USB audio headset, need do set interface dynamiclly for power save and correct status of headsets
Summary: for USB audio headset, need do set interface dynamiclly for power save and co...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-05 10:46 UTC by Horse Ma
Modified: 2021-04-22 10:44 UTC (History)
1 user (show)

See Also:


Attachments
patch to add set interface dynamicly. (7.92 KB, text/plain)
2021-01-05 10:46 UTC, Horse Ma
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Horse Ma 2021-01-05 10:46:28 UTC
Created attachment 221286 [details]
patch to add set interface dynamicly.

1. set interface 0 and alt number when headset stop/start working is quite standard on windows/Linux OS
2. set interface 0 when not headset doesn't work can help power save;
3. some Epos headset tool check will check the headset status by polling it's current alt interface, and "0" set interface alt stands that headset is idle, so EPOS application do can do firmware update for this device.

Base above comment, it's good deal to add this patch.
Comment 1 Hans Petter Selasky freebsd_committer 2021-01-05 10:54:11 UTC
I'll have a look at your patch later today.
Comment 2 Hans Petter Selasky freebsd_committer 2021-01-07 14:52:31 UTC
Hi,

Can you explain briefly why you need a new channel method to support this new feature?

Cannot the current channel callback methods be used?


Have you tried:

usbconfig -d X.Y power_save

It will cause automatic suspend of the USB audio device when not in use? Can this be used instead of playing with the alternate settings?

--HPS
Comment 3 Horse Ma 2021-01-08 03:30:04 UTC
Put this diff to Phabricator.
https://reviews.freebsd.org/D28032

We are running Citrix VDI application on FreeBSD, and there will be audio choppy when playing short audio voice if set_interface in chn_start set when audio is playing by Citrix VDI application. 

It seems that it need use as less as time in chn_start. So I add chn_prepare and do set_interface which need quite long time before chn_start.

It will make the headset situation more complicated if use "usbconfig -d X.Y power_save". 
Power_save will not set interface, and the device may need longer time to recover working again. 
It's not a standard method to support this feature.
Comment 4 Hans Petter Selasky freebsd_committer 2021-04-22 10:44:05 UTC
Submitted by:
https://cgit.freebsd.org/src/commit/?id=31070b5bc77a499009a835650eb9d4bf2eceaa15

--HPS