nirenjan / libx52

Saitek X52/X52pro drivers & controller mapping software for Linux
https://nirenjan.github.io/libx52
GNU General Public License v2.0
115 stars 14 forks source link

0.2.2. --- erratic behavior #33

Closed LittleCannon closed 3 years ago

LittleCannon commented 3 years ago

Describe the bug After daemon is started and X52Pro connected, on display, mode status (1,2, 3) starts rapidly blinking. Also in game X52Pro is erratic ( it feels like it is repeating inputs, rather then holding constant value).

To Reproduce Steps to reproduce the behavior:

  1. Just start x52d 0.2.2
  2. take a look at LCD display
  3. Blinking mode status number
  4. Soon as x52d is stopped, hotas is working normally.

Expected behavior Normal behavior

Screenshots If applicable, add screenshots to x52evtest-output.txt help explain your problem.

Environment (please complete the following information):

Additional context In attachment x52evtest output,without touching hotas. It starts soon as hotas is connected.

nirenjan commented 3 years ago

As of version 0.2.2, the daemon doesn't do anything but control the brightness, clock and LED states. The mode status number is also controlled in hardware, not by the daemon. I'm not sure why you are seeing the problem only when running the daemon.

Can you also attach the x52d logs? If you are using the released .deb package (or if you've built from source with the default configuration), then you'll need to edit /lib/systemd/system/x52d.service, and update the ExecStart line from -v to -vvvv. Then you can capture the logs by running sudo journalctl -b -u x52d.service.

If you're running the service manually, then you can append -vvvv -l /tmp/x52d.log, and attach that file.

nirenjan commented 3 years ago

Also, without starting the daemon, can you capture x52evtest output? Also, please run x52test led - this is a program which will exercise the hardware (just the LEDs) and make sure that the device is working as expected. The output that you attached is showing flapping on the MODE_3 button, which leads me to think that either the button sensor is not working as expected, or (more likely), the PS/2 cable connecting the throttle and stick is bad. I had to replace the cable on my own joystick several years ago, and I suspect that this might be the more likely reason you are seeing issues.

LittleCannon commented 3 years ago

Tnx for really quick reply

My first thought was also that switch or even cable might be faulty, but as you can see from evtest with daemon stopped, it is not.

Please let me know if I can do anything more to assist.

journactl_LOG.txt x52evtest_daemon_stop.txt

LittleCannon commented 3 years ago

oh, I forgot, I've built it from source.

nirenjan commented 3 years ago

OK, unfortunately, the journalctl logs are getting cut off, can you please capture the output using sudo journalctl -b -u x52d.service > journalctl_log.txt and attach that output please?

LittleCannon commented 3 years ago

journalctl_log.txt

nirenjan commented 3 years ago

Huh... the journal logs are showing an error which was fixed before I released 0.2.2, what commit are you at?

LittleCannon commented 3 years ago

I downloaded source from latest release. 0.2.2. I guess?

Also I tried with deb package as well. Same thing.

nirenjan commented 3 years ago

I think I may have found the issue. Can you try with the latest commit on branch check-device-attached and see if you still see the problem?

LittleCannon commented 3 years ago

You got it! It works as expected now.

Thank you very very much!

nirenjan commented 3 years ago

Thank you for the confirmation. If you can provide the verbose daemon logs when unplugging and reinserting the X52, I'd appreciate that very much.

LittleCannon commented 3 years ago

Of course!

Here it is. journalctl_log.txt

nirenjan commented 3 years ago

Thank you. One last request - can you share the contents of libx52/x52_stringify.c? The log messages that you shared indicate another fault which I thought I fixed in that file.

LittleCannon commented 3 years ago

Yes no problem.


/*

include "config.h"

include

include "libx52.h"

include "gettext.h"

define N_(str) gettext_noop(str)

define _(str) dgettext(PACKAGE, str)

define STRINGIFY(name, max_id, errstr, ...) \

const char libx52_ ## name ## _tostr (libx52 ## name param) { \ static char invalid[256]; \ static const char desc[] = { __VA_ARGS__ }; \ if (param >= 0 && param <= maxid) { \ return (desc[param]); \ } \ snprintf(invalid, sizeof(invalid), _(errstr), param); \ return invalid; \ }

STRINGIFY(clock_id, LIBX52_CLOCK3, N("Unknown clock ID %d"), N("primary"), N("secondary"), N_("tertiary"), )

STRINGIFY(clock_format, LIBX52_CLOCK_FORMAT24HR, N("Unknown clock format %d"), N("12 hour"), N("24 hour"), )

STRINGIFY(date_format, LIBX52_DATE_FORMATYYMMDD, N("Unknown date format %d"), N("DD-MM-YY"), N("MM-DD-YY"), N_("YY-MM-DD"), )

STRINGIFY(led_state, LIBX52_LED_STATEGREEN, N("Unknown LED state %d"), N("off"), N("on"), N("red"), N("amber"), N_("green"), )

const char * libx52_led_id_to_str(libx52_led_id id) { static char invalid[256];

switch (id) {
case LIBX52_LED_FIRE:
    return _("Fire");

case LIBX52_LED_A:
    return _("A");

case LIBX52_LED_B:
    return _("B");

case LIBX52_LED_D:
    return _("D");

case LIBX52_LED_E:
    return _("E");

case LIBX52_LED_T1:
    return _("T1");

case LIBX52_LED_T2:
    return _("T2");

case LIBX52_LED_T3:
    return _("T3");

case LIBX52_LED_POV:
    return _("POV");

case LIBX52_LED_CLUTCH:
    return _("Clutch");

case LIBX52_LED_THROTTLE:
    return _("Throttle");

default:
    snprintf(invalid, sizeof(invalid), _("Unknown LED ID %d"), id);
    return invalid;
}

}

LittleCannon commented 3 years ago

Oh btw, if I can assist more, please let me know. Really it is no trouble for me.

nirenjan commented 3 years ago

Thank you, if I need more help, I'll raise a separate discussion and tag you.