• xboxdrv with lr-x1

    Help and Support
    2
    0 Votes
    2 Posts
    411 Views
    P

    could somebody help me with this example runcommand-onstart.sh script from the xboxdrv guide for retropie?

    for the following example script, i want to try using xboxdrv just for a certain rom, and if that rom doesn't match i don't want to launch/use xboxdrv. ex. in the fba) section below, what if i wanted to use xboxdrv if there is a match for one of the $rom cases, but do nothing if not? would i just delete these lines?:

    $xboxkill joycommand="$basicPS3 &" eval $joycommand ;; #!/bin/sh ## Uncomment one or all of the following if you need to find some information about the emulator or roms ## Name of the emulator #echo $1 >> /dev/shm/runcommand.log ## Name of the software used for running the emulation #echo $2 >> /dev/shm/runcommand.log ## Name of the rom #echo $3 >> /dev/shm/runcommand.log ##Executed command line #echo $4 >> /dev/shm/runcommand.log ### The FUN begins #Get ROM name striping full path rom="${3##*/}" ### Try to automatically find the correct event[•] of the connected controllers controller1=`cat /proc/bus/input/devices | egrep -i "js*" | sort | grep -o 'event[0-9]' | sed -n -e '1{p;q}'` controller2=`cat /proc/bus/input/devices | egrep -i "js*" | sort | grep -o 'event[0-9]' | sed -n -e '2{p;q}'` controller3=`cat /proc/bus/input/devices | egrep -i "js*" | sort | grep -o 'event[0-9]' | sed -n -e '3{p;q}'` controller4=`cat /proc/bus/input/devices | egrep -i "js*" | sort | grep -o 'event[0-9]' | sed -n -e '4{p;q}'` ### Set variables for your joypad and emulator ### Basic Configuraions - Standard controller mappings basicPS3="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >/dev/null \ --evdev /dev/input/$controller1 \ --silent \ --detach-kernel-driver \ --force-feedback \ --mimic-xpad \ --dpad-as-button \ --trigger-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RX=y2 \ --evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_BASE3=lt,BTN_BASE4=rt,BTN_TRIGGER=back,BTN_TOP=start,BTN_SOUTH=guide,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl --calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767" ### Extended Configurations ### Specific emulator configuration or any other parameters you will need only for some emulators scummVM="--axismap -Y1=Y1,-Y2=Y2 \ --ui-axismap x1=REL_X:10,y1=REL_Y:10 \ --ui-buttonmap a=BTN_LEFT,b=BTN_RIGHT,start=KEY_F5,back=KEY_ESC \ --ui-buttonmap guide=void,x=void,y=void,lb=void,rb=void,tl=void,tr=void,lt=void,rt=void,back=void \ --ui-axismap x2=void" amiga="--axismap -Y1=Y1,-Y2=Y2 \ --ui-axismap x2=REL_X:1,y2=REL_Y:1 \ --ui-axismap x1=KEY_LEFT:KEY_RIGHT,y1=KEY_DOWN:KEY_UP \ --ui-buttonmap du=KEY_UP,dd=KEY_DOWN,dl=KEY_LEFT,dr=KEY_RIGHT \ --ui-buttonmap lt=BTN_LEFT,rt=BTN_RIGHT,start=KEY_ESC,back=KEY_LEFTCTRL,y=KEY_SPACE,a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_LEFTSHIFT \ --ui-buttonmap guide=void,tl=void,lt=void,rt=void,back=void \ --ui-axismap x2=void" fourway="--four-way-restrictor" invert="--ui-buttonmap du=KEY_DOWN,dd=KEY_UP" ### Kill Command xboxkill="sudo killall >>/dev/shm/runcommand.log xboxdrv" ### Execute the driver with the configuration you need # $1 is the name of the emulation, not the name of the software used # it is intellivision not jzintv case $1 in mame-libretro) ;; fba) case $rom in "amidar.zip"|"atetris.zip"|"puckman.zip") # Configuration used only for these ROMs $xboxkill joycommand="$basicPS3 $fourway &" eval $joycommand ;; *) # Configuration for every other ROMs on this emulator $xboxkill joycommand="$basicPS3 &" eval $joycommand ;; esac ;; daphne) ;; scummvm) $xboxkill joycommand="$basicPS3 $scummVM &" eval $joycommand ;; amiga) $xboxkill joycommand="$basicPS3 $amiga &" eval $joycommand ;; intellivision) ;; esac
  • Xpad vs Xboxdrv

    Help and Support
    4
    0 Votes
    4 Posts
    2k Views
    mituM

    You can run xboxdrv only for the psp system, if that works for you. I think the Xboxdrv doc page has some examples on how to run it only on specific systems, by using the Runcommand's onstart/onend scripts.

  • 0 Votes
    1 Posts
    251 Views
    No one has replied
  • 0 Votes
    3 Posts
    471 Views
    retropieuser555R

    @mitu Ah I see! That makes a lot of sense. I've got it now thanks! Just need to figure out what buttons I've got and it's all dandy. Although I guess I also need to map some of them so I can still exit retroarch.

  • 0 Votes
    13 Posts
    2k Views
    D

    I have tried it with the simple configuration you suggest in /opt/retropie/configs/msx/retroarch.cfg and have not been successful. I have run different combinations and, after no luck, I have reintalled from scracth:

    Latest RetroPie 4.6
    Only SNES Compatible USB Controller
    Installed only xboxdrv and lr-bluemsx

    to reach the same situation in previous message. Briefly:

    pi@retropie:~ $ ls -alh /dev/input/by-id/ total 0 drwxr-xr-x 2 root root 80 Apr 29 21:26 . drwxr-xr-x 4 root root 200 Apr 29 21:26 .. lrwxrwxrwx 1 root root 9 Apr 29 21:26 usb-0810_usb_gamepad-event-joystick -> ../event0 lrwxrwxrwx 1 root root 6 Apr 29 21:26 usb-0810_usb_gamepad-joystick -> ../js0 pi@retropie:~ $ sudo cat /etc/rc.local if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-0810_usb_gamepad-event-joystick \ --silent \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --device-name "VIRTUAL-SNES2XBOX-CONTROLLER" \ --evdev-absmap ABS_X=dpad_x,ABS_Y=dpad_y \ --evdev-keymap BTN_THUMB=a,BTN_THUMB2=b,BTN_TRIGGER=x,BTN_WEST=y \ --evdev-keymap BTN_BASE3=back,BTN_BASE4=start \ --evdev-keymap BTN_TOP2=lb,BTN_PINKIE=rb \ --dpad-only \ --ui-axismap lt=void,rt=void \ --ui-buttonmap y=KEY_SPACE \ --ui-buttonmap lb=void,rb=KEY_0 \ & exit 0 pi@retropie:~ $ sudo cat /opt/retropie/configs/all/retroarch-joypads/VIRTUAL-SNES2XBOX-CONTROLLER.cfg input_device = "VIRTUAL-SNES2XBOX-CONTROLLER" input_driver = "udev" input_enable_hotkey_btn = "4" input_up_axis = "-1" input_left_axis = "-0" input_state_slot_decrease_axis = "-0" input_select_btn = "4" input_right_axis = "+0" input_state_slot_increase_axis = "+0" input_y_btn = "3" input_x_btn = "2" input_menu_toggle_btn = "2" input_down_axis = "+1" input_start_btn = "5" input_exit_emulator_btn = "5" input_b_btn = "1" input_reset_btn = "1" input_a_btn = "0" pi@retropie:~ $ cat /opt/retropie/configs/all/runcommand-onstart.sh pi@retropie:~ $ cat /opt/retropie/configs/all/runcommand-onend.sh cat: /opt/retropie/configs/all/runcommand-onend.sh: No such file or directory

    runcommand-onstart.sh is an empty file and runcommand-onend.sh does not exist

    pi@retropie:~ $ evtest No device specified, trying to scan all of /dev/input/event* Not running as root, no devices may be available. Available devices: /dev/input/event0: usb gamepad /dev/input/event1: VIRTUAL-SNES2XBOX-CONTROLLER - Keyboard Emulation /dev/input/event2: VIRTUAL-SNES2XBOX-CONTROLLER Select the device event number [0-2]: ^C

    Mind it is event2 that responds to SNES Compatible USB Controller (not event1) and mind controller configuration is set to global (all).

    pi@retropie:~ $ sudo cat /opt/retropie/configs/all/retroarch.cfg [...] input_player1_joypad_index = "1" input_player2_joypad_index = "0" input_player3_joypad_index = "2" input_player4_joypad_index = "3" [...]

    With the configuration above SNES Compatible USB Controller is usable in EmulationStation. When entering RetroPie > Retroarch (usable as well)...
    usb gampead configured in port #0
    VIRTUAL-SNES2XBOX-CONTROLLER configured in port #1

    Retroarch > Settings > Input >
    Port 1 Binds VIRTUAL-SNES2XBOX-CONTROLLER
    Port 2 Binds usb gamepad

    So the correlation between /opt/retropie/configs/all/retroarch.cfg and Port Binds is obvious.

    Entering MSX videogame...

    usb gampead configured in port #0
    VIRTUAL-SNES2XBOX-CONTROLLER configured in port #1

    Controller is irresponsive. However, Select+Start (exit emulator) works at least and I can return to EmulationStation. At this stage, I don't know what else to test...

    Many thanks in advance for your support all the way.

  • 0 Votes
    8 Posts
    604 Views
    retropieuser555R

    @mitu But haven't I already got that command in the code above at the beginning? After the path to xboxdrv?

  • 0 Votes
    11 Posts
    2k Views
    P

    @mitu Thanks to another thread of yours I have found the solution.
    https://retropie.org.uk/forum/topic/17492/retropie-4-4-and-tronsmart-mars-g02-with-wireless-dongle-problem

    The issue was that the controller by default comes recognized as a X mode (Xbox), I had to change it to D-mode (Android) by pressing 5 seconds the button home. After that joydev inmediately recognized it as Sharwan model.

    Once again, thaks a lot for your help.

  • 0 Votes
    1 Posts
    618 Views
    No one has replied
  • 1 Votes
    3 Posts
    453 Views
    M

    I used a teensy 3.2 with an xbox(ish) setup, the only difference being the r2 and l2 are buttons not analog triggers. This would also apply to the teensy LC which is similar.

    Here's a couple pics of the handheld I made, I'm just getting the controls working and all the emulators setup and having a blast!

    handheld1.jpg

    handheld2.jpg

  • 0 Votes
    31 Posts
    6k Views
    mituM

    @jerrymrivera Please don't bump old forum posts.
    Create a new topic and explain your problem, adding the relevant info about your setup, as explained in https://retropie.org.uk/forum/topic/3/read-this-first.

  • 0 Votes
    6 Posts
    547 Views
    A

    Could you tell me how to enable vibration in DInput? Or do I need to buy another gamepad? In what mode should it work for vibration to work?

  • 2 Votes
    1 Posts
    974 Views
    No one has replied
  • 0 Votes
    10 Posts
    995 Views
    HalvhjearneH

    @rogerdodger said in Configuring xboxdrv with Xin-Mo 2 player controller:

    Perhaps true 4 way controls can only be achieved mechanically, I have limited knowledge of Arcade stuff.

    i belive this is the only way ...

    as i suggested earlier, it is possible to physically switch from 4 to 8way by loosen the screw on the bottum, but if you want something that can switch automaticly i would suggest something like the ultimarc servostik perhaps, alltho those are quite a lot more expensive than the zippy joysticks (especially if you want 2).

  • 0 Votes
    12 Posts
    2k Views
    T

    @mitu Oh my bad, sorry. You can tell I'm a mega-noob because I have a default profile picture 😁

  • Retropie no longer supporting Jessie

    Help and Support
    5
    0 Votes
    5 Posts
    2k Views
    edmaul69E

    @Andrewpk200 if you use a crossover cable and hook your pi directly to your pc you can have everything transferred in no time.

  • 0 Votes
    4 Posts
    345 Views
    edmaul69E

    @MapleStory i have that stick and a different mayflash adapter. I will test them when i get home.

  • 0 Votes
    7 Posts
    574 Views
    D

    Starting to see a pattern actually that it only works if I run it from the remote ssh connection AFTER the game starts. Can't remember if that was always the case but perhaps I can add some delayed start to a script so that it runs in the bg after the rom loads.

  • 0 Votes
    5 Posts
    2k Views
    O

    @mitu Thanks.

    I will give this a try and report back tomorrow as it is getting late here.

  • 0 Votes
    1 Posts
    370 Views
    No one has replied