Skip to content

Battery status freeze #193

Description

@bioxz

Description

When using headsetcontrol on a regular basis (e.g. in scripts) it tends to freeze after the device name output or directly when using the short output after a some executions. This was already reported in #125, but doesn't seem to be limited to a specific device, in my case it's a SteelSeries Arctis 9. Instead of

Found SteelSeries Arctis 9!
Battery: 31%
Success!

I just get a

Found SteelSeries Arctis 9!

and no further output. Sometimes this happens after the second or third execution of headsetcontrol, sometimes it works for 100 executions without a problem.

This makes projects like the mentioned headsetcontrol-notificationd unusable, as the script locks up in the background.

If one instance of headsetcontrol hangs after requesting the battery status, all other instances querying the battery status will freeze as well. Terminating all instances and waiting for a bit seems to solve the problem and a new instance of headsetcontrol will display the battery status again -- until a future request will freeze again.

System information:

Debian stable
Linux 5.10.70
udev 247.3
libhidapi 0.10.1

On which OS does the problem happen?

Linux

Activity

  1. Sapd commented on Nov 17, 2021

    @Sapd
    Owner

    Possibly HID hangs then because it is waiting for data, but the headset doesn't provide it.

    We can easily fix it by adding a timeout (maybe even with a --timeout) parameter

  2. bioxz commented on Nov 17, 2021

    @bioxz
    Author

    That sounds like a good idea. Please let me know if I can provide more specific debug information or test an implementation.

  3. Sapd commented on Nov 19, 2021

    @Sapd
    Owner

    Will probably work on it next week (lockdown announced anyway...)

  4. Sapd commented on Nov 24, 2021

    @Sapd
    Owner

    You can try the branch timeout-fix now
    E.g.
    git pull
    git checkout timeout-fix

    then delete the build folder and rebuild.

    Default is 5 secounds, you can change it with the new --timeout millisecounds parameter.
    On timeout it will return an error, it may need to be handled by the notification application you use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions