Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joystick down movement not detected in menu #250

Closed
Machinas opened this issue Jul 14, 2016 · 23 comments
Closed

Joystick down movement not detected in menu #250

Machinas opened this issue Jul 14, 2016 · 23 comments

Comments

@Machinas
Copy link

Hello!

Our DragonRise Inc. Generic USB Joystick (ID 0079:0006) exhibits a potential bug: When configuring the controls, the joystick "up" movement is detected as "Joy0 Uneg" and is added correctly as such, with that exact label. It also works perfectly to scroll "up" in the game carousel.

The "down" movement is detected as "Joy0 Upos". HOWEVER once you go back from adding an action, it shows up as "Joy0 Up" (note Up in overview vs. Upos in add action screen), and it does NOT work for scrolling "down" in the game carousel.

I also tried to manually overwrite ~/.attract/attract.cfg with "up Joy0 Upos" (after closing attract first, of course). However, after restarting attract, the "down" movement still isn't working in the game carousel.

Finally, I changed "Joy0 Upos" back to "Joy0 Up" and "Joy0 Uneg" to "Joy0 Down", which resulted in none of the directions working in the carousel.

The weird thing is, in all of the games, the joystick works perfectly in all directions, up, down, etc. Only the menu exhibits this erroneous behaviour.

Is this something that needs to be fixed in https://github.com/mickelson/attract/blob/master/src/fe_input.cpp ?

Attract built today manually from git on Raspi v3:

attract -v
Attract-Mode v2.1.0 (Linux, SFML 2.3 +FontConfig +RPi +SWF +7z)

Using Libav for Audio and Video.
avcodec 56.1.0 / avformat 56.1.0 / swscale 3.0.0 / avresample 2.1.0

Shaders are not available.

@yullaw
Copy link

yullaw commented Aug 3, 2016

Hi,
I have the same gamepad DragonRise Inc. Generic USB Joystick (ID 0079:0006) with the same results. It seems to be kernel's issue. Try to downgrade/upgrade kernel and remap axis UP/DOWN in Attract-Mode again. My is NOT working between kernel 4.1.15 and 4.6.

It is not an issue in Attract-Mode. See also https://bbs.archlinux.org/viewtopic.php?pid=1593822#p1593822

Hope it helps and bug report can be closed here if necessary.

$ cat /etc/issue
Mageia release 5 (Official) for x86_64
Kernel 4.4.16-desktop-1.mga5 on a 4-processor x86_64 / \l

$ attract -v
Attract-Mode v2.1.0 (Linux, SFML 2.2 +FontConfig +Xinerama +SWF)

Using FFmpeg for Audio and Video.
avcodec 56.1.100 / avformat 56.4.101 / swscale 3.0.100 / swresample 1.1.100

Shaders are available.

@chrisaq
Copy link

chrisaq commented Sep 7, 2016

The retropie guys have found a solution:
use a hex editor on the hid-dr.ko file...

https://retropie.org.uk/forum/topic/1686/up-down-y-axis-not-working-in-3-8/52

Works for me on arch amd64.

@maziac
Copy link

maziac commented Sep 14, 2016

Hi,

same problem here.
I'm on Ubuntu 16.04 LTS/kernel 4.4.0-36-generic on a NUC.
I have edited the file as described, but after reboot the driver does not work anymore.
I.e. the joystick is not found anymore.
(Did it twice to be sure and also verified the changes.)

Is there anything I need to do additionally?

@fatavatar
Copy link

I'm not set up with a build environment for this, but is the issue here (which I am also having) this particular check:

if ( val.compare( 0, strlen(joyStrings[i]), joyStrings[i] ) == 0 )

on line 360 of fe_input.cpp?

Seems like the ordering of joyStrings will cause issues with this check as shorter strings are first in the array that can match later, longer values if you limit the length of comparison.

mickelson added a commit that referenced this issue Nov 8, 2016
- Not sure if this fixes the actual issue, but there is definitely an
error as identified by fatavatar in the issue discussion (Upos axis was
being matched to Up due to the string matching method)
@mickelson
Copy link
Owner

@fatavatar thanks for pointing that out,. I've fixed the ordering of joyStrings so the matching should work now. Hopefully this fixes the original issue as well

@vossim
Copy link

vossim commented Nov 23, 2016

@fatavatar @mickelson I have just tested 25e2781, it fixes the issue.

@madlittlepixel
Copy link

Hello,
Im fairly new to this. But how can I fix this issue on Retropie? My older builds I never had an issue, but now I am having the same Joystick issue and cannot figure out how to edit the src/fe_input.cpp as you guys have linked to. Can anyone help? Sorry if I sound like an idiot. Just cannot figure this out and just wanna be pointed in the correct direction. Thanks,

@vossim
Copy link

vossim commented Nov 26, 2016

@madlittlepixel no need to patch any files, you just need to get the master branch and recompile. Either use git to pull the code in, or download a zipped version: https://github.com/mickelson/attract/archive/master.zip

@madlittlepixel
Copy link

@vossim Thanks, I guess I need to figure out how to pull the code in properly. Thats where I am stuck at. Im still learning.

@yullaw
Copy link

yullaw commented Nov 27, 2016

Hello,
I have tested the new release Attract Mode 2.2.0 and my gamepad DragonRise (0079:0006) still does not work. But I found an issue. It is in ../drivers/hid/hid-dr.c of kernel.

Current patch/file which affects a good setting:

Now /drivers/hid/hid-dr.c is reverted to previous version, so soon should work again.
For more info, see:

At this moment who has the same troubles still, boot an older kernel.

Hope, it helps.

Happy playing!

@vossim
Copy link

vossim commented Nov 27, 2016

@yullaw the patch mentioned in this thread (25e2781) isn't in the 2.2.0 release. The master does contain the patch and works fine for me with the standard amd64 4.8.0 kernel that's in debian testing currently.

@yullaw
Copy link

yullaw commented Nov 30, 2016

@vossim ou, thanks for the notice! I recompiled the master branch on my affected kernel and it works! Ok, I had to re-set the joypad controls in AttractMode (example for UP: Joy1 Up to Joy1 Uneg) and then works as it should.
However, 10ne1/linux@28a444c and 10ne1/linux@a7dd8e2 should be the solution as well.
I am waiting for pushed updates of our distro and then I will test it and let you know.

Tested on Mageia 5 (64bit), kernel 4.4.32-desktop-1.mga5

Thanks

@yullaw
Copy link

yullaw commented Nov 30, 2016

Yeah, today I have got an update of kernel, where is the fix implemented and it works with AttractMode 2.2.0 as well! And it solves not only AttractMode, but also other apps like KDE4/Plasma5 → SystemSettings → Inputs → Gamepad.

Then I recompiled the master branch too, and still it works with any change.

For me/Mageia users it is solved. Thanks.

@KingVarus
Copy link

@yullaw @vossim

Hey guys, i have built my own bartop arcade, now that its finished i came along the same problem. My UP does not work, it does though in retropie and in the games NOT in attract mode displays.

I updated the kernel via the Retropie setup, but that did not fix any problems.
I googled the last few hours about the stuff you´ve written here. Could someone please tell me how to fix my problem, i´ve put so much work in my cabinet, yet i cant use UP on my Joystick...please help me

@vossim
Copy link

vossim commented Dec 11, 2016

@KingVarus if you just get the code on the master branch, compile it and use that, it just works.

@KingVarus
Copy link

@vossim would you mind telling me what the master branch is, and how to get it and compile it?
can´t i update my "current image" i´m running now? because it was so much work i don´t want to start all over.

@vossim
Copy link

vossim commented Dec 11, 2016

@KingVarus the master branch is the most up to date version of the source code of attract mode, you can either use git to pull it in, or download a zipped version from https://github.com/mickelson/attract.

Compilation instructions are in Compile.md.

If you want a precompiled version, you'll have to wait for the next release.

@KingVarus
Copy link

@vossim i´m really sorry that i´m not that good in all that stuff.

My question is, can i just type something in the terminal and it pulls it in?

I´ve read the compile.md but i dont get it. Where do i have to put the zip?
so many questions....

@KingVarus
Copy link

KingVarus commented Dec 11, 2016

@vossim i´ve read the compile.md again, there is nothing stated about putting anything on the SD card, or SSH, i just dont get how i change anything when i´m not doing anything over SSH or the SD card...

If you dont have the time to help me out in detail, where can i find the precompiled versions? and are those easier to install?

@fatavatar
Copy link

@KingVarus take a look at https://github.com/mickelson/attract/wiki and look for the compile instructions for your particular version of Raspbian. You will SSH onto the pi and execute the commands the from the instructions. Its a bit more explicit than the steps in the compile.md. Hopefully that gets you up and going if you are not there already.

@KingVarus
Copy link

@vossim @fatavatar
First of all, thanks for all the Help!
I fixed my problem, maybe i was just stupid not to figure it out but for anyone that has the same problem i´ll just state my problem again and tell you my solution.
So i ordered two Dragonrise controllers with buttons and 2 identical USB decoders. As they were the same they had the same vedor ID and BUS and so on, so the Pi treated them as one decoder even though there were two of them. Which led to not being able to configure both!
So my fix for my problem was rather easy, i checked the button connectors on the decoder and i found out that one button was not connected the same as on the other board.
In Conclusion: If you have the same Error as i have check your connections, and if you want to map both controllers (Or decoders) the same, just wire them up identically and configure one of them, and both should work fine, and be identified as Joy1 and Joy2

Thanks Again,
KingVarus

@ghost
Copy link

ghost commented May 2, 2017

Hello, I've tried the hex editor method and it works but my joystick and buttons no longer works in EmulationStation and my keyboard arrows no longer work. I reverted that change and then compiled attract mode via the instructions on the wiki page and that did not fix the problem. Also my "A" button doesn't work in Attract Mode. Everything works fine in a game, however. Is there anything else I could try? I think I've read that upgrading or downgrading the kernel could fix it but that's pretty scary to me :)

@ghost
Copy link

ghost commented May 2, 2017

Got it working by running rpi-update to update the kernel then rebinding the inputs in emulation station.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants