Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: (Windows) Kernel crash after audio device unplugged  (Read 3347 times)

0 Members and 1 Guest are viewing this topic.

HughPH

  • Newbie
  • *
  • Posts: 13
    • View Profile
(Windows) Kernel crash after audio device unplugged
« on: August 12, 2017, 02:05:00 pm »
So I have a USB audio decoder attached to my PC. I use it when nobody else is in the room watching TV or similar. Typically I will unplug it when my noises would be disturbing others, and switch to my earphones. In pretty-much everything, this works. Except when I'm using SFML.

When I unplug the device, I immediately get this message:
"AL lib: (EE) MMDevApiProc: Failed to get padding: 0x88890004"

Some time later (seems to be a few seconds after I try to play a previously unplayed sound) my code crashes and I get this during a call to window.DispatchEvents:

Exception thrown at 0x00007FFC06F679A3 (KernelBase.dll) in GameCore.exe: 0xC0000005: Access violation reading location 0x0000000000000004.

So... how can I:
- Detect the removal of a device (or, preferably, detect the change of default device - I'd like it to work when I plug the USB amplifier in, too)
- Pause all sounds
- Change devices (reset audio, whatever is required)
- Resume all sounds

Any suggestions gratefully received!

Many thanks

HughPH

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: (Windows) Kernel crash after audio device unplugged
« Reply #1 on: August 22, 2017, 01:58:15 am »
Anything at all?

Should I switch to something else for audio?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: (Windows) Kernel crash after audio device unplugged
« Reply #2 on: August 22, 2017, 01:29:34 pm »
See the pretty much same discussion we just had in this thread.

tl;dr Unplugging devices while in use isn't really supported by SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

HughPH

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: (Windows) Kernel crash after audio device unplugged
« Reply #3 on: August 22, 2017, 04:33:26 pm »
Thanks eXpl0it3r I'll check out the discussion.

Unplugging devices is something I do and I imagine others will do the same, so I might look for an alternative.

 

anything