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

  • From: "DJ Sisolak" <dsisolak@xxxxxxxxxxxxxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 24 Sep 2002 10:12:09 -0700

Unfortunately this approach will not work for a couple reasons. The
driver only checks the current value of the control once on device
initialization. This is done to reduce the number of hardware accesses
required which have a tendency to slow down the system. It is assumed
since USB Audio devices are not shared, that the driver would know the
current setting once the initial value is determined. Secondly, The USB
Audio driver does not generate control events, again for the reason that
the device is not shared and controls are usually done via HID which
sends the request up and audio controls (to the default renderer) are
sent back down through the driver. Therefore "mixerGetControlDetails"
will always return the last value as set by the system, not the device.

-----Original Message-----
From: Devendra Parakh [mailto:parakh@xxxxxxxxxxxxxxxxxxxx]=20
Sent: Tuesday, September 24, 2002 10:04 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: Audio control for recording not possible???

 Hi,

Here's a proposed work-around:

a. Let the firmware change the volume, and it's internal state with
regards
to the volume control unit, on the button presses.

b. Make sure that the GET_CUR request on the control returns the state
based
on these internal button presses.

c. Write a tiny application/service that does "mixerGetControlDetails"
(and
perhaps also a back-to-back "mixerSetControlDetails" with the retrieved
data)every 500 milliseconds (or whatever frequency is desired) on the
desiredcontrol. This should force usbaudio.sys to do a "GET_CUR" request
-
which will update it's state, and cause a notification to be sent to all
mixer clients (such as the MS Volume Control applet). Depending on how
usbaudio.sys maintains it's internal state, the mixerSetControlDetails
might
be necessary to force a notification.=20

DJ should be able to tell us if this will not work!

Thanks.

Devendra.



At 09:44 AM 9/24/2002, DJ Sisolak wrote:

Hello all. I'd like to add my interpretation to the mix here. I am D.J.
Sisolak, author of the USB Audio driver in Windows. It seems that the
problem is not that the mixer controls for recording volume does not
exist (they do), but that the device cannot receive the request to
change these levels from the device itself. This would be a case for a
HID interface IF the device was a rendering device. The problem with
using HID is that the HID controls are not associated directly with the
device they originate from. HID controls are always directed at the
default audio RENDERER. This was by design so we could support HID
volume controls on such things as keyboards and anything else which
might sport a HID control but no audio function. Thus the problem Ajai
is experiencing. The bad news is there really isn't any way (I know of)
around this short of writing a filter as Jerry suggests.


-----Original Message-----
From: Paul V Wysocki [mailto:pvw@xxxxxxxxxxxxxx]=3D20[1]
Sent: Tuesday, September 24, 2002 9:19 AM
To: wdmaudiodev@xxxxxxxxxxxxx
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[2]] 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[3]] 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[4]] 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. =3D20

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[5]] 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[6]] 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[7]
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[8]
Subscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dsubscribe[9]
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dunsubscribe[10]
Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx[11]

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/[12]


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

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx[13]
Subscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dsubscribe[14]
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dunsubscribe[15]
Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx[16]

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/[17]



---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC &Yahoo!

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

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx[18]
Subscribe:    =3D
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dsubscribe[19]
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dunsubscribe[20]
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx[21]

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/[22]

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

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx[23]
Subscribe:    =3D
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dsubscribe[24]
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dunsubscribe[25]
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx[26]

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/[27]



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

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx[28]
Subscribe:    =3D
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dsubscribe[29]
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dunsubscribe[30]
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx[31]

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/[32]


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

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx[33]
Subscribe:    =3D
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dsubscribe[34]
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dunsubscribe[35]
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx[36]

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/[37]



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

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx[38]
Subscribe:    =3D
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dsubscribe[39]
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3D3Dunsubscribe[40]
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx[41]

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/[42]

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

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx[43]
Subscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3Dsubscribe[44]
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3Dunsubscribe[45]
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx[46]

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/[47]
Devendra Parakh Singing Electrons, Inc.
http://www.singingelectrons.com[48]
425-889-2478=20

--- Links ---
   1 mailto:pvw@xxxxxxxxxxxxxx%5D=3D20
   2 mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx
   3 mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx
   4 mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx
   5 mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx
   6 mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx
   7 http://www.microsoft.com/hwdev/tech/input/audctrl.asp
   8 mailto:wdmaudiodev@xxxxxxxxxxxxx
   9 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dsubscribe
  10 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dunsubscribe
  11 mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
  12 http://www.wdmaudiodev.de/
  13 mailto:wdmaudiodev@xxxxxxxxxxxxx
  14 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dsubscribe
  15 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dunsubscribe
  16 mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
  17 http://www.wdmaudiodev.de/
  18 mailto:wdmaudiodev@xxxxxxxxxxxxx
  19 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dsubscribe
  20 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dunsubscribe
  21 mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
  22 http://www.wdmaudiodev.de/
  23 mailto:wdmaudiodev@xxxxxxxxxxxxx
  24 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dsubscribe
  25 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dunsubscribe
  26 mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
  27 http://www.wdmaudiodev.de/
  28 mailto:wdmaudiodev@xxxxxxxxxxxxx
  29 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dsubscribe
  30 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dunsubscribe
  31 mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
  32 http://www.wdmaudiodev.de/
  33 mailto:wdmaudiodev@xxxxxxxxxxxxx
  34 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dsubscribe
  35 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dunsubscribe
  36 mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
  37 http://www.wdmaudiodev.de/
  38 mailto:wdmaudiodev@xxxxxxxxxxxxx
  39 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dsubscribe
  40 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3D3Dunsubscribe
  41 mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
  42 http://www.wdmaudiodev.de/
  43 mailto:wdmaudiodev@xxxxxxxxxxxxx
  44 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3Dsubscribe
  45 mailto:wdmaudiodev-request@xxxxxxxxxxxxx%3Fsubject=3Dunsubscribe
  46 mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
  47 http://www.wdmaudiodev.de/
  48 http://www.singingelectrons.com/
******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    =
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3Dsubscribe
Unsubscribe:
mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=3Dunsubscribe
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: