[Linux Station] Install Module. modprobe

Post Reply
felipe64

[Linux Station] Install Module. modprobe

Post by felipe64 »

I'm looking to find a way to plug my PS3 or PS4 controller/pad to my QNAP,

Following steps here : https://doc.ubuntu-fr.org/dualshock, i have to install module uinput.

using modprobe uinput doesn't install it.
Indeed, when i do cat /sbin/modprobe, the file has been customised by QNAP.

Code: Select all

#!/bin/bash

# only support one argument
result=$(qbus post com.qnap.qts/module [\"$0\", \"$1\"])
if [[ $result != *"\"code\": 200"* ]]; then
    echo "$result"
    exit 1
fi
How can i install a module on Linux Station?
Many Thanks,
Regards
Felipe
LaRseTe
Starting out
Posts: 31
Joined: Fri Dec 23, 2016 5:59 pm

Re: [Linux Station] Install Module. modprobe

Post by LaRseTe »

Hi guys!

I'm trying to accomplish the same thing (compiling "uinput" kernel module), but in my case is to make the Steam Controller work in Linux Station (Ubuntu 16.04).

I have tried with generic instructions like the ones outlined here, I have also followed the instructions left by @ouija in the thread about compiling the xpad module (but for the uinput one instead), taking into account @nikoss suggestions, but even if I'm able to build it, I'm still getting the following error when loading it:

Code: Select all

uinput: Unknown symbol kmem_cache_alloc_trace (err 0)
I have used the source code from QNAP available here, for QTS 4.3.X and Kernel 4.2.X, but the same happens... is there a more updated one available?

One thing I'm missing is using the "Module.symvers" file, but because I couldn't find it...

Any ideas would be very appreciated!

Best.
LaRseTe
Starting out
Posts: 31
Joined: Fri Dec 23, 2016 5:59 pm

Re: [Linux Station] Install Module. modprobe

Post by LaRseTe »

Thank you for your suggestions father_mande!!

I'll talk with support then and I'll try to put here the results :wink:
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [Linux Station] Install Module. modprobe

Post by QNAP_Stephane »

Hi Philippe is totaly right,

I already built this kernel module but never tested it, because i have no Joystick here (but at least insmod is loading them)

file is available here : www.qoolbox.fr/xpad_driver.tgz

;)
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
LaRseTe
Starting out
Posts: 31
Joined: Fri Dec 23, 2016 5:59 pm

Re: [Linux Station] Install Module. modprobe

Post by LaRseTe »

Thank you QNAP_Stephane!!

I've tried that one and now it does not give an error, but it says instead:

Code: Select all

uinput: module is already loaded
So I guess it is already built in the Kernel? I couldn't find the "modules.builtin" file in the QNAP side, but I see this exists:

Code: Select all

[~] # ls /sys/module/uinput/      
uevent   version
But I don't see this on the Linux Station side.

The thing is that, even if it is already built in the kernel, the Linux Station is not able to use it. I've even tried with this user mode driver just for debugging purposes, and it is also not able to see the controller because the lack of the uinput module... Any ideas? :(
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [Linux Station] Install Module. modprobe

Post by QNAP_Stephane »

Linux Station should be binded to Kernel /dev on back side.. the LXC container must use it ( logically )

i guess .. /dev/uinput must exists, so might be working
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
LaRseTe
Starting out
Posts: 31
Joined: Fri Dec 23, 2016 5:59 pm

Re: [Linux Station] Install Module. modprobe

Post by LaRseTe »

Hi again!

"/dev/uinput" indeep exists, but only on the "host" side, not on Linux Station. For it to exist also in Linux Station I have added this to the LXC container config:

Code: Select all

lxc.mount.entry = /dev/uinput dev/uinput none bind,optional,create=file
And after that I can see it inside the Ubuntu container, but it is still not detected by Steam nor by the sc-controller user mode drivers... I have tried giving all kind of permissions to it also, as I know is one of the problems some people have in the regular Ubuntu, but no luck. I'm getting out of ideas, but I'm sure is something obvious I'm not doing :S
LaRseTe
Starting out
Posts: 31
Joined: Fri Dec 23, 2016 5:59 pm

Re: [Linux Station] Install Module. modprobe

Post by LaRseTe »

I think maybe I need to dig more into something like what is explained here: https://github.com/maruos/maruos/issues ... -240301821
LaRseTe
Starting out
Posts: 31
Joined: Fri Dec 23, 2016 5:59 pm

Re: [Linux Station] Install Module. modprobe

Post by LaRseTe »

Thank you for your suggestions Philippe!

I've have tried that also, but still no luck.

I have the uinput built in kernel, it recognizes the dongle correctly as a HID device:

Code: Select all

[29915.336169] input: Valve Software Steam Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:28DE:1142.00C2/input/input144
[29915.388030] hid-generic 0003:28DE:1142.00C2: input: USB HID v1.11 Keyboard [Valve Software Steam Controller] on usb-0000:00:14.0-3/input0
[29915.390991] hid-generic 0003:28DE:1142.00C3: hiddev0: USB HID v1.11 Device [Valve Software Steam Controller] on usb-0000:00:14.0-3/input1
[29915.394157] hid-generic 0003:28DE:1142.00C4: hiddev0: USB HID v1.11 Device [Valve Software Steam Controller] on usb-0000:00:14.0-3/input2
[29915.396800] hid-generic 0003:28DE:1142.00C5: hiddev0: USB HID v1.11 Device [Valve Software Steam Controller] on usb-0000:00:14.0-3/input3
[29915.399620] hid-generic 0003:28DE:1142.00C6: hiddev0: USB HID v1.11 Device [Valve Software Steam Controller] on usb-0000:00:14.0-3/input4
[31169.441620] [usb.001.046] /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3 added. (MTP mode)
I think I need to play more with "allow" with more devices like "usb", "input", etc

Will try when have more time and report back the results :)
LaRseTe
Starting out
Posts: 31
Joined: Fri Dec 23, 2016 5:59 pm

Re: [Linux Station] Install Module. modprobe

Post by LaRseTe »

It is working now!

The thing that made it work was adding this to the LXC config file:

Code: Select all

lxc.mount.entry = /dev/bus/usb dev/bus/usb none bind,optional,create=dir
Steam now recognizes the controller when executed as root. If I execute it as normal user it crashes, even giving "uinput" permissions for all users. But I have to check a bit more because I have probably overconfigured everything, so I think I need to start over to find the minimum working configuration :)

I'll report back again once I find the time to do it right.

PS: Thanx all for your suggestions!
bugler921
New here
Posts: 5
Joined: Fri Jul 08, 2016 5:12 am

Re: [Linux Station] Install Module. modprobe

Post by bugler921 »

QNAP_Stephane wrote: Fri Nov 24, 2017 7:04 pm Hi Philippe is totaly right,

I already built this kernel module but never tested it, because i have no Joystick here (but at least insmod is loading them)

file is available here : www.qoolbox.fr/xpad_driver.tgz

;)
Thanks for the files! These worked fo rme. I just put xpad.ko in

Code: Select all

/lib/modules/
and when I ran

Code: Select all

lsmod | grep xpad
(outside of Linux Station) it showed up there. This also allowed me to use my controller (Logitech F310) in HD Station with the RetroArch QPKG installed (see viewtopic.php?f=320&t=124292&hilit=retroarch). To get xpad working inside Linux Station, I added these lines to the linux station config file based on other users' instructions:

Code: Select all

lxc.mount.entry = /dev/bus/usb dev/bus/usb none bind,optional,create=dir
lxc.mount.entry = /dev/uinput dev/uinput none bind,optional,create=file
Then, I ran

Code: Select all

lsmod | grep xpad
inside Linux Station, and it appeared there as well, and the controller worked with RetroArch installed in Linux Station.
Post Reply

Return to “Container Station”