[wdmaudiodev] Re: UAC2 volume multiple range control

  • From: Kevin Ng <drastar.ng@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 6 Dec 2018 15:32:09 +0800

Thanks Matthew,

For ACClockSource ranges, it allows length up to 258 bytes so I would
expect the get volume range to follow kind of the same structure as stated
in the spec.

Here is part of the logs.

[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopology: BEGIN
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopology: Inspecting audio function
topology of '<NULL>'
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopology: Inspecting topology paths for
OutputTerminal ID=0x05
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyHandler: Inspecting OutputTerminal
ID=0x05
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyHandler: Inspecting FeatureUnit
ID=0x01
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]ACUnit::CheckVolumeRange:
Interval [wMin=-12308, wMax=0] is not a multiple of wRes=426
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]ACFeatureUnit::SendVolumeControlGetRange:(0x01): chan=0 GET
volume range -12308 (0xcfec), 0 (0x0000), 426 (0x01aa)
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyHandler: Inspecting InputTerminal
ID=0x03
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyPostProcess: Post processing
InputTerminal ID=0x03
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]ACInputTerminal::DetermineChannelCount:(0x03):
OutputChannelCount=8 taken from physical cluster
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]   InputTerminal ID=0x03
'<NULL>'
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Controls=0x0000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     OutputChannelCount=8
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     TerminalType=0x0101
USB_STREAMING
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     AssocTerminal=0x00
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     CSourceID=0x22
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     HasConnectorControl=0
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     AudioChannelCluster:
NrChannels=8 ChanConfig=0x0000063f FirstStringIndex=0 NumStrings=0
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyPostProcess: Post processing
FeatureUnit ID=0x01
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]   FeatureUnit ID=0x01
'<NULL>'
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Controls=0x0000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     NumInputPins=1
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       [0] -->
SourceID=0x03 '<NULL>' InputChannelCount=8
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     OutputChannelCount=8
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Channel Controls:
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  0
controls=0x0000000f MUTE VOL
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  1
controls=0x00000000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  2
controls=0x00000000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  3
controls=0x00000000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  4
controls=0x00000000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  5
controls=0x00000000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  6
controls=0x00000000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  7
controls=0x00000000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  8
controls=0x00000000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Volume Ranges:
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  0  min=-12308
(0xcfec)  max=0 (0x0000)  res=426 (0x01aa)
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyPostProcess: Post processing
OutputTerminal ID=0x05
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]   OutputTerminal ID=0x05
'Speaker'
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Controls=0x0000
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     NumInputPins=1
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       [0] -->
SourceID=0x01 '<NULL>' InputChannelCount=8
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     TerminalType=0x0301
SPEAKER
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     AssocTerminal=0x00
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     CSourceID=0x22
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     HasConnectorControl=0
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopology: Inspecting topology paths for
OutputTerminal ID=0x06
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyHandler: Inspecting OutputTerminal
ID=0x06
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyHandler: Inspecting FeatureUnit
ID=0x02
[4]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]ACUnit::CheckVolumeRange:
Interval [wMin=-24576, wMax=2304] is not a multiple of wRes=220
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]ACFeatureUnit::SendVolumeControlGetRange:(0x02): chan=0 GET
volume range -24576 (0xa000), 2304 (0x0900), 220 (0x00dc)
[4]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyHandler: Inspecting InputTerminal
ID=0x04
[6]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyPostProcess: Post processing
InputTerminal ID=0x04
[6]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]ACInputTerminal::DetermineChannelCount:(0x04):
OutputChannelCount=2 taken from logical cluster
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]   InputTerminal ID=0x04
'Microphone Array'
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Controls=0x0000
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     OutputChannelCount=2
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     TerminalType=0x0201
MICROPHONE
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     AssocTerminal=0x00
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     CSourceID=0x26
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     HasConnectorControl=0
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     AudioChannelCluster:
NrChannels=2 ChanConfig=0x00000003 FirstStringIndex=0 NumStrings=0
[6]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyPostProcess: Post processing
FeatureUnit ID=0x02
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]   FeatureUnit ID=0x02
'<NULL>'
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Controls=0x0000
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     NumInputPins=1
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       [0] -->
SourceID=0x04 'Microphone Array' InputChannelCount=2
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     OutputChannelCount=2
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Channel Controls:
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  0
controls=0x0000000f MUTE VOL
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  1
controls=0x00000000
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  2
controls=0x00000000
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Volume Ranges:
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       Chan  0  min=-24576
(0xa000)  max=2304 (0x0900)  res=220 (0x00dc)
[6]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopologyPostProcess: Post processing
OutputTerminal ID=0x06
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]   OutputTerminal ID=0x06
'<NULL>'
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     Controls=0x0000
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     NumInputPins=1
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]       [0] -->
SourceID=0x02 '<NULL>' InputChannelCount=2
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     TerminalType=0x0101
USB_STREAMING
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     AssocTerminal=0x00
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     CSourceID=0x26
[6]0004.3950::12/06/2018-10:30:27.635 [USBAudio2]     HasConnectorControl=0
[6]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectTopology: Inspecting clock path of
InputTerminal ID=0x03
[6]0004.3950::12/06/2018-10:30:27.635
[USBAudio2]AudioFunction::InspectClockPathHandler: Inspecting ClockSelector
ID=0x22
[4]0004.3950::12/06/2018-10:30:27.636 [USBAudio2]   ClockSelector ID=0x22
'<NULL>'
[4]0004.3950::12/06/2018-10:30:27.636 [USBAudio2]     Controls=0x0003
[4]0004.3950::12/06/2018-10:30:27.636 [USBAudio2]     NumInputPins=1
[4]0004.3950::12/06/2018-10:30:27.636 [USBAudio2]       [0] -->
SourceID=0x21 '<NULL>' InputChannelCount=0
[4]0004.3950::12/06/2018-10:30:27.636 [USBAudio2]     OutputChannelCount=0
[4]0004.3950::12/06/2018-10:30:27.636 [USBAudio2]   Position=1
[4]0004.3950::12/06/2018-10:30:27.636
[USBAudio2]AudioFunction::InspectClockPathHandler: Inspecting ClockSource
ID=0x21
[6]0004.3950::12/06/2018-10:30:27.636
[USBAudio2]ACClockSource::QuerySupportedList:(0x21): device returned
range[0]: min=44100 max=44100 res=0
[6]0004.3950::12/06/2018-10:30:27.636
[USBAudio2]ACClockSource::QuerySupportedList:(0x21): device returned
range[1]: min=48000 max=48000 res=0
[6]0004.3950::12/06/2018-10:30:27.636
[USBAudio2]ACClockSource::QuerySupportedList:(0x21): device returned
range[2]: min=96000 max=96000 res=0

On Thu, Dec 6, 2018 at 10:11 AM Matthew van Eerde <
dmarc-noreply@xxxxxxxxxxxxx> wrote:

You can use the steps outlined at this blog post to get usbaudio2.sys
logs, which may shed some light on the subject


https://blogs.msdn.microsoft.com/matthew_van_eerde/2017/10/23/how-to-gather-and-read-logs-for-microsofts-usb-audio-2-0-class-driver/


------------------------------
*From:* wdmaudiodev-bounce@xxxxxxxxxxxxx <wdmaudiodev-bounce@xxxxxxxxxxxxx>
on behalf of Kevin Ng <drastar.ng@xxxxxxxxx>
*Sent:* Wednesday, December 5, 2018 5:49:08 PM
*To:* wdmaudiodev@xxxxxxxxxxxxx
*Subject:* [wdmaudiodev] Re: UAC2 volume multiple range control

The OS send the volume range request one time on enumeration. I even tried
to use the audiocontrol interrupt endpoint to request OS to grab one more
time. It did come, but now the sound control now shows the 2nd range that I
gave. The OS does not seems to accept multiple volume ranges.
My device have hardware buttons to control volume which have its own range
and resolution. Currently I always use the audiocontrol interrupt endpoint
to ask the Os to snap to our device volume. Only recently found a bug which
only happen on MacOS, the current volume will keeps reducing due to the
volume correction on every start/stop audio playback stream. Therefore
volume snapping on our part introduce the bug, but then we can't
synchronize the device volume and the PC sound control volume if we remove
the feature.

On Thu, Dec 6, 2018 at 5:28 AM Børge Strand-Bergesen <
borge.strand@xxxxxxxxx> wrote:

I see multiple OSes request 0x10 bytes for volume range.

This sounds like something that has to be tested in detail on all
relevant operating systems. What is so special that you can’t use one range
and work it out in firmware?

Børge

On Wednesday, December 5, 2018, Tim Roberts <timr@xxxxxxxxx> wrote:

Kevin Ng wrote:

Hi, I am new here. Tried searching through the list and unable to find
some similar to the above.
So I am trying to specify a multiple volume range control with
different volume resolution for each volume range.
...
I understand what is required to send back the feature unit volume
range request command from the host PC (Windows 10/MacOS). But the problem
is the host PC only allow 8 bytes of data length to be sent back for the
volume range command. Anyone have any idea how to implement this?


Interesting.  I would expect it to make one request of 8 bytes, then
make another request based on the wNumSubRanges you returned.  That's the
usual protocol for variable-length layouts. Do you not see the second
request?

--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx
?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/
<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.wdmaudiodev.com%2F&data=02%7C01%7CMatthew.van.Eerde%40microsoft.com%7Cf8e5d435867a40a1293b08d65b1d1d47%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636796578004358386&sdata=oeyXkMuPAlEPgiF8MkDLI6InmPBbfElO6NvK01r0fYo%3D&reserved=0>


Other related posts: