[wdmaudiodev] Re: [EXTERNAL] Re: RegisterControlChangeNotify doesn't work when MMDevice is obtained through GetDevice call

  • From: "Edward Abramian" <edwabr123@xxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Mon, 9 Mar 2020 16:47:56 -0700

Will do.

 

GetId will return upper case if you used it in GetDevice call. All calls
return S_OK but OnNotify is never called in case of upper case as I already
mentioned.

 

--

Edward

 

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Matthew van Eerde
(Redacted sender "Matthew.van.Eerde" for DMARC)
Sent: Monday, March 9, 2020 4:19 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: [EXTERNAL] Re: RegisterControlChangeNotify
doesn't work when MMDevice is obtained through GetDevice call

 

Can you report this bug in Feedback Hub and send me a link?

 

https://matthewvaneerde.wordpress.com/2016/09/26/report-problems-with-logs-a
nd-suggest-features-with-the-feedback-hub/

 

Does IMMDevice::GetId return an ID which works?

 

From: Edward Abramian <mailto:edwabr123@xxxxxxxxx
Sent: Monday, March 9, 2020 4:15 PM
To: wdmaudiodev@xxxxxxxxxxxxx <mailto:wdmaudiodev@xxxxxxxxxxxxx
Subject: [EXTERNAL] [wdmaudiodev] Re: RegisterControlChangeNotify doesn't
work when MMDevice is obtained through GetDevice call

 

I found the root cause of this issue. IAudioEndpointVolumeCallback::OnNotify
is only called when the endpoint's id is in lowercase. If you call GetDevice
on endpoint id in upper case and then subsequently
RegisterControlChangeNotify, OnNotify  won't get called, although
GetMasterVolumeLevel works perfectly fine. Weird and seems to be a bug.

 

From: Edward Abramian [mailto:edwabr123@xxxxxxxxx] ;
Sent: Monday, March 9, 2020 10:40 AM
To: wdmaudiodev@xxxxxxxxxxxxx <mailto:wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] RegisterControlChangeNotify doesn't work when
MMDevice is obtained through GetDevice call

 

I started off Microsoft's example on how to use IAudioEndpointVolume (see
the link below). It worked perfectly fine until I replaced
GetDefaultAudioEndpoint with GetDevice called on the same endpoint. After
that, IAudioEndpointVolumeCallback::OnNotify is never called when I change
system level. Is there something I am missing here? The below is the only
change to the sample code:

 

  hr = pEnumerator->GetDefaultAudioEndpoint(eRender, eConsole, &pDevice);

  EXIT_ON_ERROR(hr)

  wchar_t* epID;

  pDevice->GetId(&epID);

  SAFE_RELEASE(pDevice);

  hr = pEnumerator->GetDevice(epID, &pDevice);

  CoTaskMemFree(epID);

  EXIT_ON_ERROR(hr)

 

 
<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.micr
osoft.com%2Fen-us%2Fwindows%2Fwin32%2Fcoreaudio%2Fendpoint-volume-controls&d
ata=02%7C01%7CMatthew.van.Eerde%40microsoft.com%7C75611649ba1f4bb6470308d7c4
7fce19%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637193925525073950&sdata
=kBmj%2B1XsYRN7n%2BQ%2B6%2FBTD9O6nOVwGNUh2su1%2FhCl97A%3D&reserved=0>
https://docs.microsoft.com/en-us/windows/win32/coreaudio/endpoint-volume-con
trols

 

Thanks,

Edward

 

Other related posts: