2

I have a program (advancemame) running on Raspian (Raspberry Pi) which like most programs gets its input from the keyboard. I'm using a program which implements uinput to convert GPIO pins HI/LOW readings to key presses (pikeyd). I run pikeyd in the background from the terminal, which has a GPIO pin mapped to key 5. I set the corresponding GPIO to HI, it prints out "5" to the terminal.

However, when I run advancemame, it doesn't recognize the uinput. If I unplug the keyboard and reboot, then advancemame sees uinput and everything works. From what it looks like is the program will read the first input device, input0 (keyboard). Is there a way to make uinput input0? That is, set the order of the input devices

$ ls /sys/class/input/
  event0  event1  event2  input0  input1  input2  mice  mouse0  mouse1

$ ls /sys/devices/virtual/input/input2/
  capabilities  event2  id  modalias  mouse1  name  phys  power  properties  subsystem  event  uniq

I'm not sure if there is a setting in advancemame that will look at all input devices. I have 3 images I built from scratch, 1 of the 3 images works where advancemame sees all the input devices. I can use my uinput and the keyboard at the sometime. I've compared config settings between the images and can't seem to find why one works and the others don't. I am wondering if it may be a security permission.

Also, is there a way to disable event0 and event1? I am not using X11, so xinput is not an option.

EDIT

Here are my input devices:

pi@raspberrypi ~ $ cat /proc/bus/input/devices
I: Bus=0003 Vendor=0d62 Product=0500 Version=0100
N: Name="2.4G Wireless Keyboard with Touchpad"
P: Phys=usb-bcm2708_usb-1.2/input0
S: Sysfs=/devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input0
U: Uniq=
H: Handlers=sysrq kbd event0 
B: PROP=0
B: EV=120013
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7

I: Bus=0003 Vendor=0d62 Product=0500 Version=0100
N: Name="2.4G Wireless Keyboard with Touchpad"
P: Phys=usb-bcm2708_usb-1.2/input1
S: Sysfs=/devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.1/input/input1
U: Uniq=
H: Handlers=kbd mouse0 event1 
B: PROP=0
B: EV=1f
B: KEY=4837fff 72ff32d bf544446 0 0 1f0001 20f90 8b17c000 677bfa d9415fed 9ed680 4400 0 10000002
B: REL=143
B: ABS=7f01 0
B: MSC=10

I: Bus=0003 Vendor=0001 Product=0001 Version=0001
N: Name="uinput-sample"
P: Phys=
S: Sysfs=/devices/virtual/input/input2
U: Uniq=
H: Handlers=sysrq kbd mouse1 rfkill event2 
B: PROP=0
B: EV=100007
B: KEY=10000 ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe
B: REL=3

Any help is appreciated.

9
  • I would be surprised if advancedmame haven't an option to use a given input device, and creating a symbolic link from /proc/bus/input/ should be easy. That said, from the few I've read it support different input drivers, event support multiple keyboards, isn't this the driver you're using? doc-advdev
    – Alex
    May 13, 2014 at 15:55
  • I agree that advancemame should have this option, but it wont recognizes the virtual keyboard if a "real" keyboard is plugged in. As for the event, how can I check?
    – PhillyNJ
    May 13, 2014 at 15:59
  • I've downloaded sources of 1.2 is that your version? Not sure I'm looking in the right file (keydrv.c) but I see a function log_std used here and there keyb: select driver %s, do you have an advancedmame log or could you enable it? (could you add the content of /proc/bus/input/handlers when it work and when it doesn't?)
    – Alex
    May 13, 2014 at 16:04
  • Please /proc/bus/input/devices too
    – Alex
    May 13, 2014 at 16:11
  • @Alex its event2 and version of advancemame is 0.106.1
    – PhillyNJ
    May 13, 2014 at 16:19

1 Answer 1

0
+100

Turned out the problem was running advancemame with sudo and not as a regular user pi, we didn't investigate why.

2
  • Thanks again. Good news is I did find the issue. If was a config setting in advmame. When run as sudo, it used the config file in /root/.advance/advmame.rc, when run as pi it used /home/pi/.advance/advance.rc. When I copied the .rc to the /root/.advance it worked. Like I said, thanks of the chat, it helped me trouble shoot the issue!
    – PhillyNJ
    May 13, 2014 at 17:38
  • 1
    Glad it helped, have fun! :)
    – Alex
    May 13, 2014 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.