Forum › Forums › New users › New Users and General Questions › Sony Gamepad Issues
- This topic has 6 replies, 3 voices, and was last updated Sep 24-12:58 am by Sliver X.
-
AuthorPosts
-
September 23, 2019 at 5:35 am #27414Member
Sliver X
I’ve been running AntiX 17.4.1 for about a month now, and have been extremely impressed with it overall. However, I’m running into a strange issue with my game controller when upgrading the kernel.
I use a Sony Dualshock 1 with a Dualshock 1/2 to PS3 USB adapter, thus presenting the device to the OS as a Dualshock 3. With the stock kernel that ships with the release (4.9.160), everything works fine.
However, when upgrading the kernel to 5.2.8, the controller shows up completely differently in the OS and is virtually unusable (Several buttons don’t work at all).
Abbreviated output from jstest looks like this under each kernel:
4.9.160
——-
Driver version is 2.1.0.
Joystick (Sony PLAYSTATION(R)3 Controller) has 27 axes … and 19 buttons …5.2.8
—–
Driver version is 2.1.0.
Joystick (Sony PLAYSTATION(R)3 Controller) has 6 axes … and 13 buttons …I ran lsmod and see a module called sony_hid being loaded in both cases. Is that the module responsible for it being recognized as a 27 axis / 19 button controller? Would it need recompiled? Or is it not even sony_hid that’s responsible for this?
Any help would be greatly appreciated.
*edit*
I ultimately ended up taking the source for sony-hid from the 4.9 kernel and recompiled it against 5.2.8’s headers: I then overwrote the existing sony-hid.ko and now everything works like it did in 4.9.160. I’m sure it would be more elegant to compile it as a separately named object, add it to /etc/modules and prevent sony-hid from loading but I’ll worry about that later.
As a test, I also tried this with Lubuntu 19.04 and it worked as well, though the axes and buttons are defined differently. Once I determine where that is defined I think my Dualshock 1 will be happy no matter what kernel/distro I may use in the future.
If anyone would want details of how I did this, please don’t hesitate to ask and I’ll document it.
- This topic was modified 3 years, 7 months ago by Sliver X.
- This topic was modified 3 years, 7 months ago by Sliver X.
September 23, 2019 at 7:05 am #27418Forum Admin
rokytnji
::Game pad is a usb device. Maybe grepping for errors nay help find answers,
Sometimes I drive a crooked road to get my mind straight.
Not all who Wander are Lost.
I'm not outa place. I'm from outer space.Linux Registered User # 475019
How to Search for AntiX solutions to your problemsSeptember 23, 2019 at 9:49 am #27429Moderator
caprea
::Hi AbacusRex, is there a special reason why you would like to have the most modern kernel installed?
If your motives are the latest security updates and bugfixes,
you can also try to update the 4.9.160 kernel to the 4.9.189 kernel.
https://www.antixforum.com/swapgs-mitigations-kernels-available/Edit: Since today
https://www.antixforum.com/forums/topic/new-kernels-available-2/- This reply was modified 3 years, 7 months ago by caprea.
September 23, 2019 at 11:22 am #27437Member
Sliver X
::I use Wine heavily on my primary desktop: Newer kernels in the 5.x line appear to have changes relating to Wine that don’t exist in the 4.x series.
I’ve tested this adapter on Ubuntu 18.04 and 16.04, and they both show it as the 13 button, half broken device. There are no errors I can find relating to it or the USB subsystem in general under either Ubuntu or AntiX
I suppose a better question is, what particular driver is the AntiX 4.9.160 kernel using for Dualshock 3s that every other kernel I’ve tried doesn’t?
September 23, 2019 at 11:56 am #27438Moderator
caprea
::inxi -zv7
should show you which driver is used and I think you are right with hid-sony.
You can then search for hid-sony with
locate hid-sonyBut what will it bring, it seems both kernels offer this driver, but in a different version.
September 23, 2019 at 1:59 pm #27440Member
Sliver X
::After some cursory research, it appears sony-hid had major changes in how it behaved around Linux 4.10 that basically broke how it worked before. Looks like some blood sweat and tears are going to be shed trying to figure out a way to retain functionality with a newer kernel.
Thank you all for the help: It’s put me on what I think is the right track. Between AntiX itself and its community I’m extremely pleased with choosing this distro.
September 24, 2019 at 12:58 am #27451Member
Sliver X
::So I figured out how to work around this.
I downloaded the Kernel 4.9 sources via Synaptic. Two files are of interest in here:
linux-source-4.9/drivers/hid/hid-sony.c
linux-source-4.9/drivers/hid/hid-ids.hI then made a Makefile with the following:
obj-m += hid-sony.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) cleanI then threw all three into a subfolder named hid-sony (I did all this in /tmp: Wherever you want is fine).
In a root terminal at the folder above hid-sony (For me, /tmp), I ran the following:
cd ./hid-sony make rmmod hid_sony rm -f /lib/modules/$(uname -r)/kernel/drivers/hid/hid-sony.ko cp ./hid-sony.ko /lib/modules/$(uname -r)/kernel/drivers/hid/ insmod /lib/modules/$(uname -r)/kernel/drivers/hid/hid-sony.ko make cleanThis entirely replaces the existing module with the older version. After doing this, my gamepad is now fully functional again under Kernel 5.2.8
I initially planned to build this as a separately named kernel object and to disable sony-hid and enable the new module on every boot but ultimately just decided to overwrite the newer module file and be done with it.
I also did this on Ubuntu 19.04 AMD64 and it worked as expected too.
I’ll have to do this with every kernel update, but I can live with that. Hopefully anyone with a similar issue to mine will be helped by this.
Again, thanks to all of you who answered me.
-
AuthorPosts
- You must be logged in to reply to this topic.