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

Running tests causes ValueError: not enough values to unpack (expected 2, got 0) #77

Open
greenbigfrog opened this issue Oct 6, 2021 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@greenbigfrog
Copy link

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/oversteer/gui.py", line 478, in end_test
    self.linear_chart = LinearChart(self.test.get_input_values(), self.test.get_output_values(),
  File "/usr/lib/python3.9/site-packages/oversteer/linear_chart.py", line 9, in __init__
    self.fposdata = self.output.filter(5)
  File "/usr/lib/python3.9/site-packages/oversteer/signal.py", line 70, in filter
    (times, values) = zip(*self.values)
ValueError: not enough values to unpack (expected 2, got 0)

Running tests with my T150 causes the error above.

@berarma
Copy link
Owner

berarma commented Oct 6, 2021

Does the wheel move during the tests? It seems like it's getting no data from the tests.

@amalon
Copy link

amalon commented Jan 23, 2022

I also see this with T150 on 0.7.0 on archlinux. The wheel moves during the test, but I'm also not seeing any values on the controls tab except hat (even though jstest-gtk shows it just fine.

@berarma
Copy link
Owner

berarma commented Jan 24, 2022

The controls tab won't show wheel rotation when doing tests, I thought it wouldn't be needed. I didn't think too much about it honestly. This is easy to fix.

The test code isn't registering wheel position values during the tests and I don't know why because it's working before and after the tests, doesn't it?

@amalon
Copy link

amalon commented Jan 24, 2022

@berarma: No, I mean it isn't seeing any values before/after test either. I've hacked around the udev rules apparently not applying (i haven't debugged why yet) with

sudo chmod 666 enable_autocenter autocenter gain range

yet it clearly is seeing button inputs during the test, but not showing them in gui, nor the values of the axes. Sounds like that is the reason for the test failing.

@berarma
Copy link
Owner

berarma commented Jan 24, 2022

Ah, OK.

Please, try evtest. It should show a list of devices including your wheel. Select it and see which events does it generate when acting on it.

@amalon
Copy link

amalon commented Jan 25, 2022

evtest detects events for all the wheal actions I can find (except the mode button):

wheel (-32768 .. 32767):

Event: time 1643113194.467179, type 3 (EV_ABS), code 8 (ABS_WHEEL), value -837

gas pedal (0 .. 1023):

Event: time 1643113214.046254, type 3 (EV_ABS), code 9 (ABS_GAS), value 0

brake pedal (0 .. 1023):

Event: time 1643113226.027701, type 3 (EV_ABS), code 10 (ABS_BRAKE), value 0

gear switch paddles:

Event: time 1643113238.923196, type 1 (EV_KEY), code 336 (BTN_GEAR_DOWN), value 1
Event: time 1643113238.923196, -------------- SYN_REPORT ------------
Event: time 1643113239.073134, type 1 (EV_KEY), code 336 (BTN_GEAR_DOWN), value 0
Event: time 1643113239.073134, -------------- SYN_REPORT ------------
Event: time 1643113239.693158, type 1 (EV_KEY), code 337 (BTN_GEAR_UP), value 1
Event: time 1643113239.693158, -------------- SYN_REPORT ------------
Event: time 1643113239.781077, type 1 (EV_KEY), code 337 (BTN_GEAR_UP), value 0
Event: time 1643113239.781077, -------------- SYN_REPORT ------------

hat buttons (-1, 0, 1, oversteer does show all these correctly):

Event: time 1643113309.819898, type 3 (EV_ABS), code 16 (ABS_HAT0X), value -1
Event: time 1643113310.225900, type 3 (EV_ABS), code 17 (ABS_HAT0Y), value -1

and buttons (excluding SYN_REPORT and up events which do work):

Event: time 1643113414.483119, type 1 (EV_KEY), code 310 (BTN_TL), value 1
Event: time 1643113415.357118, type 1 (EV_KEY), code 311 (BTN_TR), value 1
Event: time 1643113416.499117, type 1 (EV_KEY), code 314 (BTN_SELECT), value 1
Event: time 1643113417.101036, type 1 (EV_KEY), code 315 (BTN_START), value 1
Event: time 1643113417.946974, type 1 (EV_KEY), code 288 (BTN_TRIGGER), value 1
Event: time 1643113418.522954, type 1 (EV_KEY), code 307 (BTN_NORTH), value 1
Event: time 1643113418.990917, type 1 (EV_KEY), code 308 (BTN_WEST), value 1
Event: time 1643113419.374907, type 1 (EV_KEY), code 305 (BTN_EAST), value 1
Event: time 1643113419.738940, type 1 (EV_KEY), code 304 (BTN_SOUTH), value 1
Event: time 1643113420.802840, type 1 (EV_KEY), code 312 (BTN_TL2), value 1
Event: time 1643113421.262823, type 1 (EV_KEY), code 313 (BTN_TR2), value 1

and intermittent ABS_RZ codes that I don't know what they're coming from (ignoring SYN_REPORT):

Event: time 1643113466.532792, type 3 (EV_ABS), code 5 (ABS_RZ), value 1
Event: time 1643113466.534742, type 3 (EV_ABS), code 5 (ABS_RZ), value 0
Event: time 1643113490.603667, type 3 (EV_ABS), code 5 (ABS_RZ), value 3
Event: time 1643113490.605662, type 3 (EV_ABS), code 5 (ABS_RZ), value 0
Event: time 1643113497.065347, type 3 (EV_ABS), code 5 (ABS_RZ), value 9
Event: time 1643113497.067369, type 3 (EV_ABS), code 5 (ABS_RZ), value 0

@berarma
Copy link
Owner

berarma commented Jan 25, 2022

Thanks!

It's the first time I see those events used in a wheel, despite their name.

ABS_RZ should be the clutch. Don't you have a clutch pedal?

I guess you're using scarburato's driver. Can you test the same without that driver installed?

@amalon
Copy link

amalon commented Jan 25, 2022

Yeh, no clutch pedal unfortunately.

Yes, using scarburato's driver (via AUR). Without the driver oversteer gets the events it expects (though they are muddled up and not in the correct range, e.g. its only in range of steering far to the left of center, and brakes/accel are swapped, and FFB doesn't work when running test, see below).

Exception in thread Thread-6 (test1):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.10/site-packages/oversteer/test.py", line 129, in test1
    left_effect = self.create_left_effect(0)
  File "/usr/lib/python3.10/site-packages/oversteer/test.py", line 67, in create_left_effect
    left_effect.id = self.input_device.upload_effect(left_effect)
  File "/usr/lib/python3.10/site-packages/evdev/device.py", line 353, in upload_effect
    ff_id = _input.upload_effect(self.fd, data)
OSError: [Errno 38] Function not implemented

@berarma
Copy link
Owner

berarma commented Jan 26, 2022

@scarburato, couldn't your driver use the same axes that the device reports? The axes shouldn't change depending on the driver used, or it would be like having a new device with the same identifier. The same for the range of values of each axis.

@berarma berarma added the help wanted Extra attention is needed label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants