Skip to content

feat(Hardware Support): Add AYN Odin 3 and other RSInput devices - #659

Merged
pastaq merged 5 commits into
ShadowBlip:mainfrom
jenneron:odin-3
Sep 3, 2026
Merged

feat(Hardware Support): Add AYN Odin 3 and other RSInput devices#659
pastaq merged 5 commits into
ShadowBlip:mainfrom
jenneron:odin-3

Conversation

@jenneron

@jenneron jenneron commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Adds support for AYN Odin 3.

This follows #627 to make use of this in postmarketOS: https://wiki.postmarketos.org/wiki/AYN_Odin_3_(ayn-odin-3). I haven't tested it in UI yet (since https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8979 is not merged), but evtest seems to produce expected results

It combines 2 input devices (gamepad + gpio-keys for paddles). It maps D-Pad, paddles and also maps back button to QuickAccess (please let me know whether it's a good choice).

Note that this device kernel support is not upstreamed yet, so if anything changes during upstreaming there would have to be a follow-up PR. pmOS uses ROCKNIX kernel patches, so we should be on the same page between different distributions.

@justradical

justradical commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Hi, this is missing this piece if its the rocknix DTBs, at least this is what we have in Armada. I'm working on upstreaming our devices as well https://github.com/justradical/InputPlumber/tree/armada-devices

  - name: West Button
    source_events:
      - evdev:
          event_type: KEY
          event_code: BTN_NORTH
          value_type: button
    target_event:
      gamepad:
        button: West

  - name: North Button
    source_events:
      - evdev:
          event_type: KEY
          event_code: BTN_WEST
          value_type: button
    target_event:
      gamepad:
        button: North

@jenneron

Copy link
Copy Markdown
Contributor Author

Hi, this is missing this piece if its the rocknix DTBs, at least this is what we have in Armada. I'm working on upstreaming our devices as well https://github.com/justradical/InputPlumber/tree/armada-devices

@justradical As far as I understand this is supposed to make physical Nintendo labels match Xbox ones? Please correct me if I'm wrong

In my opinion, we should match Xbox gamepad not by labels, but by key positions in order to fit Xbox ergonomics and muscle memory. If someone wants to match labels on their device they should swap physical buttons as this is what AYN advertises to do on their product page:

Product page picture image

@jenneron

Copy link
Copy Markdown
Contributor Author

Ah, I see, Xbox layout relies on north and west swapped

@justradical

Copy link
Copy Markdown
Contributor

Ah, I see, Xbox layout relies on north and west swapped

yes the north and west keys are incorrectly labelled

@jenneron

jenneron commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

yes the north and west keys are incorrectly labelled

i've pushed the change with Co-authored-by, so this is fixed

@justradical

Copy link
Copy Markdown
Contributor

yes the north and west keys are incorrectly labelled

i've pushed the chage with Co-authored-by, so this is fixed

also have you tested that volume keys work without the keyboard target? Volume up doesnt function on the retroid pocket 6 without also targeting keyboard as an output

@jenneron

Copy link
Copy Markdown
Contributor Author

also have you tested that volume keys work without the keyboard target? Volume up doesnt function on the retroid pocket 6 without also targeting keyboard as an output

no problems with volume keys when inputplumber is running, at least on phosh

Volume up doesnt function on the retroid pocket 6 without also targeting keyboard as an output

maybe volume up on this device shares gpio-keys DT node with gamepad keys?

it's not the case on odin 3, it has two separated gpio-keys nodes:

which results in:

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio-keys"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input2
U: Uniq=
H: Handlers=kbd event2 
B: PROP=0
B: EV=3
B: KEY=8000000000000 0

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio-keys-paddles"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys-paddles/input/input3
U: Uniq=
H: Handlers=event3 
B: PROP=0
B: EV=3
B: KEY=24000000000000 0 0 0 0

and this config only matches name: gpio-keys-paddles

Comment on lines +36 to +37
vendor_id: "0001"
product_id: "0001"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any reason to be specifying vendor_id and product_id here at all? This doesnt do anything in here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are generic VID/PID so they can be dropped

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dropped

Comment thread rootfs/usr/share/inputplumber/devices/50-ayn_odin3.yaml
Comment on lines +78 to +80
# Kernel reports NORTH/WEST by phisical position, but Xbox layout
# relies on these swapped. This results in NORTH/WEST swapped in
# evtest, but produces expected behaviour in games.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this note here is incorrect, it doesn't report by physical position, if it was by physical then the config wouldn't be needed, for some reason they arent for NORTH/WEST and have to be swapped in the config, SOUTH/EAST keys are correct, it might be a driver bug. but anyways, apart from this comment id say this lgtm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be a driver bug

if it's a driver bug i would rather fix kernel instead, but i think my comment is correct

it seems that for some historical reason all xbox gamepads have to be "wrong" for userspace apps to understand them. i tested it with my 8bitdo gamepad and north/west are swapped in evtest, meanwhile odin 3 reports it correctly. I honestly don't understand why

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange stuff..

@justradical

Copy link
Copy Markdown
Contributor

also have you tested that volume keys work without the keyboard target? Volume up doesnt function on the retroid pocket 6 without also targeting keyboard as an output

no problems with volume keys when inputplumber is running, at least on phosh

Volume up doesnt function on the retroid pocket 6 without also targeting keyboard as an output

maybe volume up on this device shares gpio-keys DT node with gamepad keys?

it's not the case on odin 3, it has two separated gpio-keys nodes:

* [ROCKNIX/distribution@`6166516`/projects/ROCKNIX/devices/SM8750/patches/linux/0046-arm64-dts-qcom-Add-AYN-CQ8725S-Common.patch#L118-L132](https://github.com/ROCKNIX/distribution/blob/6166516b9f5e6ae331eb98e9fce2f7349cb1422f/projects/ROCKNIX/devices/SM8750/patches/linux/0046-arm64-dts-qcom-Add-AYN-CQ8725S-Common.patch#L118-L132)

* [ROCKNIX/distribution@`6166516`/projects/ROCKNIX/devices/SM8750/patches/linux/0047-arm64-dts-qcom-Add-AYN-Odin3.patch#L363-L382](https://github.com/ROCKNIX/distribution/blob/6166516b9f5e6ae331eb98e9fce2f7349cb1422f/projects/ROCKNIX/devices/SM8750/patches/linux/0047-arm64-dts-qcom-Add-AYN-Odin3.patch#L363-L382)

which results in:

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio-keys"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input2
U: Uniq=
H: Handlers=kbd event2 
B: PROP=0
B: EV=3
B: KEY=8000000000000 0

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio-keys-paddles"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys-paddles/input/input3
U: Uniq=
H: Handlers=event3 
B: PROP=0
B: EV=3
B: KEY=24000000000000 0 0 0 0

and this config only matches name: gpio-keys-paddles

seeing varying results with other armada devs on this, odin 2 portal seemingly needs it, thor doesnt, retroid pocket 6 does. Maybe AYN fixed something in their devices between the odin 2 and 3/thor

@jenneron

Copy link
Copy Markdown
Contributor Author

seeing varying results with other armada devs on this, odin 2 portal seemingly needs it, thor doesnt, retroid pocket 6 does

are all of these devices upstream? we could patch dts

Maybe AYN fixed something in their devices between the odin 2 and 3/thor

this is really trivial to change in kernel, i can help with this if needed, but we need to have a good reason for it, "it's better for userspace" doesn't always work in kernel development. i think we should use "consistency" as the reason to do this

@justradical

Copy link
Copy Markdown
Contributor

seeing varying results with other armada devs on this, odin 2 portal seemingly needs it, thor doesnt, retroid pocket 6 does

are all of these devices upstream? we could patch dts

Maybe AYN fixed something in their devices between the odin 2 and 3/thor

this is really trivial to change in kernel, i can help with this if needed, but we need to have a good reason for it, "it's better for userspace" doesn't always work in kernel development. i think we should use "consistency" as the reason to do this

Not upstreamed afaik, we carry dts files and patches for them in our armada-packages repo, armada-packages/kernel/dts. On mobile now since its late so i cant send a link easily

Comment thread rootfs/usr/share/inputplumber/capability_maps/rsinput_type1.yaml
Comment thread rootfs/usr/share/inputplumber/devices/50-ayn_odin3.yaml
Co-authored-by: Radical <radical@radical.fun>
@jenneron

Copy link
Copy Markdown
Contributor Author

Renamed ayn_type2.yaml into rsinput_type1.yaml since it can be shared with non-AYN devices

@jenneron jenneron changed the title feat(Hardware Support): Add AYN Odin 3 feat(Hardware Support): Add AYN Odin 3 and other RSInput devices Aug 28, 2026
@jenneron

Copy link
Copy Markdown
Contributor Author

Added other RSInput devices by @justradical

Comment thread rootfs/usr/share/inputplumber/devices/50-retroid_pocket6.yaml
Comment thread rootfs/usr/share/inputplumber/devices/50-retroid_pocket_nova.yaml
Comment thread rootfs/usr/share/inputplumber/devices/50-ayn_odin2.yaml
@jenneron
jenneron requested a review from pastaq August 28, 2026 20:53

@pastaq pastaq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add missing keyboard targets per @justradical

Other than that, no issues.

@jenneron

Copy link
Copy Markdown
Contributor Author

Add missing keyboard targets per @justradical

I think those are just comments on changes, keyboard targets are in place

@justradical

Copy link
Copy Markdown
Contributor

Add missing keyboard targets per @justradical

I think those are just comments on changes, keyboard targets are in place

Yes, the comments just indicated where they are and why

@jenneron

Copy link
Copy Markdown
Contributor Author

added comments about keyboard target

@pastaq

pastaq commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

There is one more task that will make life easier in the future when troubleshooting. Currently there is no exclude/include list for any of these devices. Any events that are enabled on the source devices will show up as valid capabilities in the input tester and when probed over dbus.

Please go through each device on each composite device config and add an include/exclude list for the capability map that it uses. If all events are valid (gamepads for example) then no list is needed.

example:

events:
exclude:
- "*"
include:
- Keyboard:KeyF15
- Keyboard:KeyF16
- Keyboard:KeyG
- Keyboard:KeyLeftMeta
- Keyboard:KeyTab
- Keyboard:KeyVolumeDown
- Keyboard:KeyVolumeUp

@pastaq pastaq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just opened up issue #690 that makes my request impossible with the v2 maps, so we'll defer for now.

@pastaq
pastaq merged commit 880f512 into ShadowBlip:main Sep 3, 2026
3 checks passed
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.79.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants