linux-enable-ir-emitter: systemd hangs

Describe the bug

After the program successfully generated driver, the configure program didn’t stop. So I just kill the program by pressing Control+C, and it works even I reboot my laptop.

But when the laptop wake up from S3 Sleep State, the ir emitter cannot work correctly. I must use sudo linux-enable-ir-emitter run to re run it.

How to reproduce

> sudo linux-enable-ir-emitter -v -d /dev/video2 configure                      
    
INFO: Ensure to not use the camera during the execution.
INFO: Warning to do not kill the process !
Is the ir emitter flashing (not just turn on) ? Yes/No ? No 
DEBUG: Computing the resolution control.
DEBUG: Minimum not consistent, it will be ignored.
DEBUG: current: 0 0
DEBUG: maximum: 2 100
DEBUG: resolution: 1 50
DEBUG: unit: 13 selector: 14
DEBUG: new current: 1 50
Is the ir emitter flashing (not just turn on) ? Yes/No ? Yes
INFO: The driver has been successfully generated.

Additional info

  • Computer (or camera) model: Bus 001 Device 002: ID 13d3:5419 IMC Networks Integrated Camera
  • Version of linux-enable-ir-emitter: 4.5.0

Status of systemd service:

linux-enable-ir-emitter.service - enable the infrared emitter
     Loaded: loaded (/usr/lib/systemd/system/linux-enable-ir-emitter.service; enabled; preset: disabled)
     Active: inactive (dead)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

I add multi-user.target to WantedBy, I think it is correct.

[Unit]
Description = enable the infrared emitter
After = suspend.target hybrid-sleep.target hibernate.target suspend-then-hibernate.target

[Service]
Type = oneshot
ExecStartPre = /sbin/modprobe uvcvideo
ExecStart = /usr/bin/linux-enable-ir-emitter run

[Install]
WantedBy = multi-user.target suspend.target sleep.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

That makes sens, there were a dependency loop, I think.

Could you also test this one please :

[Unit]
Description = enable the infrared emitter
After=suspend.target sleep.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

[Service]
Type = oneshot
ExecStartPre = /sbin/modprobe uvcvideo
ExecStart = /usr/bin/linux-enable-ir-emitter run

[Install]
WantedBy=multi-user.target

It is more “correct”

It not works.

I’ve tried something in #115. In the PR there is a comment with a link to download the tarball that contains the (possible) fix. Could you please test this version? Thank you

systemd hangs is fixed, but it not start after suspend.

I deleted multi-user.target in After, it is fixed.

[Unit]
Description = enable the infrared emitter
After = suspend.target hybrid-sleep.target hibernate.target suspend-then-hibernate.target

[Service]
Type = oneshot
ExecStartPre = /sbin/modprobe uvcvideo
ExecStart = /usr/bin/linux-enable-ir-emitter run

[Install]
WantedBy = suspend.target hybrid-sleep.target hibernate.target suspend-then-hibernate.target

sudo linux-enable-ir-emitter boot enable

Yes

For workaround, I create and script:

# > /lib/systemd/system-sleep/linux-enable-ir-emitter

#!/bin/sh

case $1 in
    post) /usr/bin/linux-enable-ir-emitter run  ;;
esac

It’s works for me.

Unfortunately, I really don’t have time to look at that now, it will only be in July