Mayflash N64 Adapter Support?


#1

Hello all. I purchased the following adapter to play N64 games on my ODROID XU4 with Lakka.

However, this adapter does not work correctly out of the box. The deadzone is huge, and there is no way I can find to adjust the range/peak.

This is the result: you have to move the joystick 30% of the way to get any response, and no matter how far you move it, you can never reach full speed. This means you are stuck walking in every game you try.

On PC, you can adjust settings (in Project 64, for example) to accommodate this bizarre default setting. But I have no idea how to fix it in Lakka!

Please help!

Alternatively: what solutions have you all found to play 4-player N64 games on Lakka?


#2

The next nightly build will include jscal so you can calibrate your joystick.

For 4-players, you can check core options (Player X Pak) and controls (User X Device Type, User X Analog To Digital Type) via the quick menu.


#3

Is there no way to install and use jscal without this nightly build update?


#4

You will need latest new nightly build.


#5

gouchi, thanks for all your help with this.

I got the latest nightly build. How do I use the jscal tool?

By the way, the nightly build is terrible. Configuration per core no longer works, and it creates a new config file every time I use an emulator.

Is there really no way to just install the dependencies for jscal/jstest on the current live build of Lakka?


#6

Please check this documentation for jscal, you will need to access lakka command line interface.

If you upgrade with the updater, try to to reset your configuration file (stop retroarch then remove or rename your configuration file).


#7

I know how to access Lakka via Putty as well as WinSCP. But reading the documentation for jscal has me completely bewildered. I have no idea where to start. :frowning:

If someone with a lot of patience could just literally tell me what to do from plugging in the controller to having it calibrated, that would be so amazing.

EDIT: Worked on this for a few more hours. Very minimal progress. Here is where I’m at:

— Through trial and error, I was able to identify what my joystick device is: /dev/input/js2jstest shows me a bunch of raw data. I don’t know what to do with it. — jscal has the -c command which says it is for calibration, but it doesn’t seem to do anything. There is no difference in game. — The documentation for jscal mentions RangeMin and RangeMax (which is what I need) but those settings are not available unless I have jscal-gtk

:frowning:


Mayflash 64 controller joystick sensitivity
#8

According to the options of jscal,

To calibrate the joystick

jscal -c /dev/input/js2

Tests if the joystick is correctly calibrated. Returns 2 if the axes are not calibrated, 3 if buttons were pressed, 1 if there was any other error, and 0 on success.

jscal -t /dev/input/js2

If it is correct, create a shell script which will be executed each time you plug your controller :


$ jscal -p /dev/input/js2 > /storage/.config/jscal.sh
$ chmod +x /storage/.config/jscal.sh

And then you create your udev rule in /storage/.config/udev.rules.d/99-Mayflash-n64-adapter.rules with

SUBSYSTEM=="input", ATTRS{idVendor}=="[B]xxxx[/B]", ATTRS{idProduct}=="[B]xxxx[/B]", ACTION=="add", RUN+="/storage/.config/jscal.sh"

to get vendor/product it please check the output of

lsusb

#9

Thank you so much. I am going to try this now. You obviously have a lot of prerequisite knowledge of Linux, and I unfortunately do not. Anyway, I really appreciate your help with this. Thanks again.

EDIT: “jscal -t /dev/input/js2” does not output anything. Is that the same as 0?

Also, lsub does not work. I get this: “-sh: lsub: not found” From Google, it seems you maybe meant lsusb? If so, this prints out a very long page of text. Is there any way to just print out the details for /dev/input/js2?

EDIT 2:

I also do not understand where “99-Mayflash-n64-adapter.rules” came from. This file/location does not exist on my ODROID. Do you want me to create a file with this name?

EDIT 3:

Even when I manually enter the configuration into the terminal

jscal -s 6,1,0,128,128,7894920,7456313,1,0,127,127,7158060,6710682,1,0,128,128,5592235,5592235,1,0,128,128,5592235,5592235,1,0,0,0,2147483647,2147483647,1,0,0,0,2147483647,2147483647 /dev/input/js2

this does not change the deadzone or range of my joystick at all. :confused:


#10

I am made a typo sorry it is lsusb not lsub.

You need to find which one correspond to your adapter, it should be something like for vendor/product id : 0E8F:3013

You need to create the file : nano /storage/.config/udev.rules.d/99-Mayflash-n64-adapter.rules

Nano shortcuts are CTRL+O (Save), CTRL+W (Search), CTRL+X (Quit)

with something like :

SUBSYSTEM=="input", ATTRS{idVendor}=="0e8f", ATTRS{idProduct}=="3013", ACTION=="add", RUN+="/storage/.config/jscal.sh

#11

I really don’t know what I am doing wrong.

B[/B] I used jscal to calibrate, test, and save the configuration for my joystick.


jscal -c /dev/input/js2

jscal -t /dev/input/js2

jscal -p /dev/input/js2 > /storage/.config/jscal.sh

chmod +x /storage/.config/jscal.sh

I will mention again that jscal -t does not produce an output. When I use that command, it simply does nothing. It does not output a 1, 2, 3 or 0. It drops me to a new line. So I assume it is working? But I don’t know.

B[/B] I navigate to /storage/.config to make sure the config file is there. It is. Here are the contents of the file:


jscal -s 6,1,0,128,128,8658944,8259300,1,0,127,127,8134160,6972137,1,0,128,128,2147483647,2147483647,1,0,128,128,2147483647,2147483647,1,0,0,0,2147483647,2147483647,1,0,0,0,2147483647,2147483647 /dev/input/js2

B[/B] I setup a file in /storage/.config/udev.rules.d/ and I named it 99-Mayflash-n64-adapter.rules

By the way: where did you get the name for this file? Does the name matter? Could it be named AnythingElse.rules? Anyway, I set this up as instructed.

B[/B] I run lsusb to get a list of all devices. There are apparently plenty:


Bus 006 Device 002: ID 0bda:8153 Realtek Semiconductor Corp.
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 0e8f:3013 GreenAsia Inc.
Bus 003 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0e8f:3010 GreenAsia Inc.
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

B [/B]I try the vendor/product ID for all of them, one by one. None of them work. Here is my system:

  • Enter in the vendor/product ID for one of these devices in the appropriate place in 99-Mayflash-n64-adapter.rules
  • Reboot the ODROID
  • Start an N64 game
  • The joystick is not calibrated

Super frustrating. Through this entire process, I have never gotten any feedback on screen to indicate the deadzone, range or sensitivity has changed at all. I don’t know why.


#12

B [/B]When you get back to the prompt, type :


 jscal -t /dev/input/js2
 echo $?

B [/B]The name could be another one, it just to remember where you put the specific configuration for your controller.

B [/B]0e8f:3013 is for the n64 and 0e8f:3010 is psx.

To be sure you are using the correct input, check that ATTRS{idVendor}==“0e8f” and ATTRS{idProduct}==“3013”

udevadm info --attribute-walk --name /dev/input/js2

Hope it helps


#13

Gouchi, I just wanted to say thank you for all your replies here and your super in-depth answers. You spent a lot of time trying to help me. I really appreciate it.

Unfortunately, this still does not work.

I used the “echo $?” command, and it did give me a 0. That being said, even confirming that I had the correct vendor/product, this does nothing to calibrate the joysticks. They still react as if you were barely pressing them.

The joystick is calibrated. The settings are saved in the jscal file. The rule is setup with the correct vendor/product. I just really don’t know why this doesn’t work. But again, I thank you for the help. Hopefully a future version of Lakka will have something that helps with this. I have no idea what the problem could be.

EDIT:

I have done more Google searches. I really think something here could help me, but these instructions are designed around a Raspberry Pi. I don’t know the equivalent Lakka directories…


#14

They are doing something different as there are using linuxdraw for the joypad driver. Can you try to make test with linuxdraw joypad driver ? Menu Settings > Driver > Joypad Driver > Linuxraw


#15

I did. No changes.


#16

Another test, keep Linuxraw driver then Disable autoconfig Setting > Input > Autoconfig Enable > Off and reboot. Bind it if necessary Setting > Input > Input User 1 Binds > Bind All.


#17

It looks like the magic formula is this:

(1) Set Joypad Driver to Linux Raw (2) Disable Auto Config (3) Run [B]jscal -c /dev/input/js2

That being said, the settings are not saving when I reboot. Despite having the Mayflash-n64-adapter.rules file in udev.rules.d, I have to keep using [B]jscal -c /dev/input/js0 every time I reboot.

Also, (and I don’t know what caused this), the system now takes 6 seconds to recognize my controller every time I turn the ODROID back on. It used to be instant before. Bizarre.

EDIT: I have rebooted a few more times, and everything seems to be working.

I could not have done this without you, gouchi. You are the best!! [/B][/B]


#18

No problem you are welcome, glad it works !