-
-
Notifications
You must be signed in to change notification settings - Fork 18
Wii U: Support For Seperate Gamepad and TV Audio Devices #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: wiiu-sdl2-2.28
Are you sure you want to change the base?
Wii U: Support For Seperate Gamepad and TV Audio Devices #116
Conversation
Fixes libsdl-org#10675 (cherry picked from commit d501f6d)
This reverts commit f23cc95. This edit was incorrect.
Fixes libsdl-org#10711 (cherry picked from commit a0f36fb)
(cherry picked from commit dfe6efc)
…t driver (cherry picked from commit 6d7c211)
…oaded We make sure we initialize XInput first, so that anything checking whether it's enabled gets a valid result based on whether we were able to load it or not. (cherry picked from commit 8f46cb7)
On most Unix platforms supported by SDL, the canonical name used to load a library at runtime includes its ABI major version, and the name without a version is not guaranteed to exist on non-developer systems. libX11-xcb.so.1 is correct on Linux, and probably on other Unix platforms like FreeBSD. A notable exception is OpenBSD, which apparently does not use ABI-suffixed names, so continue to use libX11-xcb.so there. Signed-off-by: Simon McVittie <[email protected]> (cherry picked from commit 7713a7e)
Clients may rely on this event to signal when they should redraw themselves, so send it when appropriate.
This used a tiny stack, which apparently upsets Blender for various technical reasons. Instead, just use the default stack size, which should give it plenty of space to work. If the thread failed to create, we would then wait on a semaphore that would never trigger, so don't do that anymore! Fixes libsdl-org#10806. (cherry-picked from commit b7dc30c)
(cherry picked from commit ee37779)
(cherry picked from commit 0548050)
From libtool development commit 1638a6407573b74517b57a0f6e596918344a4394
(cherry picked from commit 594edb6)
Fixes a compilation issue due to the GAMES partition of WinAPI not including GetMessageTime
Backport of fd2b9c0 to SDL2
Modern kernels (v5.8+) allow non-root usage of drmDropMaster(), so we can hold on to our fd after dropping master on it. This fixes populating drm_fd in the KMSDRM SysWMinfo when using Vulkan. Also add a missing error check for open() while we're here.
UpdateDevice() can be called at an arbitrary rate, so we need to pace ourselves to avoid filling up the rumble queue with these. (cherry picked from commit 6ec8b1a)
This didn't properly take into account destination alpha. Fixes libsdl-org#8401 (cherry picked from commit 1aea438)
Suppose host has some three-finger gesture. Then we get the following sequence of events: DOWN-DOWN-DOWN-MOTION-CANCEL Note that there is no UP in this sequence. So if we don't handle CANCEL then we end up thinking that fingers are still touching the screen. Ideally we should inform the application that cancel has happened as not to trigger spurious taps but still this is way better than being stuck with phantom finger touch.
[skip ci]
…t specify it" This reverts commit 120b8d4. The issue this was patching over in Vanilla-Conquer was the lack of an exposure event when showing a window, which has since been remedied. Attaching EGL window objects can also cause protocol violations now that the explicit sync protocol is in use, if SDL creates one and then the client tries to attach one itself, so they really shouldn't be created unless the client specifically requested it.
They were inadvertently byteswapped when making the rest of the backend bigendian-friendly. Fixes libsdl-org#11031.
This fixes having a black background while the HBM is active.
According to the changes in d59caff: > [...] SDL has the concept of a NULL mutex, so the mutex functions have been changed not to report errors if a mutex hasn't been initialized. > We do have mutexes that might be accessed when they are NULL, notably in the event system, so this is an important change.
The build has been broken after [this change](devkitPro/wut@c4368c7).
wiiu/render: Only free inactive render data wiiu/render: Call `GX2DrawDone` when destroying render targets
GX2SetSwapInterval absolutely *does* cause the CPU to wait for V-sync: if I set it to 2, then software runs at half speed compared to 1.
This is for the same reason as devkitPro@2a6c2ca, but the last commit didn't add the check for points and lines
…se events. (devkitPro#92) * Added SDL_Window to touch events, so they can mapped to mouse events. --HG-- branch : finger-window-hg * Added an extra check, in case there's no video device. --HG-- branch : finger-window-hg * Update src/joystick/wiiu/SDL_wiiujoystick.c Co-authored-by: GaryOderNichts <[email protected]> --------- Co-authored-by: Daniel K. O. (dkosmari) <none@none> Co-authored-by: GaryOderNichts <[email protected]>
According to https://www.x.org/docs/AMD/old/R6xx_R7xx_3D.pdf in section 1.3 (page 6), GX2 supports textures of up to 8192x8192 resolution.
When possible, use the DMA to copy the whole texture data at once, this improves performance by nearly 15x in the best case. In all other cases, use OSBlockMove instead of the base memcpy implementation for a ~1.5x speedup in the slowest path.
* Implemented FOREGROUND/BACKGROUND events. * - Only send foreground events if handleProcUI is true. - Ensure window hidden event is sent when handleProcUI is false. * Refactored the enteringBackground condition for clarity. * Fixed typo. --------- Co-authored-by: Daniel K. O. (dkosmari) <none@none>
Co-authored-by: Wohlstand <[email protected]>
* Clean up ProcUI on exit. * Don't process ProcUI messages in PumpEvents after it entered EXIT/shutdown state. --------- Co-authored-by: Daniel K. O. (dkosmari) <none@none>
AX initialization needs to be done on CPU1, otherwise interrupts won't be handled properly. Previously this was attmpted to be done using `OSSetThreadAffinity` to change the affinity of the current thread. Unfortunately `OSSetThreadAffinity` does not work when called for the currently running thread. This caused issues when an SDL audio device was opened from a thread not running on CPU1. This commit now creates a new thread running on CPU1 for AX initialization, and joins it before moving on.
This makes it possible to present TV/DRC-only windows without swapping the scanbuffers and thus preventing a v-sync.
GaryOderNichts
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Hmm, this code seems somewhat fragile at the moment.
Closing a single audio device will uninitialize AX, even if other devices are still running. wiiuDevices is also not updated when closing a device, causing potential issues in the frame callback.
Ideally it should be possible to close and reopen audio devices. I think separating the AX initialization from opening and closing audio devices might be a good idea.
|
So with this commit AX will only deinitialize if its the last audio device being closed. |
GaryOderNichts
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better now. There is still an issue if the first initialized device is closed before the last initialized device though.
| } | ||
|
|
||
| static void WIIUAUDIO_CloseDevice(_THIS) { | ||
| if (AXIsInit()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably make AX (de-)initialization completely independent from opening and closing devices, by moving it into WIIUAUDIO_Init and the Deinitialize callback.
| SDL_AddAudioDevice(SDL_FALSE, SDL_AUDIO_DEVICE_WIIU_MIRRORED, &spec, &mirrorHandle); | ||
| SDL_AddAudioDevice(SDL_FALSE, SDL_AUDIO_DEVICE_WIIU_TV, &spec, &tvHandle); | ||
| SDL_AddAudioDevice(SDL_FALSE, SDL_AUDIO_DEVICE_WIIU_GAMEPAD, &spec, &drcHandle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "handles" here are supposed to be unique identifiers/pointers which can be retried using device->handle. In this case you could do something similar to the SNDIO driver, and use your device IDs here:
SDL/src/audio/sndio/SDL_sndioaudio.c
Lines 324 to 328 in 8289656
| static void SNDIO_DetectDevices(SDL_AudioDevice **default_playback, SDL_AudioDevice **default_recording) | |
| { | |
| *default_playback = SDL_AddAudioDevice(false, DEFAULT_PLAYBACK_DEVNAME, NULL, (void *)0x1); | |
| *default_recording = SDL_AddAudioDevice(true, DEFAULT_RECORDING_DEVNAME, NULL, (void *)0x2); | |
| } |
Then you can check this handle in
WIIUAUDIO_OpenDevice and avoid comparing against the device name.
Co-authored-by: Daniel K. O. (dkosmari) <none@none>
…tPro#107) * Wii U / Video: Fixed resume of video afrer the home menu close This bug happens just when V-Sync is off and attempting to open and close the home menu. To fix the black/frozen screen it's just enough to call the `GX2SetSwapInterval(0);` right after entering the foreground back. * Move out of handleProcUI cond and tweaked comment
* Implemented swkbd on the Wii U. * Let clang format it. * - Cleaned up code. - No more replacement of global new/delete operators; use strings with custom allocators instead. - Don't rely on C locale API, let the user control the locale explicitly. - A few more customization functions. - Properly documented all functions. - Added enums. - Input feeding from VPAD and KPAD is now public. * - Added events to differentiate before and after all text is received. - Added function to manually disable the swkbd. * Don't reset swkbd window to null until it's fully hidden. * - Added `-lstdc++` as a dependency, because the swkbd API is C++. - Added missing include `<new>`. - Don't copy the user-supplied `nn::swkbd::AppearArg`. * Removed duplicated name. * Link libstdc++ before libwut. * Fixed inconsistent indentation. * Removed dependency on libstdc++. * Removed emacs local variables. * Renamed SDL_wiiu_swkbd.* to SDL_wiiuswkbd.* * Removed CreateArg and AppearArg API. * Clean up swkbd from WIIU_VideoQuit(). * Forgot to remove attribute. * The default swkbd layout works for all languages. --------- Co-authored-by: Daniel K. O. (dkosmari) <none@none>
874da16 to
398f949
Compare
This PR adds in support for separate Gamepad and TV SDL Devices while retaining support for mirroring the audio on both at the same time.
These audio devices can be created as follows:
When setting up SDL_Audio and creating an audio device, if not specified, the audio device will default to
SDL_AUDIO_DEVICE_WIIU_MIRRORED.sorry for the second PR, had to fix some git stuff