Tuesday, January 9, 2018

HOWTO: Install PIUIO Drivers in Linux (uBuntu, Debian, Fedora and more)


Need to install on Windows instead? Click here: http://s34nvideo.blogspot.com/2016/10/installing-piuio-drivers-for-windows.html


If you're building an MK6/MK9 for Pump It Up, or, OpenITG for In The Groove, or, simply a Stepmania setup or both... You may have opted for using a PIUIO to communicate with your arcade cabinet. If running a distribution of Linux, then installing PIUIO is a very simple task.

Note: If you are running OpenITG, then it already includes support for PIUIO natively. You do not need to proceed with this tutorial. Skip to the end to learn how to run OpenITG with PIUIO.


Installing PIUIO on Linux
1. Download the PIUIO input driver for linux here: https://github.com/djpohly/piuio

2. Install gcc. This will also install binutils. Both are required to run 'make' without getting CONFIG_X86_X32 binutils support errors.
sudo apt-get install gcc

3. Extract the files, open the mod directory and run make, then make install. Please refer to the ReadMe for an updated and more detailed set of instructions for compiling and installing. Ensure the operation completed without errors before continuing.

NOTE: The PIUIO driver legacy branch creates a PIUIO proprietary device here: /dev/piuio0. However, the latest re-write of the driver connects to the Linux Event and LED interfaces. The driver now creates a /dev/input/eventX device. The latest revision on github is a Linux kernel module - It exposes the PIUIO input to the system as a generic joystick with a bunch of buttons. It's a much cleaner solution than the legacy branch, and it allows any program on the system to make use of the input! 

4. Connect your PIUIO to your computer via USB (The fake PCI slot on the PIUIO is merely to sit it in a desktop computer properly, it does not communicate with a PC via PCI in any way at all.). To power the PIUIO, it will need power via Molex cable. If using a laptop, then you can use an old PC ATX power supply to power the PIUIO board via the molex connector. You will need to jump a couple of pins in the ATX connector to start the power supply once it's plugged in (This acts like a power switch on a desktop computer to start the power supply! More info: http://www.instructables.com/id/How-to-power-up-an-ATX-Power-Supply-without-a-PC/).

5. You are now good to go!




[Troubleshooting PIUIO Installation in Linux]

Refer to the steps below if you are having trouble installing PIUIO on your system. This assumes you have downloaded the latest master branch from: https://github.com/djpohly/piuio

It also assumes you have already tried make && make install and the PIUIO driver is still not working.

The following steps have been tested within ubuntu. Refer to your linux distribution if the command names differ. The troubleshooting concepts however will remain the same.

1. Open a Terminal window.

2. Search for the PIUIO module
find /lib/modules -name 'piuio*'

The above command, assuming you have ran make && make install already, will show you where the module (piuio.ko) has been installed. If there is no output here, then there is an issue with the 'make install' step.

3. Run the following command:
modinfo piuio

This will tell you information about the PIUIO module.
If you receive an error such as: "ERROR: Module piuio not found.", then you will need to run the following command:
depmod

depmod creates a list of module dependencies, by reading each module under /lib/modules/version and determining what symbols it exports, and what symbols it needs. Hopefully the system will now be able to 'find' the PIUIO module.

Now try the following command again:
modinfo piuio

You should receive some output regarding the module (Author, module location, version licence etc). This means the module is now recognized by the system and where it needs to be.

4. Run the following command:
modprobe piuio

This will add the piuio module to the linux kernel. Stepmania 5 (and any other capable piece of software) will now be able to detect the PIUIO module!

5. Run the following command:
lsmod | grep piuio

This will confirm that piuio has been loaded into the linux kernel. It also shows the size of the module and the current usage count.



NOTE: If these steps all checkout for you, but you cannot get input to work in Stepmania, then don't forget to set your Key Config!!! ;)





Getting PIUIO to detect within Stepmania 5 or OpenITG
Click here to learn how to use PIUIO with Stepmania 5 / OpenITG.

No comments:

Post a Comment