Hi @AndreMiras, this is @mltony, developer of NVDA screenreader.
I was trying to make use of your awesome pycaw library for one more purpose: in NVDA we would like to speak when microphone is muted/unmuted. I was trying to register a MMNotificationClient - but whenever it receives a notification it actually crashes the entire Python app - without any python stacktrace in the log. Basically I have an empty MMNotificationClient implementation without even any methods overloaded, I register it in DeviceEnumerator, and every time I adjust volume or mute microphone, it just quietly crashes NVDA. I only have a dump file created, which I'm not sure what to do with.
I tried examples\notification_client_example.py from pycaw and it works beautifully when executed as a standalone python script. So my thinking is that there must be some difference in how NVDA handles COM calls vs how pycaw expects them to be handled that causes segmentation fault or access violation.
Do you have any suggestions how to debug this further? I am not familiar with Com protocol, so not sure how to proceed.
One thought I had in mind is regarding MTA. I read in callbacks.py in the comment for class AudioSessionNotification that MTA needs to be enabled in order for it to work. I actually didn't have to enable MTA at all for AudioSessionNotification, and it still works - which makes me think that NVDA must be enabling it somewhere else, although I couldn't find this line
sys.coinit_flags = 0
anywhere in NVDA. So wondering if any specific setting for MTA is required in order to make MMNotificationClient to work?
Do you have any other ideas how can I debug this further?
FWIW here is my NVDA branch that crashesNVDA - relevant files are source\audio\notifications.py and def initialize in source\audio\__init__.py
Any suggestions would be appreciated. Thanks!
P.S. We have recently integrated pycaw into NVDA and it works beautifully - and it will be included in the next release for adjusting left/right channel volume of applications.
Hi @AndreMiras, this is @mltony, developer of NVDA screenreader. I was trying to make use of your awesome pycaw library for one more purpose: in NVDA we would like to speak when microphone is muted/unmuted. I was trying to register a
MMNotificationClient
- but whenever it receives a notification it actually crashes the entire Python app - without any python stacktrace in the log. Basically I have an emptyMMNotificationClient
implementation without even any methods overloaded, I register it in DeviceEnumerator, and every time I adjust volume or mute microphone, it just quietly crashes NVDA. I only have a dump file created, which I'm not sure what to do with. I triedexamples\notification_client_example.py
from pycaw and it works beautifully when executed as a standalone python script. So my thinking is that there must be some difference in how NVDA handles COM calls vs how pycaw expects them to be handled that causes segmentation fault or access violation. Do you have any suggestions how to debug this further? I am not familiar with Com protocol, so not sure how to proceed. One thought I had in mind is regarding MTA. I read incallbacks.py
in the comment forclass AudioSessionNotification
that MTA needs to be enabled in order for it to work. I actually didn't have to enable MTA at all forAudioSessionNotification
, and it still works - which makes me think that NVDA must be enabling it somewhere else, although I couldn't find this lineanywhere in NVDA. So wondering if any specific setting for MTA is required in order to make
MMNotificationClient
to work? Do you have any other ideas how can I debug this further? FWIW here is my NVDA branch that crashesNVDA - relevant files aresource\audio\notifications.py
anddef initialize
insource\audio\__init__.py
Any suggestions would be appreciated. Thanks! P.S. We have recently integrated pycaw into NVDA and it works beautifully - and it will be included in the next release for adjusting left/right channel volume of applications.