Skip to content

Exception in on_session_created when windows sound is played after replugging output device #17654

@Danstiv

Description

@Danstiv

Steps to reproduce:

  1. Set the external device as default output device in windows settings, and also in the NVDA settings. Probably external sound card is needed for this.
  2. Set sound split mode to "NVDA in both channels and applications in both channels.
  3. Unplug default output device.
  4. Replug output device.
  5. Perform an action that causes windows sounds to play, for example, open the NVDA log, go to the end, and press right and down arrows several times.

Actual behavior:

NVDA error sound is played, and the following errors are logged:

ERROR - comtypes._comobject.call_without_this (17:39:25.579) - Dummy-11 (14888):
Exception in IAudioSessionNotification.OnSessionCreated implementation:
Traceback (most recent call last):
  File "comtypes\_comobject.pyc", line 176, in call_without_this
  File "pycaw\callbacks.pyc", line 53, in OnSessionCreated
  File "audio\utils.pyc", line 87, in on_session_created
  File "pycaw\utils.pyc", line 87, in ProcessId
_ctypes.COMError: (-2004287484, None, (None, None, None, 0, None))

Expected behavior:

No errors should occur.

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-35103,8ec1116d (2025.1.0.35103)

Windows version:

Windows 11 23H2 (AMD64) build 22631.4751

Name and version of other software in use when reproducing the issue:

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes

Metadata

Metadata

Assignees

Labels

bug/regressioncomponent/audioNVDA's audio output (nvWave, issues with usb audio etc).p3https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priorityrelease/blockingthis issue blocks the milestone releaserelease/blocking-betatriagedHas been triaged, issue is waiting for implementation.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions