feat(Hardware Support): Add AYN Odin 3 - #659
Conversation
|
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 |
@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: |
|
Ah, I see, Xbox layout relies on north and west swapped |
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 |
no problems with volume keys when inputplumber is running, at least on phosh
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: and this config only matches |
| vendor_id: "0001" | ||
| product_id: "0001" |
There was a problem hiding this comment.
is there any reason to be specifying vendor_id and product_id here at all? This doesnt do anything in here
There was a problem hiding this comment.
These are generic VID/PID so they can be dropped
| vendor_id: "2020" | ||
| product_id: "3001" |
There was a problem hiding this comment.
kind of redundant with the devicetree but @pastaq or @ShadowApex should comment on that
There was a problem hiding this comment.
agree about this one and previous, it should be able to work without it, although keeping these makes it more explicit documenting expected vendor/product ids. i'm happy to remove it if maintainers prefer
There was a problem hiding this comment.
please retain any identifying information. It helps looking back historically.
| # 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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
basically:
- positioned north/west are correct for kernel - https://docs.kernel.org/input/gamepad.html
- swapped north/west are correct for userspace
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 |
are all of these devices upstream? we could patch dts
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, |
|
|
||
| # Kernel reports NORTH/WEST by physical position, but Xbox layout | ||
| # relies on these swapped. This results in NORTH/WEST swapped in | ||
| # evtest, but produces expected behaviour in games. |
There was a problem hiding this comment.
Can you attach a picture of the ABXY with these mappings labeled?
Co-authored-by: Radical <radical@radical.fun>


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
evtestseems to produce expected resultsIt 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.