Skip to content

webos: wired DualSense on older TVs — haptics card match, gyro, mic and mute button - #329

Open
bibirobotics wants to merge 11 commits into
punktfunk:mainfrom
bibirobotics:main
Open

bibirobotics wants to merge 11 commits into
punktfunk:mainfrom
bibirobotics:main

Conversation

@bibirobotics

@bibirobotics bibirobotics commented Nov 24, 2026 •

Copy link
Copy Markdown

Tested on an LG C1 (OLED65C16LA, webOS 6.5, kernel 4.4.84) with a DualSense
behind a DS5Dongle (presents as a wired DualSense, 054c:0ce6), host
punktfunk 0.47.0 on Windows.

1. Haptics: match the pad's card when ALSA truncates its name

ALSA keeps a card's long name in 80 bytes; the C1's host controller name
pushes the USB path past it:

Sony Interactive Entertainment DualSense Wireless Controller at usb-generic-ehc

card_in wanted " at ," and failed, so haptics fell back to rumble.
Now a cut prefix of the path is accepted when exactly one card fits.
Result: pad audio: wired lanes on the pad's own card (hw:2,0).

2. Gyro: read it off hidraw when the kernel has no motion node

On this kernel a wired DualSense gets a single evdev node (js5 event12),
no "Motion Sensors" node, so rich=0 on the host. Over Bluetooth the TV
does create it. New hidraw_sensors: when no motion node exists, read
gyro/accel from USB input report 0x01 (bytes 16..27, raw report units, the
scale the host's virtual pad replays) and send RichInput::Motion, max one
per 2 ms, only on change. Every hidraw reader gets every report, so nothing
is taken from SDL.

3. Mic: capture the pad's mic on its own card

The webOS client had no mic uplink (mic=0 on the host). New pad_mic:
captures from the pad's card (plughw:N,0 mono, falling back to hw mono
or stereo), encodes with punktfunk_core::audio::mic::MicEncoder and sends
via send_mic. Only one pad feeds the uplink; skipped when the host does
not grant GRANT_MIC.

4. Mute button

Nothing on a Windows host acts on the DualSense mute button. The mic lane
now toggles its own mute on a press: frames stop going out, and the mute
LED and hardware mic mute are set through hidraw (output report 0x02,
valid_flag1 bits 0/1, mute LED and power-save bit 4). Unmuted on exit.

New code has unit tests; rustfmt and clippy pass with the project's lints.
All four verified on the C1.

Side note: pad audio: first coil frame ... — rendering as rumble is logged
even when the wired card owns the coils.

@bibirobotics bibirobotics changed the title webos: match a wired pad's audio card when ALSA truncates its name webos: wired DualSense on older TVs — haptics card match, gyro, mic and mute button Nov 24, 2026
@dyptan-io

Copy link
Copy Markdown
Collaborator

This looks promising! I will test it on my LG CX webOS 5. Hopefully it works there too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants