User Tools

Site Tools


doc:appunti:software:usb_wireless_gamepad

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
doc:appunti:software:usb_wireless_gamepad [2021/02/12 09:01] – [Freccia destra e sinistra non funzionanti: problema asse X] niccolodoc:appunti:software:usb_wireless_gamepad [2021/02/13 08:32] niccolo
Line 1: Line 1:
 ====== Kodi con Gamepad Wireless USB ====== ====== Kodi con Gamepad Wireless USB ======
  
-Vogliamo utilizzare un **Gamepad** come telecomando per **Kodi** su **Raspberry Pi**, la distribuzione di riferimento è RaspiOS basata su **Debian 10 Buster**.+Vogliamo utilizzare questo **Gamepad** come telecomando per **Kodi** su **Raspberry Pi**, la distribuzione di riferimento è RaspiOS basata su **Debian 10 Buster**. Si tratta un controller **SNES wireless a 2.4 GHz** con micro ricevitore **USB** per PC, nella confezione è compreso anche un ricevitore per Nintendo. Il produttore si chiama **YSTEK** e il prodotto **MICREAL**, Linux lo supporta tramite il modulo kernel DragonRise **hid_dr**.
  
-Abbiamo acquistato un controller **SNES wireless a 2.4 GHz** con micro ricevitore **USB**. Sul bus viene riconosciuto come:+{{.:kodi:micreal-usb-gamepad.jpg?400|The Micreal USB Gamepad using DragonRise driver}} 
 + 
 +Viene riconosciuto dal comando **lsusb** come:
  
 <code> <code>
Line 44: Line 46:
  
 Ci sono dei problemi invece con un sistema **Raspberry Pi 4**, RaspiOS basato su **Debian 10.8** e **Kodi 18.7**: i tasti freccia **Left** e **Right** non funzionano. Ci sono dei problemi invece con un sistema **Raspberry Pi 4**, RaspiOS basato su **Debian 10.8** e **Kodi 18.7**: i tasti freccia **Left** e **Right** non funzionano.
 +
 +C'è chi ha riscontrato lo stesso problema utilizzando Retropie: **[[https://retropie.org.uk/forum/topic/25657/controler-issue-no-left-and-right-not-working-at-all/| Controler Issue (no left and right not working at all)]]**.
 +
 +==== Debug con input-events ed evtest ====
  
 Eseguendo il comando **lsinput** si vede che il gamepad è stato associato al device **event5**: Eseguendo il comando **lsinput** si vede che il gamepad è stato associato al device **event5**:
Line 154: Line 160:
 </file> </file>
  
-^ Sistema               ^ Kernel            ^ Funziona +==== Debug con usbmon ====
-| Raspberry Pi 3        | 4.19.66-v7+       | Yes       | +
-| Raspberry Pi 4        | 4.19....          | No        | +
-| PC amd64 Debian 10.8  | 4.9.189-3+deb9u2  | Yes       | +
-| PC amd64 Debian 10.8  | 4.19...           | No        | +
-| PC amd64 Debian 10.8  | 4.19...           | No        |+
  
 +In teoria dovrebbe essere possibile **ispezionare il traffico** direttamente sul bus USB utilizzando la funzione **usbmon** del kernel Linux. Seguendo le istruzioni **[[https://www.kernel.org/doc/Documentation/usb/usbmon.txt|usbmon]]**:
  
-C'è chi ha riscontrato lo stesso problema utilizzando Retropie: **[[https://retropie.org.uk/forum/topic/25657/controler-issue-no-left-and-right-not-working-at-all/| Controler Issue (no left and right not working at all)]]**.+<code> 
 +# Mount debugs, if not already mounted: 
 +mount -t debugfs none_debugs /sys/kernel/debug 
 +modprobe usbmon 
 +</code> 
 + 
 +quindi si chiede l'elenco di tutte le periferiche USB: 
 + 
 +<code> 
 +cat /sys/kernel/debug/usb/devices 
 +... 
 +T:  Bus=02 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  6 Spd=1.5  MxCh= 0 
 +D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 
 +P:  Vendor=0079 ProdID=0011 Rev= 3.11 
 +S:  Manufacturer=YSTEK 
 +S:  Product=MICREAL USB Gamepad 
 +C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA 
 +I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid 
 +E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms 
 +... 
 +</code> 
 + 
 +È possibile ispezionare il traffico di **tutti i bus** (utilizzando il numero **0**), oppure solo quello del **bus #2** 
 + 
 +<code> 
 +cat /sys/kernel/debug/usb/usbmon/2u 
 +</code> 
 + 
 +Nel caso del nostro gamepad **non si ottiene alcun tracciato**, mentre si vede il **passaggio dei pacchetti** quando si **muove un mouse** collegato allo stesso bus. 
 + 
 +==== Kernel funzionanti e kernel non funzionanti ==== 
 + 
 +^ Sistema               ^ Kernel             ^ Funziona 
 +| Raspberry Pi 3        | 4.19.66-v7+        | Yes       | 
 +| Raspberry Pi 4        | 5.10.11-v7l+       | No        | 
 +| PC amd64 Debian 10.8  | 4.9.189-3+deb9u2   | Yes       | 
 +| PC amd64 Debian 10.8  | 4.19.67-2+deb10u2  | Yes       | 
 +| PC amd64 Debian 10.8  | 4.19.98-1+deb10u1  | No        | 
 +| PC amd64 Debian 10.8  | 4.19.160-2         | No        | 
 + 
 +===== Web References ===== 
 + 
 +  * **[[https://www.retropie-italia.it/viewtopic.php?f=19&t=702|[GUIDA] DragonRise Inc. Generic USB Joystick]]** 
 +  * **[[https://retropie.org.uk/forum/topic/25657/controler-issue-no-left-and-right-not-working-at-all/|Controler Issue (no left and right not working at all)]]**
  
doc/appunti/software/usb_wireless_gamepad.txt · Last modified: 2021/02/13 08:33 by niccolo