[wdmaudiodev] Re: KSEVENT_CONTROL_CHANGE Questions

  • From: "Richard Fricks" <Richard.Fricks@xxxxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Fri, 10 Mar 2006 13:06:53 -0800

The SB16 sample in the DDK contains a volume control implementation
using KSEVENT_CONTROL_CHANGE. Have you looked at that to see how it is
implemented?

 

-Rich

 

-----Original Message-----
From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Sam Tertzakian
Sent: Friday, March 10, 2006 12:46 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] KSEVENT_CONTROL_CHANGE Questions

 

Hi, 

 

I am trying to implement KSEVENT_CONTROL_CHANGE in my AVStream Audio
driver but I am unsure about a couple of things:

 

Is this how I should set the event in an AVStream driver?

 

      KSE_NODE Node;

 

      Node.Event.Set    = KSEVENTSETID_AudioControlChange;

      Node.Event.Id     = KSEVENT_CONTROL_CHANGE;

      Node.Event.Flags  = KSEVENT_TYPE_ENABLE | KSEVENT_TYPE_ONESHOT;

      Node.NodeId       = NODE_REN_VOL; /* node id */

      Node.Reserved     = 0;

 

      KsPinGenerateEvents(

            pPin,

            &KSEVENTSETID_AudioControlChange,

            KSEVENT_CONTROL_CHANGE,

            sizeof( Node ),

            &Node,

            NULL,

            NULL

      );

 

This is how I have defined the event:

 

DEFINE_KSEVENT_TABLE( EventsAudioControlChange )

{

      // Volume Event Happened

      //

    DEFINE_KSEVENT_ITEM

    (

        KSEVENT_CONTROL_CHANGE,     // Id

            sizeof( KSE_NODE ),     // DataInput

            0,                      // ExtraEntryData

            NULL,                   // AddHandler

            NULL,                   // RemoveHandler

            NULL                    // SupportHandler

    )

};

 

// Table of all Event sets supported by the pins.

//

DEFINE_KSEVENT_SET_TABLE( AudioPinEventSets )

{

    DEFINE_KSEVENT_SET

    ( 

      &KSEVENTSETID_AudioControlChange,               // Event Set GUID

      SIZEOF_ARRAY(EventsAudioControlChange),         // EventsCount

      EventsAudioControlChange                        // EventItem

    ),

};

 

And I added AudioPinEventSets to the PinAutomation member of the Pin
descriptor.

 

I have other events created by the driver and they work properly, but
this event does not seem to be doing anything. 

 

I tried attaching it both to filter and pin.

 

One of the problems is that I think that if the wave device is not open,
then the pin is not instantiated. So, even the above code is proper (to
set the event), the pin won't actually exist if the device is not open,
so the volume control slider will not change.

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Mitchell Rundle
Sent: Thursday, March 09, 2006 4:53 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

The volume node that you are controlling needs to support
KSEVENT_CONTROL_CHANGE.

 

Regards,

Mitch Rundle

Microsoft

 

This posting is provided "AS IS" with no warranties, and confers no
rights.

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Sam Tertzakian
Sent: Thursday, March 09, 2006 12:31 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

Hi, 

 

I have a device with a volume control. And I wrote a driver and service
for the device. (The service is necessary to fulfill some of the
requirements.)

Now, when the user changes the volume on the device, the service
actually ends up getting the volume setting on the device (not the
driver). What we want is for the service to change the volume in a way
that the Hardware Volume slider in the Windows UI changes to match the
volume on the device. (This should be a Device volume, not a per-Stream
Volume). 

 

Right now, the service is changing the volume in the driver by
communicating directly with the driver...That works. (But, the Volume
Slider in the UI does not change. That is the main problem.) 

 

The driver exports KsMethods to allow the Service to change the volume
in the Driver...but the UI does not seem to adjust the volume slider.

 

Perhaps the problem is that somehow the driver is not exporting the
volume control in a way that the slider changes.

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Frank Yerrace
Sent: Thursday, March 09, 2006 5:11 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

I'm sorry it's still not entirely clear to me what your scenario is.
Does your solution have some physical buttons, and are you trying to
write a sort-of daemon that responds to those buttons by changing the
main volume level? Are you writing a program that has a GUI with a
volume slider, and you want that slider to affect the main volume level?
Are you writing a control panel extension for Vista's Audio control
panel?

 

As Larry said, the wave and mixer APIs on Vista now affect only the
calling application rather than the main volume level. In general we
feel that there is rarely a need for software to affect the main volume
level. Instead, it is directly an end user function. If we can
understand your larger scenario hopefully we can give you better
guidance on how to achieve what you want to do.

 

Thanks!

 

Frank Yerrace

Technical Lead

Microsoft Corporation

 

This posting is provided "AS IS" with no warranties, and confers no
rights.

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Sam Tertzakian
Sent: Wednesday, March 08, 2006 9:10 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

Yes, the main volume UI to uses the Hardware Volume Control (we don't
see a problem there). 

 

For this reason, we are trying to access the Hardware Volume Control.
That is why we are trying use either Wave or Mixer APIs to access the
Hardware Volume Control. But, it seems that we cannot access that
control under Vista (only XP) using Mixer or Wave APIs.

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Frank Yerrace
Sent: Wednesday, March 08, 2006 6:27 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

Which user control are you talking about? The main volume UI in Vista
will already use your hardware volume control (unless there's a bug in
the way somewhere).

 

Frank Yerrace

Technical Lead

Microsoft Corporation

 

This posting is provided "AS IS" with no warranties, and confers no
rights.

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Sam Tertzakian
Sent: Wednesday, March 08, 2006 6:24 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

My device has a volume control on it. When the user moves the control up
and down, we need the volume slider on the "Master Volume" to move up
and down.

 

How do you think I should do this?

 

I have not tried the Mixer API on the Feb CTP, so I don't' know if it
works...but, I did try waveOutSetVolume()...and for my driver (and for
the on-board audio device for which I did not write a driver) it seems
to not work. (But it does work under XP.)

 

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Larry Osterman
Sent: Wednesday, March 08, 2006 5:57 PM
To: 'wdmaudiodev@xxxxxxxxxxxxx'
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

Both waveOutSetVolume and the mixer APIs should be working on any recent
builds (with the caveat that Frank mentioned below: waveOutSetVolume
using IDs didn't work in all cases until recently).

 

If you attempt to set the capture volume using the mixer APIs, it won't
work (the API call should succeed, but the call will be ignored), the
bug fix for this didn't make the Feb CTP.

 

Please note that the wave and mixer volumes are plumbed to the
per-stream volume for render endpoints.

 

 

Larry Osterman 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Sam Tertzakian
Sent: Wednesday, March 08, 2006 5:42 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

I have tried both handles and ids....But, I just realized that I am
testing the Mixer API implementation on  build 5270 and not the latest
build. I know that both wave handles and device ids fail under the later
version of Vista. 

 

But, I am not sure about the mixer api under the lastest version of
Vista. I'll try it.

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Frank Yerrace
Sent: Wednesday, March 08, 2006 5:33 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

Are you using wave handles or wave IDs? Both will eventually work, but
wave IDs were not working until recent builds of Vista. You might not
have a build with this correction. I don't have the information at my
fingertips regarding when this was corrected.

 

Frank Yerrace

Technical Lead

Microsoft Corporation

 

This posting is provided "AS IS" with no warranties, and confers no
rights.

 

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Sam Tertzakian
Sent: Wednesday, March 08, 2006 5:08 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

Hi,

 

I wrote a bunch of code to set/get the volume using the Mixer API and it
works under XP with my driver...but the same code with same driver does
not work under Vista.

 

So, I cannot set the volume using the Wave API or the Mixer API under
Vista. Yet, when I change the volume using the control panel under
Vista, the messages do get to my driver.

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Sam Tertzakian
Sent: Wednesday, March 08, 2006 3:00 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

Hi, 

 

I wrote an audio driver that works under XP and Vista. It passes XP
WHQL. Under XP, when I call waveOutSetVolume() and waveOutGetVolume()
everything works. But, under Vista both those functions return
MMSYSERR_NOT_SUPPORTED.

 

Does anybody know why this would be? Is that API not supported anymore?
Do I have to do something different in my driver under Vista to make
this call work?

 

Under Vista the driver works very well...for example, when I change the
volume using MSN messenger that works. It is just the waveXxxGetVolume
and waveXxxSetVolume calls that fail.

 

________________________________

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Sam Tertzakian
Sent: Tuesday, March 07, 2006 9:37 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] waveOutSetVolume() under Vista returns
MMSYSERR_NOTSUPPORTED

 

Hi,

I am receving MMSYSERR_NOTSUPPORTED when I call waveOutSetVolume() under
Vista (latest CTP version). Under XP, the same code returns no error.

Is this API no longer supported under Vista?

Is there a new API for controlling the volume, or do we have to use the
MixerAPI?

Thank you

 

Other related posts: