Fri, 07 Oct 2016 15:08:37 -0700Applied Ubuntu patch bug_822210_fix_sdl2-config.cmake_whitespace.patch
Sam Lantinga [Fri, 07 Oct 2016 15:08:37 -0700] rev 10474
Applied Ubuntu patch bug_822210_fix_sdl2-config.cmake_whitespace.patch

Fri, 07 Oct 2016 15:13:46 -0400audio: Don't trust audio drivers to drain pending audio.
Ryan C. Gordon [Fri, 07 Oct 2016 15:13:46 -0400] rev 10473
audio: Don't trust audio drivers to drain pending audio.

This tends to be a frequent spot where drivers hang, and the waits were
often unreliable in any case.

Instead, our audio thread now alerts the driver that we're done streaming audio
(which currently XAudio2 uses to alert the system not to warn about the
impending underflow) and then SDL_Delay()'s for a duration that's reasonable
to drain the DMA buffers before closing the device.

Fri, 07 Oct 2016 14:42:24 -0400audio: better way to calculate buffer drain wait times.
Ryan C. Gordon [Fri, 07 Oct 2016 14:42:24 -0400] rev 10472
audio: better way to calculate buffer drain wait times.

Fri, 07 Oct 2016 14:35:25 -0400audio: threading and device hang improvements.
Ryan C. Gordon [Fri, 07 Oct 2016 14:35:25 -0400] rev 10471
audio: threading and device hang improvements.

This tries to make SDL robust against device drivers that have hung up,
apps don't freeze in catastrophic (but not necessarily uncommon) conditions.

Now we detach the audio thread and let it clean up and don't care if it
never actually runs to completion.

Fri, 07 Oct 2016 11:18:55 -0700Some systems include both "default:" and "hw:" for the same usb device
Sam Lantinga [Fri, 07 Oct 2016 11:18:55 -0700] rev 10470
Some systems include both "default:" and "hw:" for the same usb device

Thu, 06 Oct 2016 06:08:16 -0700fix for finding ALSA hotplug devices on Steam Link
Sam Lantinga [Thu, 06 Oct 2016 06:08:16 -0700] rev 10469
fix for finding ALSA hotplug devices on Steam Link

James Zipperer

The device names show up as "default:", not "hw:"

Wed, 05 Oct 2016 00:12:16 -0700Backed out a very unsafe change that was trying to prevent audio hang at quit.
Sam Lantinga [Wed, 05 Oct 2016 00:12:16 -0700] rev 10468
Backed out a very unsafe change that was trying to prevent audio hang at quit.

Ryan and I have ideas on a better way to handle this.

Tue, 04 Oct 2016 06:48:07 -0700ensure SDL_AUDIODEVICEREMOVED gets sent when hotplug removes a device
Sam Lantinga [Tue, 04 Oct 2016 06:48:07 -0700] rev 10467
ensure SDL_AUDIODEVICEREMOVED gets sent when hotplug removes a device

James Zipperer

The problem I was seeing was that the the ALSA hotplug thread would call SDL_RemoveAudioDevice, but my application code was not seeing an SDL_AUDIODEVICEREMOVED event to go along with it. To fix it, I added some code into SDL_RemoveAudioDevice to call SDL_OpenedAudioDeviceDisconnected on the corresponding open audio device. There didn't appear to be a way to cross reference the handle that SDL_RemoveAudioDevice gets and the SDL_AudioDevice pointer that SDL_OpenedAudioDeviceDisconnected needs, so I ended up adding a void *handle field to struct SDL_AudioDevice so that I could do the cross reference.

Is there some other way beside adding a void *handle field to the struct to get the proper information for SDL_OpenedAudioDeviceDisconnected?

Tue, 04 Oct 2016 06:46:46 -0700fix deadlock on close device
Sam Lantinga [Tue, 04 Oct 2016 06:46:46 -0700] rev 10466
fix deadlock on close device

James Zipperer

snd_pcm_drain doesn't always drain when you unplug a usb device. Use snd_pcm_drop instead

Tue, 04 Oct 2016 06:45:28 -0700fix audio deadlock
Sam Lantinga [Tue, 04 Oct 2016 06:45:28 -0700] rev 10465
fix audio deadlock

James Zipperer

Close the audio device before waiting for the audio thread to complete, which fixes a situation where the audio thread never completes

Add an additional check in the audio thread to see if the device is enabled and bail out if the device is no longer enabled