From 9d89a01d4c52d54ae3ae918376508bae6fe4238a Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Fri, 26 Jun 2026 17:37:19 -0300 Subject: [PATCH] soysauce: wire speaker amp in DT and fix joypad controls soysauce.dts: enable rockchip,use-ext-amplifier + spk-ctl-gpios on the codec (drives patch 0060), set hp_det to pull-none so insertion is seen, and bump the analog tuning 200 to 280. The Y3506 sticks only reach ~76% of the declared range at full deflection, so partial pushes never crossed the EmulationStation navigation threshold; the higher gain saturates the axis and keeps menu scrolling responsive (R36S/eeclone pots reach full range at 200, this is Y3506-specific). Joypad userspace mapping (the analog/button wiring was never broken in the kernel, the configs were): - es_input.cfg: add a GO-Super Gamepad entry modelled on r36s_Gamepad, using leftanalog/rightanalog so both sticks navigate the menu. The old auto-generated entry mapped them as joystick1/joystick2, and joystick2up is hardcoded to volume in ViewController, so the right stick changed volume and the left stick did nothing. - GO-Super Gamepad.cfg (RetroArch): the button indices were the RGB20S layout (select=12, start=13, dpad=8-11), which broke in-game Start, Select and the exit combo. Correct to the r36s layout (select=8, start=9, dpad=13-16, l3=11, r3=12, hotkey=8) and fix the vendor id. Co-Authored-By: Claude Opus 4.8 --- .../rockchip/rk3326-gameconsole-soysauce.dts | 46 +++++++++++++++---- .../gamepads/GO-Super Gamepad.cfg | 26 +++++------ .../config/common/es_input.cfg | 27 +++++++++++ 3 files changed, 77 insertions(+), 22 deletions(-) diff --git a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-soysauce.dts b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-soysauce.dts index 076f3a95bb..e4f647ea71 100644 --- a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-soysauce.dts +++ b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-soysauce.dts @@ -54,7 +54,7 @@ joypad: odroidgo3-joypad { /* All Y3506 (soysauce) boards we've seen use single-ADC + amux - * (amux-count=4, amux-channel-mapping=<3 2 0 1>) — that is the + * (amux-count=4, amux-channel-mapping=<3 2 0 1>), which is the * archr-singleadc-joypad driver's wire protocol. The previous * "archr-joypad" / "odroidgo3-joypad" compat strings bind to * the multi-ADC driver, which ignores the amux-* props and @@ -91,14 +91,24 @@ button-adc-fuzz = <32>; button-adc-flat = <32>; - abs_x-p-tuning = <200>; - abs_x-n-tuning = <200>; - abs_y-p-tuning = <200>; - abs_y-n-tuning = <200>; - abs_rx-p-tuning = <200>; - abs_rx-n-tuning = <200>; - abs_ry-p-tuning = <200>; - abs_ry-n-tuning = <200>; + /* + * The Y3506 analog sticks only swing to ~76% of the declared + * range at full deflection with the default 200 gain (measured + * ~1365 of 1800 via evtest), so partial pushes never cross the + * EmulationStation navigation threshold and menu scrolling needs + * several flicks per item. Bump the gain so full deflection + * saturates the axis; games keep all but the top few percent of + * travel. The R36S/eeclone pots reach full range at 200, this is + * a Y3506-specific calibration. + */ + abs_x-p-tuning = <280>; + abs_x-n-tuning = <280>; + abs_y-p-tuning = <280>; + abs_y-n-tuning = <280>; + abs_rx-p-tuning = <280>; + abs_rx-n-tuning = <280>; + abs_ry-p-tuning = <280>; + abs_ry-n-tuning = <280>; poll-interval = <10>; @@ -207,9 +217,27 @@ }; &rk817_codec { + /* + * The loudspeaker is not on the rk817 class-D SPKO output; it hangs off + * the analog headphone output through an external amp enabled by + * spk-ctl-gpios. Tell the codec driver to route the speaker path through + * the headphone DACs and toggle that GPIO (see the rk817 ext-amplifier + * patch) instead of driving the unused class-D. + */ + rockchip,use-ext-amplifier; spk-ctl-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; }; +/* + * The shared r3xs hp-det pin uses pcfg_pull_down, which on this board pins the + * headphone-detect line low forever (insertion is never seen). The stock R35S + * DTB leaves it at pcfg_pull_none and lets the jack circuit drive the level, so + * override the pull here for the Soysauce only. + */ +&hp_det { + rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; +}; + &pinctrl { btns { btn_pins_vol: btn-pins-vol { diff --git a/projects/ArchR/packages/emulators/libretro/retroarch/retroarch-joypads/gamepads/GO-Super Gamepad.cfg b/projects/ArchR/packages/emulators/libretro/retroarch/retroarch-joypads/gamepads/GO-Super Gamepad.cfg index d30e378aae..cd9a67fbfb 100644 --- a/projects/ArchR/packages/emulators/libretro/retroarch/retroarch-joypads/gamepads/GO-Super Gamepad.cfg +++ b/projects/ArchR/packages/emulators/libretro/retroarch/retroarch-joypads/gamepads/GO-Super Gamepad.cfg @@ -1,6 +1,6 @@ input_device = "GO-Super Gamepad" input_driver = "udev" -input_vendor_id = "484B" +input_vendor_id = "0000" input_product_id = "1100" input_b_btn = "0" @@ -12,16 +12,16 @@ input_r_btn = "5" input_l2_btn = "6" input_r2_btn = "7" -input_up_btn = "8" -input_down_btn = "9" -input_left_btn = "10" -input_right_btn = "11" +input_up_btn = "13" +input_down_btn = "14" +input_left_btn = "15" +input_right_btn = "16" -input_select_btn = "12" -input_start_btn = "13" +input_select_btn = "8" +input_start_btn = "9" -input_l3_btn = "14" -input_r3_btn = "15" +input_l3_btn = "11" +input_r3_btn = "12" input_l_x_plus_axis = "+0" input_l_x_minus_axis = "-0" @@ -35,16 +35,16 @@ input_r_y_minus_axis = "-3" # Hotkeys -input_enable_hotkey_btn = "12" -input_exit_emulator_btn = "13" +input_enable_hotkey_btn = "8" +input_exit_emulator_btn = "9" input_screenshot_btn = "0" input_pause_toggle_btn = "1" input_menu_toggle_btn = "2" input_fps_toggle_btn = "3" -input_state_slot_increase_btn = "8" -input_state_slot_decrease_btn = "9" +input_state_slot_increase_btn = "13" +input_state_slot_decrease_btn = "14" input_load_state_btn = "4" input_save_state_btn = "5" diff --git a/projects/ArchR/packages/ui/emulationstation/config/common/es_input.cfg b/projects/ArchR/packages/ui/emulationstation/config/common/es_input.cfg index cfc53b23fa..9c2e8d1973 100644 --- a/projects/ArchR/packages/ui/emulationstation/config/common/es_input.cfg +++ b/projects/ArchR/packages/ui/emulationstation/config/common/es_input.cfg @@ -1705,6 +1705,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +