Repository navigation
webos: wired DualSense on older TVs — haptics card match, gyro, mic and mute button - #329
Open
bibirobotics wants to merge 11 commits into
Open
bibirobotics wants to merge 11 commits into
bibirobotics wants to merge 11 commits into
Conversation
On an LG C1 (webOS 6, kernel 4.4) the DualSense card's long name is cut at
ALSA's 80 bytes ("... at usb-generic-ehc"), so the exact " at <path>," match
failed and haptics fell back to rumble. Accept a truncated path prefix when
exactly one card fits.
Collaborator
|
This looks promising! I will test it on my LG CX webOS 5. Hopefully it works there too! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
card_inwanted " 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=0on the host. Over Bluetooth the TVdoes create it. New
hidraw_sensors: when no motion node exists, readgyro/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 oneper 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=0on the host). Newpad_mic:captures from the pad's card (
plughw:N,0mono, falling back tohwmonoor stereo), encodes with
punktfunk_core::audio::mic::MicEncoderand sendsvia
send_mic. Only one pad feeds the uplink; skipped when the host doesnot 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 rumbleis loggedeven when the wired card owns the coils.