Two original xbox controllers
  • I can get one controller working all fine. Plug in the second and I can either get 1 working on none depending what I edit.

    I've tried adding the following to the /etc/rc.local file:

    xboxdrv --trigger-as-button --id 0 --led 2 --detach-kernel-driver --deadzone 4000 --silent & sleep 1
    xboxdrv --trigger-as-button --id 1 --led 3 --detach-kernel-driver --deadzone 4000 --silent & sleep 1

    I get two controllers loaded. PiMame then tries to load xboxdrv again (I'm assuming another script holds the xboxdrv command somewhere) and then I get Error couldn't claim the USB interface: LIBUSB_ERROR_BUSY
    Try to run 'rmmod xpad' and then xboxdrv again or start xboxdrv with the option --detach-kernel-driver.

    First - where should I be configuring the controllers? Is rc.local the correct place?
    Second - where is the xboxdrv loading from so I can stop it if not in the rc.local file?

    Cheers
    Bago
  • As for the second one, I think it is in /home/pi/.profile but I could be mistaken.
    That sort of answers your first one too... To run two programs at same time use this

    #!/bin/bash

    for cmd in "$@"; do {
    echo "Process \"$cmd\" started";
    $cmd & pid=$!
    PID_LIST+=" $pid";
    } done

    trap "kill $PID_LIST" SIGINT

    echo "Parallel processes have started";

    wait $PID_LIST

    echo
    echo "All processes have completed";


    Save it as
    runtwo.sh
    Make it executable
    chmod +x runtwo.sh
    and use like
    ./runtwo.sh "xboxdrv --trigger-as-button --id 0 --led 2 --detach-kernel-driver --deadzone 4000 --silent & sleep 1" "xboxdrv --trigger-as-button --id 1 --led 3 --detach-kernel-driver --deadzone 4000 --silent & sleep 1"


    Good luck and hope it works

    --
    Conno123009

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!