-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
DS5 speaker initialization #9661
base: SDL2
Are you sure you want to change the base?
Conversation
This change needs a better log message than "initial commit," if you could change that. Run Does this bit just make the gamepad speaker start reporting itself as some sort of standard USB/Bluetooth audio device? And if so, does it take some time before the OS realizes it's available? |
The operating system is already aware about the audio device, but it won't play anything without this internal initialization. When you connect gamepad to PC with USB cable, the audio device appears there automatically. |
Gamepad reports itself as 4 channel audio device. First channel seems to be unsed, the second one is for said pad speaker. The rest of channels used for HD Rumble feature. |
In my commit I made sure to initialize audio speaker only. If you unset any of those bits, the pad stops playing any sound again. |
This screenshot may confuse a little, but I have two gamepads connected right now, so Windows reports two audio devices. |
It would be nice to have a way to identify gamepad's audio sources, it will simplify speaker useage, but I haven't found any good solution to this problem yet. |
Does this enable the headphone jack or is there some external speaker built into the controller? |
I think jack should be initialized by some of the audioEnableBits. I'm not sure, haven't tested it yet. But I do know there is possibility, to forward sound to both of them or to particular device (internal speaker, or headphones). |
But they def can't play the different audio at the same time since DualSense creates only one audio device. |
I have no 3.5 headphones on me, but I can connect my subwoofer and find out how gamepad's jack works, but it will take some time. And probably we should add some API to select the audio output in that case. |
ucAudioEnableBits values:
|
With no bits set happens the same thing as if any bit except 6th is set, so I think they all ignored and gamepad checks only 6th bit. So it's more like:
|
I tried to disconnect 3.5 from my gamepad every test too, just to see if there's a bit that controls hot plug. Well, I haven't found it. |
Probably a bit mask after all. Installed 6th and 5th bits and sound forwards to internal speaker only now. |
Configuration |
Description
This PR makes SDL2 initialize DualSense audio output when enhanced mode is set. Initialization bits are educated guesses based on DualSense behavior. Developer now can easily write audio data to gamepad speaker using
SDL_AUDIO
subsystem. Probably I need to add some checks for compatible gamepads, but I don't have that information.