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

FATAL: x52d_main.c:117 Daemon is already running as PID 23488 #47

Closed
MNS26 opened this issue Dec 23, 2022 · 94 comments
Closed

FATAL: x52d_main.c:117 Daemon is already running as PID 23488 #47

MNS26 opened this issue Dec 23, 2022 · 94 comments
Labels

Comments

@MNS26
Copy link

MNS26 commented Dec 23, 2022

whenever i run any commands it will throw a fatal message (FATAL: x52d_main.c:117 Daemon is already running as PID 22828)

when running anything other than x52d -h it throws a permission error

when using sudo x52d running any command after that (other than x52d -h) it will give the "FATAL" error
image

@MNS26 MNS26 added the question label Dec 23, 2022
@MNS26 MNS26 changed the title FATAL: x52d_main.c:117 Daemon is already running as PID 22828 FATAL: x52d_main.c:117 Daemon is already running as PID 22488 Dec 23, 2022
@MNS26 MNS26 changed the title FATAL: x52d_main.c:117 Daemon is already running as PID 22488 FATAL: x52d_main.c:117 Daemon is already running as PID 23488 Dec 23, 2022
@nirenjan
Copy link
Owner

Did you install the package from source or the Debian package?

Can you run ps aux | grep x52d and share the output. Also the output of systemctl status x52d please.

@MNS26
Copy link
Author

MNS26 commented Dec 23, 2022

i installed it from the AUR on arch

@MNS26
Copy link
Author

MNS26 commented Dec 23, 2022

the output of both
image

@MNS26
Copy link
Author

MNS26 commented Dec 23, 2022

i can try and install the github version if needed

@nirenjan
Copy link
Owner

For some reason, it looks like the daemon might have crashed earlier and not cleaned up the PID file - look for a file /var/run/x52d.pid and if it exists, delete it.

@nirenjan
Copy link
Owner

BTW, this is fixed in the latest version on Github.

@MNS26
Copy link
Author

MNS26 commented Dec 23, 2022

there was a pid file yeah...
i will install the git version them

@MNS26
Copy link
Author

MNS26 commented Dec 23, 2022

image
hmm after install it thew errors and didnt actually install

@MNS26
Copy link
Author

MNS26 commented Dec 24, 2022

image
welp installed the github version and its the same thing

@MNS26
Copy link
Author

MNS26 commented Dec 24, 2022

image
when i killed x52d it shows one with my user but... throws the fopen: permission denied message

@MNS26
Copy link
Author

MNS26 commented Dec 24, 2022

@nirenjan hmm how does it handle when no x52 is plugged in?

@nirenjan
Copy link
Owner

I did fix #43 in the latest version on Github, so that may be the reason why the 0.2.3 version crashed. I haven't gotten around to making a new release yet though. One thing though, if you installed from Github, you should stick to running it via systemd, that will ensure it runs in foreground mode, rather than background, and it will skip the check for the PID file.

@nirenjan
Copy link
Owner

The daemon is capable of recognizing when no joystick is connected, and it will try to reconnect every 5 seconds or so. If a joystick is connected, then it will update the joystick every 50 ms, and that should detect a disconnection nearly instantly. There was a bug in earlier versions which didn't quite handle the disconnect and reconnect properly, so that's why you should switch to the latest version.

@nirenjan
Copy link
Owner

@MNS26, could you please uninstall the Github version and update to v0.3.0 from AUR? Make sure you cleanup the PID file.

@MNS26
Copy link
Author

MNS26 commented Dec 26, 2022

@MNS26, could you please uninstall the Github version and update to v0.3.0 from AUR? Make sure you cleanup the PID file.

how do i uninstall the git version?
sudo make uninstall?

@MNS26
Copy link
Author

MNS26 commented Dec 26, 2022

I did fix #43 in the latest version on Github, so that may be the reason why the 0.2.3 version crashed. I haven't gotten around to making a new release yet though. One thing though, if you installed from Github, you should stick to running it via systemd, that will ensure it runs in foreground mode, rather than background, and it will skip the check for the PID file.

i never had a issue with it (having it plugged in or not when starting the daemon didnt make a difference)

@nirenjan
Copy link
Owner

@MNS26, could you please uninstall the Github version and update to v0.3.0 from AUR? Make sure you cleanup the PID file.

how do i uninstall the git version?
sudo make uninstall?

Yes, sudo make uninstall

@MNS26
Copy link
Author

MNS26 commented Dec 26, 2022

just did a uninstall and no pid files left

rn installing AUR version
image

@MNS26
Copy link
Author

MNS26 commented Dec 26, 2022

also for some odd reason Elite Dangerous sees the controls double (still works fine)
image

@MNS26
Copy link
Author

MNS26 commented Dec 26, 2022

oh that reminds me... is there any way to disable the little mouse knob on the throttle?

accidentally bumping it makes the game go nuts (axis 8 & 9) and for some reason i cant seem to assign them in game
(just a slight bump)
image

@MNS26
Copy link
Author

MNS26 commented Dec 26, 2022

Just finished install
image

@nirenjan
Copy link
Owner

You should already be running x52d from systemd, check systemctl status x52d.service. Also, x52d requires root permissions to write to certain directories.

@MNS26
Copy link
Author

MNS26 commented Dec 31, 2022

hmm i was kinda hoping to not have to rely on root to access it

after manually starting the service (either via sudo x52d or with systemctl) it works

on another note... do you have a communication example for sending data to the x52? (planning on replacing it with a RP2040 cus if its 12bit ADC)
or another way to contact you about it? (bc its not really related to this)

@MNS26
Copy link
Author

MNS26 commented Jan 1, 2023

hmm idk whats going on but the trigger on the joystick is set to half pressed and T2...
this happened after enabling the service
image

image
i also cant seem to bind axis 7 & 8 (not that i want to)

@MNS26
Copy link
Author

MNS26 commented Jan 1, 2023

hmm yeah for whatever reason it now keeps sending wrong inputs

@MNS26
Copy link
Author

MNS26 commented Jan 1, 2023

image

here are the current keybinds
button layout ED.txt

running sdl2-jstest -t 0 shows all the correct inputs and buttons tho

its currently 11:45pm ill look into it more tomorrow

@MNS26
Copy link
Author

MNS26 commented Jan 2, 2023

welp i think i found the issue...
i have no clue how this happened but... my system sees the X52 as a raspberry pi pico instead
(i did fool with the PID and VID of the pico but its not plugged in)
image

@MNS26
Copy link
Author

MNS26 commented Jan 3, 2023

well ill stick with the module in master for now

@MNS26
Copy link
Author

MNS26 commented Jan 3, 2023

oh also... for some reason i cant set the B button led to green or amber
B=Green (off)
B=amber (red)
B=red (red)
B=off (off)

@nirenjan
Copy link
Owner

nirenjan commented Jan 3, 2023

That is weird, was it working earlier? Can you check in a Windows environment if the B green LED works? Amber is just both red and green on at the same time, so an issue affecting just the green LED will exhibit the behavior you see

@MNS26
Copy link
Author

MNS26 commented Jan 3, 2023

hmm i will have a look tomorrow

@MNS26
Copy link
Author

MNS26 commented Jan 3, 2023

is there a way to set the leds on the fly?

@nirenjan
Copy link
Owner

nirenjan commented Jan 4, 2023

Yes, you can run x52ctl config set led b green

@MNS26
Copy link
Author

MNS26 commented Jan 4, 2023

oh cool... im guessing i need sudo for it tho... also one of the wires broke in the joystick (right at the solder joint) but its fixed

@nirenjan
Copy link
Owner

nirenjan commented Jan 4, 2023

It should work without sudo, but do let me know if it doesn't.

@MNS26
Copy link
Author

MNS26 commented Jan 4, 2023

nope it doesnt, it gives me a permission denied.

i just added a exception to the sudoers.d and that works (fixed syntax) but... it has a weird output
image

@MNS26
Copy link
Author

MNS26 commented Jan 4, 2023

trying to run without sudo just does this
image

@MNS26
Copy link
Author

MNS26 commented Jan 4, 2023

hmm off works but on doesnt... but it also doesnt throw a error
image

@nirenjan
Copy link
Owner

nirenjan commented Jan 4, 2023

Yeah, unfortunately, the config system will accept off, on, red, amber and green, regardless of which LED is selected, this is a limitation at the moment.

@MNS26
Copy link
Author

MNS26 commented Jan 4, 2023

ah... is it a possibility to save it color state before a off command is given so on just sets the last known color?

@nirenjan
Copy link
Owner

nirenjan commented Jan 4, 2023

That would be a pretty big change, I'll see what I can do.

@MNS26
Copy link
Author

MNS26 commented Jan 4, 2023

oh i forgot to say this earlier...

with the kernel module it seems that after a while steam and (any) game that has controller support on its own crashes and takes steam with it

when launching steam via a terminal for extra info it takes the terminal session with it

@MNS26
Copy link
Author

MNS26 commented Jan 4, 2023

oh...
image
image

@MNS26
Copy link
Author

MNS26 commented Jan 4, 2023

i would really like to help with the changes, i know C++ and know some basic C.
i just dont quite know where to start

@MNS26
Copy link
Author

MNS26 commented Jan 5, 2023

oh wow.. i realised i wasnt using x52cli but x52ctl well x52cli does work without sudo

@nirenjan
Copy link
Owner

nirenjan commented Jan 6, 2023

x52cli writes directly to the joystick using libx52, but it can get reset if the daemon restarts. The udev rule allows a user with access to plugdev or input group (depending on the distro), to write to the joystick without needing root permissions.

@MNS26
Copy link
Author

MNS26 commented Jan 6, 2023

im part of the plugdev group, i forgot that udev also can set group permissions.

@MNS26
Copy link
Author

MNS26 commented Jan 7, 2023

for whatever reason pressing the up resets the x52

V_20230107_011447_ES10.mp4

@MNS26
Copy link
Author

MNS26 commented Jan 7, 2023

its not just when its getting pressed.... when held down and pressing other buttons it also happens

@nirenjan
Copy link
Owner

nirenjan commented Jan 7, 2023

Sounds like there may be some short happening, that could cause a reset.

@MNS26
Copy link
Author

MNS26 commented Jan 7, 2023

whenever i insmod the saitek kernel module it starts happening

@MNS26
Copy link
Author

MNS26 commented Jan 7, 2023

well rebuilding the module seemed to fix it for now

@MNS26
Copy link
Author

MNS26 commented Jan 7, 2023

nvm still happens

@MNS26
Copy link
Author

MNS26 commented Jan 7, 2023

it also happens when quickly pressing the trigger and releasing the lower button

release bottom button
tap trigger
press bottom button

@MNS26
Copy link
Author

MNS26 commented Jan 7, 2023

V_20230107_160306_ES10.mp4

@MNS26
Copy link
Author

MNS26 commented Jan 7, 2023

also i will close this issue since the original issue is gone

@MNS26 MNS26 closed this as completed Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants