[wdmaudiodev] Re: Audio control for recording not possible???

  • From: "Paul V Wysocki" <pvw@xxxxxxxxxxxxxx>
  • To: "'A.'" <alberto_balsalm@xxxxxxxxxxx>
  • Date: Tue, 24 Sep 2002 19:30:47 -0500

Alberto,

I also put selector units in the playback descriptor.  Here is an
extract from usbview.exe:

Audio Control Output Terminal Descriptor:
bLength:              0x09
bDescriptorType:      0x24
bDescriptorSubtype:   0x03
bTerminalID:          0x02
wTerminalType:      0x0301 (Speaker)
bAssocTerminal:       0x01
bSoruceID:            0x0A
iTerminal:            0x00

Audio Control Input Terminal Descriptor:
bLength:              0x0C
bDescriptorType:      0x24
bDescriptorSubtype:   0x02
bTerminalID:          0x03
wTerminalType:      0x0101 (USB streaming)
bAssocTerminal:       0x04
bNrChannels:          0x01
wChannelConfig:     0x0000
iChannelNames:        0x00
iTerminal:            0x00

Audio Control Feature Unit Descriptor:
bLength:              0x0B
bDescriptorType:      0x24
bDescriptorSubtype:   0x06
bUnitID:              0x06
bSourceID:            0x03
bControlSize:         0x02
bmaControls[0]:
03 00 
bmaControls[1]:
00 00 
iFeature:             0x00

Audio Control Selector Unit Descriptor:
bLength:              0x07
bDescriptorType:      0x24
bDescriptorSubtype:   0x05
bUnitID:              0x09
bNrInPins:            0x01
baSourceID[1]:        0x06
iSelector:            0x00

Audio Control Feature Unit Descriptor:
bLength:              0x0B
bDescriptorType:      0x24
bDescriptorSubtype:   0x06
bUnitID:              0x0A
bSourceID:            0x09
bControlSize:         0x02
bmaControls[0]:
03 00 
bmaControls[1]:
00 00 
iFeature:             0x00

I don't know if it would work for three FU's.  Perhaps phantom Output
Terminals would do the trick as well.  If you had

USB stream(IT 1)->Volume (FU 2)->Speaker (OT 3)
          (IT 1)->Volume (FU 4)->Speaker (OT 5)
          (IT 1)->Volume (FU 6)->Speaker (OT 7)

This might work as well.  You probably need to have IT 1 be the source
ID for FU 2, 4, and 6 because the AudioStream Interface will reference
the Input Terminal Number, but you can make the Output Terminals 3, 5,
and 7 be synonyms in your firmware.  I hadn't thought of this when we
implemented our descriptors, so I haven't tried it.

Good luck.

-Paul

-----Original Message-----
From: A. [mailto:alberto_balsalm@xxxxxxxxxxx] 
Sent: Tuesday, September 24, 2002 4:21 PM
To: pvw@xxxxxxxxxxxxxx
Subject: Re: [wdmaudiodev] Re: Audio control for recording not
possible???


Hi Paul,

I'm trying to do something similar as what you explained below but for
playback. I want three volume sliders for my playback device and tried
the following based on what you said:

USB stream->Volume FU->Selector Unit->Volume FU->Selector Unit->Volume
FU->Speaker

However, in my case, I can't even open up the mixer to check for the
volume sliders! Windows gives me an error... Did you do anything special
with your descriptors, particularly with the selector unit descriptor?

Thanks

A.

----- Original Message -----
From: "Paul V Wysocki" <pvw@xxxxxxxxxxxxxx>
To: <wdmaudiodev@xxxxxxxxxxxxx>
Sent: Tuesday, September 24, 2002 12:18
Subject: [wdmaudiodev] Re: Audio control for recording not possible???


>
> Jerry,
>
> I have implemented the volume and mute controls within a feature unit 
> for microphone terminal units.  So far, I have tested with Windows 
> 98SE and Windows 2000.  Our actual connectivity looks like this:
>
> Mic->Volume FU->Selector Unit->Volume FU->Wave Input
>
> We put the Selector unit in there because we actually do some mixing 
> outside the Audio Class specification and I wanted to control the 
> volume before and after the mix.  Without the Selector Unit, Windows 
> consolidated the two Volume Feature Units into a single volume slider 
> in the mixer API.  Windows doesn't seem to implement the selector 
> unit, but it does give me separate control of the two feature units.
>
> -Paul
>
> -----Original Message-----
> From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
> [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Jerry J. 
> Trantow
> Sent: Tuesday, September 24, 2002 10:51 AM
> To: wdmaudiodev@xxxxxxxxxxxxx
> Subject: [wdmaudiodev] Re: Audio control for recording not possible???
>
>
>
> I was going on the assumption that the OS did not support volume 
> controls for the record volume.  You have a good point distinguishing 
> the difference between mixer api and control panel.
>
> If the control panel supports it, he only needs to correctly implement

> his firmware.  If the control panel doesn't but the mixer api does 
> support the record volume control, he could write his own control 
> panel to handle this control. You are certainly correct that this 
> would be much easier than the filter driver option I laid out.  The 
> filter driver is the last option if the built in facilities don't 
> support it.
>
> Have you implemented a feature unit on an input? Does the mixer API 
> support it under all OS?
>
> -----Original Message-----
> From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
> [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Paul V Wysocki
> Sent: Tuesday, September 24, 2002 10:24 AM
> To: wdmaudiodev@xxxxxxxxxxxxx
> Subject: [wdmaudiodev] Re: Audio control for recording not possible???
>
>
> Jerry,
>
> I think you are making this more complicated than it needs to be.  If 
> Ajai's Audio Control Descriptor specifies a Function Unit with a 
> volume control between his Mic Terminal Unit and his Wave audio 
> Terminal Unit, then the Windows Mixer API will show him a volume 
> control slider that will send the usb audio class commands on control 
> endpoint zero to set the volume for recording.  One note on this, you 
> need to implement the GET_MIN, GET_MAX, GET_CUR, and SET_CUR commands 
> for the audio class driver to actually implement the mixer.  If your 
> firmware sends a stall for these commands, then windows will assume 
> that the feature unit doesn't exist, and won't show the slider in 
> volume manager.
>
> However, if the intent is to control the volume from within the device

> itself, this is even easier as long as you don't need to notify 
> windows that the volume changed.  If windows needs to know, then you 
> probably do want a HID device, but if windows doesn't need to know, 
> then you can react to the button presses on the cypress board and 
> change your volume level before you send the digitized audio to the 
> isochronous endpoint fifo.
>
> Am I missing something?  This seems much simpler than a filter driver 
> to build custom volume controls to replace the standard volume 
> controls.  I can see where a filter driver would be useful for 
> implementing volume (or other) controls that the standard usbaudio.sys

> doesn't handle correctly, but wave recording volume shouldn't be a 
> problem.
>
> -Paul
>
> -----Original Message-----
> From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
> [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Jerry J. 
> Trantow
> Sent: Tuesday, September 24, 2002 9:11 AM
> To: wdmaudiodev@xxxxxxxxxxxxx
> Cc: ed.stroup@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> Subject: [wdmaudiodev] Re: Audio control for recording not possible???
>
>
>
> My understanding of your problem is that the Windows multimedia 
> control panel doesn't have a control for sending record volume 
> information to your device.  Your device firmware implements the audio

> control, but there isn't a built in way to get information to it.
>
> Filter drivers are a method of adding functionality to the existing 
> drivers.  My suggestion is to write and install a filter driver 
> (probably on top of usbaudio.sys) that would translate IOCTLs from 
> DeviceIOControl into the appropriate usb messages for the audio 
> control. You would also need to write a simple control panel that 
> would call DeviceIOControl to send the messages.
>
> The control panel is very simple code.  You need to monitor the 
> PlugNPlay of appropriate devices and send a few IOCTL messages. 
> Ideally, you write this as an automation server so people can use VB 
> or Java scripts to control it.
>
> The filter driver simply translates the IOCTLs into the appropriate 
> usb commands for your device.  The DDK has a bunch of UsbBuild macros 
> which make it easy to put the usb command together.
>
> My experience has been that the biggest problem is supporting all the 
> peculiarities between different OS especially when it comes to 
> installing drivers.
>
> I have done several contract jobs similar to this.  If you are 
> interested in contracting out this work we should take this discussion

> out of wdmaudiodev. jtrantow@xxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> -----Original Message-----
> From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
> [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Ajai James
> Sent: Monday, September 23, 2002 7:34 PM
> To: wdmaudiodev@xxxxxxxxxxxxx
> Subject: [wdmaudiodev] Re: Audio control for recording not possible???
>
>
> Hi Jerry,
> Thanks a lot for your suggestion and help. Can you explain a little 
> bit more? So do I need to use a custom made application(like control 
> pannel) to change the volume of the recorded file? This control 
> communicates directly with the filter driver which in turn 
> communicates with the USB audio control firmware which should change 
> the DAC out put amplification, is it that way? Also, is there any way 
> posible to be in the firmware framework alone, and change the volume, 
> without modifying or adding  the host driver part? Thanks to you a lot

> again.. Ajai ajaijames@xxxxxxxxx  "Jerry J. Trantow" wrote: You can 
> always write and install a filter driver which communicates to the 
> audio control. Then use DeviceIOControl from some type of control 
> panel to send messages to the driver which converts it to the 
> appropriate USB command.
>
> -----Original Message-----
> From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
> [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Ajai James
> Sent: Monday, September 23, 2002 1:54 PM
> To: wdmaudiodev@xxxxxxxxxxxxx
> Subject: [wdmaudiodev] Audio control for recording not possible???
>
>
> Hi friends,
> I am using an Ez USB board to prepare a demo audio project.I have a 
> requirement to increase the volume of my recorded wav file depending 
> on the buttons on my kit, ie vol up and down. The enumeration is ok 
> now, and the firmware keeps on pumping the hard coded sine tone values

> to the host.So, after selecting th enumerated board as a recording 
> device, I can record the sine tone. Now, i want to change the volume 
> of the sine tone using my boards f1, f2 push buttons. I thought I 
> could use the control end point with Vol up, vol down for that. But it

> does not seem to work. On going through microsoft documentation 
> ,http://www.microsoft.com/hwdev/tech/input/audctrl.asp
> it seems that audio controls are supported for play back only, not 
> recording.. Am i correct in this assumption? any way to implement this

> without using the audio controls
>
> Thanks a lot, for your kind suggestions and comments ...
> Ajai James
>
>
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
>
> ******************
>
> 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.de/
>
>
> ******************
>
> 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.de/
>
>
>
> ---------------------------------
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
>
> ******************
>
> 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.de/
>
> ******************
>
> 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.de/
>
>
>
> ******************
>
> 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.de/
>
>
> ******************
>
> 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.de/
>
>
>
> ******************
>
> 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.de/
>


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

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.de/

Other related posts: