haptics: recognize 'Wireless Controller' audio endpoint on Linux (#1046)

On Linux (PipeWire / ALSA), the 4-channel USB audio playback device for
the DualSense controller is named 'Wireless Controller' based on Sony's
USB product descriptor string. Previously, FindDevice() only matched
names containing 'DualSense', causing quad-channel endpoint discovery to
fail on Linux systems.

Add 'Wireless Controller' to the allowed endpoint names when 4 channels
are present, and add a test case verifying discovery under this name.
This commit is contained in:
Arthur Alves
2026-10-04 12:44:55 -03:00
committed by GitHub
parent 2984c41235
commit c885da0a3f
2 changed files with 14 additions and 2 deletions
+9 -1
View File
@@ -438,7 +438,15 @@ void TestDiscoveryAndHotplug() {
devices[0].channels = 4;
now += 2001;
Queue(port, pcm.data());
Check(streams.size() == 1 && opened_device == 10, "late USB connection was not discovered");
devices.clear();
now += 2001;
Queue(port, pcm.data());
Check(streams.empty(), "disconnected endpoint retained its stream");
devices = {{10, "Wireless Controller", 4}};
now += 2001;
Queue(port, pcm.data());
Check(streams.size() == 1 && opened_device == 10,
"Linux Wireless Controller endpoint was not discovered");
devices.clear();
now += 2001;
Queue(port, pcm.data());