8Bit Do Gamepad

I am trying to get an 8Bit Do Gamepad working with FreeBSD, I am used both hgame and xb360gp and the controller gets detected.
However, when I use it, none of the input gets detected. I don't know how to give it access to the /dev/input variables or test the input.
Can someone help me out?
 
The first thing I would do is to install the latest firmware on the gamepad and on any dongle if you use one, see also Thread 87212. If the appropriate driver hgame(4) has attached successfully, then there should be an associated /dev/input/eventX. A quick and dirty test to see if it's working at all is to cat(1) it as root, i.e. # cat /dev/input/eventX. In this way you don't have to deal with permissions in order to see if it works. When you press buttons and push the sticks etc. you should see gibberish on the terminal. If that's the case then it's working in general.

In order to make it also accessible for your normal user, you have to set the right owner or permission on /dev/input/eventX, i.e. chmod 666 /dev/input/eventX or put your user in an appropriate group. I think the Thread 84464 answers any further questions.
 
For an arcade joystick I have I needed to create a devd(8) config for it.

/usr/local/etc/devd/dashine.conf
Code:
notify 100 {
  match "system"        "USB";
  match "subsystem"     "INTERFACE";
  match "type"          "ATTACH";
  match "vendor"        "0x045e";
  match "product"       "0x028e";
  action "chgrp operator /dev/$cdev; chmod 660 /dev/$cdev";
};
You need to do something similar for your joystick, find out what the 'vendor' and 'product' needs to be, use usbconfig(8). I've set write permissions to the 'operator' group and my user is a member of that group.
 
The first thing I would do is to install the latest firmware on the gamepad and on any dongle if you use one, see also Thread 87212. If the appropriate driver hgame(4) has attached successfully, then there should be an associated /dev/input/eventX. A quick and dirty test to see if it's working at all is to cat(1) it as root, i.e. # cat /dev/input/eventX. In this way you don't have to deal with permissions in order to see if it works. When you press buttons and push the sticks etc. you should see gibberish on the terminal. If that's the case then it's working in general.

In order to make it also accessible for your normal user, you have to set the right owner or permission on /dev/input/eventX, i.e. chmod 666 /dev/input/eventX or put your user in an appropriate group. I think the Thread 84464 answers any further questions.
I checked all the /dev/input/events but none are working. The driver looks like its loaded but I don't think its actually working.
Do you know if there is anything I am doing wrong here?

#usbconfig
ugen0.3: <8BitDo Ultimate C 2.4G Wireless Controller> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)

# kldstat
Id Refs Address Size Name
1 120 0xffffffff80200000 1d345b0 kernel
2 1 0xffffffff845b4000 3390 acpi_wmi.ko
3 1 0xffffffff845b8000 93260 if_iwlwifi.ko
4 1 0xffffffff8464c000 3220 intpm.ko
5 1 0xffffffff84650000 2178 smbus.ko
6 1 0xffffffff84653000 4d20 ng_ubt.ko
7 3 0xffffffff84658000 abb8 netgraph.ko
8 2 0xffffffff84663000 a250 ng_hci.ko
9 2 0xffffffff8466e000 2670 ng_bluetooth.ko
16 1 0xffffffff84687000 4364 ums.ko
17 1 0xffffffff8468c000 3360 wmt.ko
18 1 0xffffffff84800000 502958 amdgpu.ko
19 2 0xffffffff84690000 7c050 drm.ko
20 1 0xffffffff8470d000 22b8 iic.ko
21 3 0xffffffff84710000 3080 linuxkpi_hdmi.ko
22 3 0xffffffff84714000 6350 dmabuf.ko
23 3 0xffffffff8471b000 3378 lindebugfs.ko
24 1 0xffffffff8471f000 b360 ttm.ko
25 1 0xffffffff8472b000 39950 amdgpu_sienna_cichlid_sos_bin.ko
26 1 0xffffffff84765000 567e0 amdgpu_sienna_cichlid_ta_bin.ko
27 1 0xffffffff847bc000 3e748 amdgpu_sienna_cichlid_smc_bin.ko
28 1 0xffffffff84d03000 1d958 amdgpu_sienna_cichlid_dmcub_bin.ko
29 1 0xffffffff84d21000 425e0 amdgpu_sienna_cichlid_pfp_bin.ko
30 1 0xffffffff84d64000 425e0 amdgpu_sienna_cichlid_me_bin.ko
31 1 0xffffffff84da7000 42560 amdgpu_sienna_cichlid_ce_bin.ko
32 1 0xffffffff84dea000 22840 amdgpu_sienna_cichlid_rlc_bin.ko
33 1 0xffffffff84e0d000 43a90 amdgpu_sienna_cichlid_mec_bin.ko
34 1 0xffffffff84e51000 43a90 amdgpu_sienna_cichlid_mec2_bin.ko
35 1 0xffffffff84e95000 a5e0 amdgpu_sienna_cichlid_sdma_bin.ko
36 1 0xffffffff84ea0000 8f8d0 amdgpu_sienna_cichlid_vcn_bin.ko
37 1 0xffffffff84671000 3360 uhid.ko
38 1 0xffffffff84675000 33c0 usbhid.ko
39 4 0xffffffff84679000 3380 hidbus.ko
42 1 0xffffffff8467d000 2240 xb360gp.ko
43 2 0xffffffff84680000 30a8 hidmap.ko
44 1 0xffffffff84684000 21e8 hgame.ko
 
I checked all the /dev/input/events but none are working. The driver looks like its loaded but I don't think its actually working.
Do you know if there is anything I am doing wrong here?

Are you connecting the gamepad wireless or plugged in via USB cable? First trying it wired rules out any problems with the wireless connection shenanigans.

Have you tried updating the firmware of the gamepad and the dongle (if you use one)? This can definitly help with the FreeBSD compatibility, as I experienced with my SN30 Pro.

In which controllor mode are you starting the gamepad? According to the techspecs it supports X-Input and D-Input mode. Using it in D-Input mode definitly increases your chances for it to work and that's also the mode I'm using. Right now I don't know if it can also work in X-Input mode, need to test with my own gamepad.

Can you show your dmesg(8) output after you connect your gamepad?
 
Are you connecting the gamepad wireless or plugged in via USB cable? First trying it wired rules out any problems with the wireless connection shenanigans.

Have you tried updating the firmware of the gamepad and the dongle (if you use one)? This can definitly help with the FreeBSD compatibility, as I experienced with my SN30 Pro.

In which controllor mode are you starting the gamepad? According to the techspecs it supports X-Input and D-Input mode. Using it in D-Input mode definitly increases your chances for it to work and that's also the mode I'm using. Right now I don't know if it can also work in X-Input mode, need to test with my own gamepad.

Can you show your dmesg(8) output after you connect your gamepad?
I checked and I am on the latest firmware, its connect through its own USB receiver dongle. How do I setup D-input?

Dmsg below:
Mar 8 09:11:04 Server-FreeBSD kernel: uhid0 on uhub3
Mar 8 09:11:04 Server-FreeBSD kernel: uhid0: <8BitDo Ultimate C 2.4G Wireless Controller, rev 2.00/1.14, addr 2> on usbus0
Mar 8 09:11:04 Server-FreeBSD kernel: uhid1 on uhub3
 
I checked and I am on the latest firmware, its connect through its own USB receiver dongle.
You can plug in the gamepad via an USB cable directly, or not? It should work wired and we should probably first establish that it works wired before we tackle the wireless connection. From my own experience I can tell that it makes a difference if you connect it directly with an USB cable or try to use it wireless with the USB reciever dongle.

How do I setup D-input?
It should be mentioned in the instruction manual. For my SN30 Pro I have to press B + Start when activating the gamepad. Changing the mode only works when the pad is unplugged in my case, i.e. I have to unplug the gamepad and press Start for a few seconds to deactivate the pad, then I can press B+Start to activate it again in D-Input mode.

Dmsg below:
Mar 8 09:11:04 Server-FreeBSD kernel: uhid0 on uhub3
Mar 8 09:11:04 Server-FreeBSD kernel: uhid0: <8BitDo Ultimate C 2.4G Wireless Controller, rev 2.00/1.14, addr 2> on usbus0
Mar 8 09:11:04 Server-FreeBSD kernel: uhid1 on uhub3
Is this all? No mention of hgame(4)? Then there's something not working and the driver module is not attaching successfully.
 
You can plug in the gamepad via an USB cable directly, or not? It should work wired and we should probably first establish that it works wired before we tackle the wireless connection. From my own experience I can tell that it makes a difference if you connect it directly with an USB cable or try to use it wireless with the USB reciever dongle.


It should be mentioned in the instruction manual. For my SN30 Pro I have to press B + Start when activating the gamepad. Changing the mode only works when the pad is unplugged in my case, i.e. I have to unplug the gamepad and press Start for a few seconds to deactivate the pad, then I can press B+Start to activate it again in D-Input mode.


Is this all? No mention of hgame(4)? Then there's something not working and the driver module is not attaching successfully.
The D-Input for the control ended up working, I can see input being picked up in antimircoX. But other apps don't pick it up, do I need to remap the inputs for it to work?
 
The D-Input for the control ended up working, I can see input being picked up in antimircoX.
This is really great to hear! Nice it works now ?

But other apps don't pick it up, do I need to remap the inputs for it to work?
This can be different from program to program. If the program in question uses the SDL gamepad API then it should pick up the mapping you did with antimicrox(1) as long as you have antimicrox running. AFAIK it create the environmental variable SDL_GAMECONTROLLERCONFIG containing your mapping and programs aware of it just read it out. But these programs should also have an option to do this mapping itself and not require antimicrox to run. If the program isn't using SDL then you probably need to remap the inputs in the program itself. What program are you trying?
 
This is really great to hear! Nice it works now ?


This can be different from program to program. If the program in question uses the SDL gamepad API then it should pick up the mapping you did with antimicrox(1) as long as you have antimicrox running. AFAIK it create the environmental variable SDL_GAMECONTROLLERCONFIG containing your mapping and programs aware of it just read it out. But these programs should also have an option to do this mapping itself and not require antimicrox to run. If the program isn't using SDL then you probably need to remap the inputs in the program itself. What program are you trying?
Thanks for the help at least I got it work now. I just tried some emulators and it's fine. Wanted to try steam and wine too, not sure if I need to do anything extra.
 
The proper way would be to rebuild SDL with the HIDAPI option. Make sure your apps can access the corresponding usb device. Also there is no bluetooth support. (Custom dongles should work because they are "wired" devices from the operating system's point of view.)
 
I haven't used my gamepad with emulators/wine yet. Sorry I don't know if gamepads can actually work with wine and steam.

In Wine it depends on how these are recognized.

Most of my controllers are recognized as PS4 or Xbox controllers, but I also have an 8-bit example that uses the correct vendor name and is therefore not taken by any game that does not support custom mapping.

Something like "Unknown Device: 8Bit-do Wireless controller"
 
Back
Top