:: best steam-link setup ::

-steam-link
-steam
-retroarch 1.7.4
-ubuntu 18.04
-udev rules (each controller)
-input group
-steam user input member
-retroarch configured for udev
-gamepad action set
-retroarch autoconfig

controllers
- 1x steam controller
- 1x ds3 (bt)


*.) steam-link controller pair
- steam controller, standrd process
- ds3, usb cable -> steam-link settings -> pair -> unplug -> use bt


*.) steam-link <-> steam streaming
- standard setup


*.) create an input group
# addgroup input


*.) add steam user to input group
# usermod -a G input 
- log steam user out and back in to pickup the change
- confirm the membership
$ groups


*.) udev rules
- steam controller
// create /etc/udev/rules.d/99-steam-controller-perms.rules
# Controller Access
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", GROUP="input",
MODE="0660"
KERNEL=="hidraw*", ATTRS{idVendor}=="28de", GROUP="input", MODE="0660"
# Joystick Emulation
KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"

- ds3
!!REQ?// create /etc/udev/rules.d/99-sixad.rules
DRIVER=="usb", SUBSYSTEM=="usb", ATTR{idVendor}=="054c", ATTR{idProduct}=="0268", RUN+="/usr/sbin/sixad-helper sixpair"
DRIVER=="usb", SUBSYSTEM=="usb", ATTR{idVendor}=="054c", ATTR{idProduct}=="05c4", RUN+="/usr/sbin/sixad-helper sixpair"
SUBSYSTEM=="input", ATTR{name}=="PLAYSTATION(R)3 Controller*",
RUN+="/usr/sbin/sixad-helper"


*.) install retroarch
- standard setup
-- https://launchpad.net/~libretro/+archive/ubuntu/stable


*.) configure retroarch to use udev
- edit $HOME/.config/retroarch/retroarch.cfg
input_driver = "udev"
input_joypad_driver = "udev"
video_fullscreen = "true"


*.) !!REQ? get autoconfig file (see below)
- save to $HOME/.config/retroarch/autoconfig/udev/xxxxxxxx.cfg


*.) configure steam desktop configuration
- connect steam-link
- using steam controller
-- options -> controller -> desktop configuration -> add action set as gamepad
- (optional) add action set as desktop
- export config to personal store
- using ds3
-- options -> controller -> desktop configuration -> import config
-- (if required) show configurations for other devices
-- apply configuration


*.) add retroarch shortcut to steam
- standard process for add non-steam game


*.) launch retroarch from shortcut
- (controllers should be detected as xbox360 dev 0/1)