ynsta / steamcontroller

Standalone Steam Controller Driver
MIT License
818 stars 59 forks source link

No error message when /dev/uinput is not writeable #13

Open stapelberg opened 8 years ago

stapelberg commented 8 years ago

On my Debian testing machine, the default permissions of /dev/uinput are:

$ ls -hl /dev/uinput 
crw------- 1 root root 10, 223 2015-12-27 12:31 /dev/uinput

When starting sc-xbox.py, I don’t see an error message, but no new SDL joysticks appear either.

Changing the permissions of /dev/uinput made this work.

Could you add proper error handling so that other users have an easier time getting this working please? Also, I think the instructions in README.md should be updated to include the steps to properly change the permissions of /dev/uinput.

ynsta commented 8 years ago

Hello,

The message should be logged in your system logger, as the tool is a daemon.

If you want a message in console run it in debug mode (this information could be added to the readme).

The readme already gives instruction for uinput permissions (points 4 and 5) your user must be in game group.

Regards,

stapelberg commented 8 years ago

The message should be logged in your system logger, as the tool is a daemon.

For /dev/uinput being unaccessible, no message is being logged to syslog on my machine.

When I don’t have the steam controller attached when running sc-xbox.py start, I see the following in syslog:

Jan 04 22:53:43 x1 sc-xbox.py[11518]: sc-xbox.py: started
Jan 04 22:53:43 x1 sc-xbox.py[11518]: sc-xbox.py: SteamControler Device not found
Jan 04 22:53:45 x1 sc-xbox.py[11518]: sc-xbox.py: SteamControler Device not found
Jan 04 22:53:46 x1 sc-xbox.py[11523]: sc-xbox.py: stopped

When I plug in the steam controller, but lack permissions on /dev/bus/usb/… when running sc-xbox.py start, I see the following in syslog:

Jan 04 22:54:48 x1 sc-xbox.py[11607]: sc-xbox.py: started
Jan 04 22:54:48 x1 sc-xbox.py[11607]: sc-xbox.py: LIBUSB_ERROR_ACCESS [-3]
Jan 04 22:54:50 x1 sc-xbox.py[11607]: sc-xbox.py: LIBUSB_ERROR_ACCESS [-3]
Jan 04 22:54:52 x1 sc-xbox.py[11607]: sc-xbox.py: LIBUSB_ERROR_ACCESS [-3]
Jan 04 22:54:54 x1 sc-xbox.py[11607]: sc-xbox.py: LIBUSB_ERROR_ACCESS [-3]
Jan 04 22:54:55 x1 sc-xbox.py[11609]: sc-xbox.py: stopped

When I plug in the steam controller and have correct permissions on /dev/bus/usb/… but incorrect permissions on /dev/uinput when running sc-xbox.py start, I see the following in syslog:

Jan 04 22:55:14 x1 sc-xbox.py[11635]: sc-xbox.py: started
Jan 04 22:55:23 x1 sc-xbox.py[12065]: sc-xbox.py: stopped

So, I think the original bugreport still stands: an error message is missing.

I’d also suggest to do one run of the initialization before daemonizing. That way, you can display the output on stdout for the interactive use-case, and also have it in syslog for the daemon use-case. This will make your software much nicer for users to set up.