linux-enable-ir-emitter icon indicating copy to clipboard operation
linux-enable-ir-emitter copied to clipboard

Configuration fails on Lenovo IdeaPad Pro 5 14AHP9

Open vonaviv opened this issue 7 months ago • 7 comments

Before opening the issue

Ouput of cat /var/local/log/linux-enable-ir-emitter/linux-enable-ir-emitter.log

[17:37:02] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[17:37:02] [INFO] Ensure to not use the camera during the execution.
[17:37:04] [INFO] Configuring the camera /dev/video2.
[17:37:41] [ERROR] Impossible to reset the instruction: unit: 4, selector: 2, control: 0 32.
[17:37:41] [INFO] Please shutdown your computer, then boot and retry.
[17:37:41] [INFO] Please retry in manual mode by adding the '-m' option.
[17:37:41] [ERROR] The configuration failed.
[17:37:41] [INFO] Do not hesitate to visit the GitHub!
[17:37:41] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[17:38:55] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[17:38:55] [INFO] Ensure to not use the camera during the execution.
[17:38:57] [INFO] Configuring the camera /dev/video2.
[17:40:13] [ERROR] Impossible to reset the instruction: unit: 4, selector: 3, control: 0.
[17:40:13] [INFO] Please shutdown your computer, then boot and retry.
[17:40:13] [INFO] Please retry in manual mode by adding the '-m' option.
[17:40:13] [ERROR] The configuration failed.
[17:40:13] [INFO] Do not hesitate to visit the GitHub!
[17:40:13] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[17:40:29] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[17:40:29] [INFO] Ensure to not use the camera during the execution.
[17:40:30] [INFO] Configuring the camera /dev/video2.
[17:40:43] [ERROR] Impossible to reset the instruction: unit: 4, selector: 4, control: 0 0.
[17:40:43] [INFO] Please shutdown your computer, then boot and retry.
[17:40:43] [INFO] Please retry in manual mode by adding the '-m' option.
[17:40:43] [ERROR] The configuration failed.
[17:40:43] [INFO] Do not hesitate to visit the GitHub!
[17:40:43] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[17:40:48] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[17:40:48] [INFO] Ensure to not use the camera during the execution.
[17:40:49] [INFO] Configuring the camera /dev/video2.
[17:42:36] [ERROR] Impossible to reset the instruction: unit: 4, selector: 5, control: 0 0.
[17:42:36] [INFO] Please shutdown your computer, then boot and retry.
[17:42:36] [INFO] Please retry in manual mode by adding the '-m' option.
[17:42:36] [ERROR] The configuration failed.
[17:42:36] [INFO] Do not hesitate to visit the GitHub!
[17:42:36] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[17:43:57] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[17:43:57] [INFO] Ensure to not use the camera during the execution.
[17:43:57] [INFO] Configuring the camera /dev/video2.
[17:44:18] [ERROR] Impossible to reset the instruction: unit: 4, selector: 6, control: 1.
[17:44:18] [INFO] Please shutdown your computer, then boot and retry.
[17:44:18] [INFO] Please retry in manual mode by adding the '-m' option.
[17:44:18] [ERROR] The configuration failed.
[17:44:18] [INFO] Do not hesitate to visit the GitHub!
[17:44:18] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[17:46:43] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[17:46:43] [INFO] Ensure to not use the camera during the execution.
[17:46:43] [INFO] Configuring the camera /dev/video2.
[17:46:48] [ERROR] Impossible to reset the instruction: unit: 4, selector: 7, control: 1.
[17:46:48] [INFO] Please shutdown your computer, then boot and retry.
[17:46:48] [INFO] Please retry in manual mode by adding the '-m' option.
[17:46:48] [ERROR] The configuration failed.
[17:46:48] [INFO] Do not hesitate to visit the GitHub!
[17:46:48] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[17:54:06] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[17:54:06] [INFO] Ensure to not use the camera during the execution.
[17:54:08] [INFO] Configuring the camera /dev/video2.
[17:54:47] [ERROR] Impossible to reset the instruction: unit: 4, selector: 8, control: 3.
[17:54:47] [INFO] Please shutdown your computer, then boot and retry.
[17:54:47] [INFO] Please retry in manual mode by adding the '-m' option.
[17:54:47] [ERROR] The configuration failed.
[17:54:47] [INFO] Do not hesitate to visit the GitHub!
[17:54:47] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[17:57:14] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[17:57:14] [INFO] Ensure to not use the camera during the execution.
[17:57:16] [INFO] Configuring the camera /dev/video2.
[17:58:10] [INFO] Please retry in manual mode by adding the '-m' option.
[17:58:10] [ERROR] The configuration failed.
[17:58:10] [INFO] Do not hesitate to visit the GitHub!
[17:58:10] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[17:58:21] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[17:58:21] [INFO] Ensure to not use the camera during the execution.
[17:58:22] [INFO] Configuring the camera /dev/video2.
[19:42:09] [INFO] Please retry in manual mode by adding the '-m' option.
[19:42:09] [ERROR] The configuration failed.
[19:42:09] [INFO] Do not hesitate to visit the GitHub!
[19:42:09] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[19:42:19] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[19:42:19] [INFO] Ensure to not use the camera during the execution.
[19:42:21] [INFO] Configuring the camera /dev/video2.
[19:43:13] [INFO] Please retry in manual mode by adding the '-m' option.
[19:43:13] [ERROR] The configuration failed.
[19:43:13] [INFO] Do not hesitate to visit the GitHub!
[19:43:13] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md
[19:45:27] [INFO] Tweaking the camera /dev/video2
[19:45:27] [INFO] Caution, you could break the camera.
[19:55:26] [INFO] Tweaking the camera /dev/video2
[19:55:26] [INFO] Caution, you could break the camera.
[19:58:22] [WARN] Invalid value for the control.
[19:58:24] [WARN] The instruction unit 4 selector 2 is disabled.
[19:58:35] [INFO] Tweaking the camera /dev/video2
[19:58:35] [INFO] Caution, you could break the camera.
[20:13:58] [INFO] Stand in front of and close to the camera and make sure the room is well lit.
[20:13:58] [INFO] Ensure to not use the camera during the execution.
[20:14:00] [INFO] Configuring the camera /dev/video2.
[20:15:57] [INFO] Please retry in manual mode by adding the '-m' option.
[20:15:57] [ERROR] The configuration failed.
[20:15:57] [INFO] Do not hesitate to visit the GitHub!
[20:15:57] [INFO] https://github.com/EmixamPP/linux-enable-ir-emitter/blob/master/docs/README.md

Output of sudo linux-enable-ir-emitter tweak

[ WARN:[email protected]] global cap_v4l.cpp:913 open VIDEOIO(V4L2:/dev/video3): can't open camera by index
[ WARN:[email protected]] global cap.cpp:478 open VIDEOIO(V4L2): backend is generally available but can't be used to capture by index
[INFO] Tweaking the camera /dev/video2
[INFO] Caution, you could break the camera.
0) unit: 4, selector: 2, control: 0 32 [disable]
1) unit: 4, selector: 3, control: 0 [disable]
2) unit: 4, selector: 4, control: 0 0 [disable]
3) unit: 4, selector: 5, control: 0 0 [disable]
4) unit: 4, selector: 6, control: 1 [disable]
5) unit: 4, selector: 7, control: 1 [disable]
6) unit: 4, selector: 8, control: 3 [disable]
7) unit: 4, selector: 9, control: 0 [idle]
8) unit: 5, selector: 2, control: 0 [idle]
9) unit: 5, selector: 4, control: 53 0 [idle]
10) unit: 7, selector: 2, control: 1 0 0 0 0 0 0 96 97 2 0 0 0 0 0 [idle]
11) unit: 7, selector: 3, control: 16 0 0 0 0 0 0 0 0 0 0 [idle]
12) unit: 7, selector: 6, control: 1 3 1 0 0 0 0 0 0 [idle]
13) unit: 7, selector: 9, control: 0 0 0 0 [idle]
14) exit
Choose an instruction to tweak:

Output of v4l2-ctl --list-devices

Integrated RGB Camera: Integrat (usb-0000:63:00.4-1):
        /dev/video0
        /dev/video1
        /dev/video2
        /dev/video3
        /dev/media0
        /dev/media1

Ouput of for dev in /dev/video*; do echo $dev && v4l2-ctl -d $dev --list-formats-ext; done

ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'MJPG' (Motion-JPEG, compressed)
                Size: Discrete 1280x720
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 960x540
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 320x180
                        Interval: Discrete 0.033s (30.000 fps)
        [1]: 'YUYV' (YUYV 4:2:2)
                Size: Discrete 1280x720
                        Interval: Discrete 0.100s (10.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 960x540
                        Interval: Discrete 0.067s (15.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 320x180
                        Interval: Discrete 0.033s (30.000 fps)
/dev/video1
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

/dev/video2
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'GREY' (8-bit Greyscale)
                Size: Discrete 640x360
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
/dev/video3
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

Output of ls -l /dev/v4l/by-path

lrwxrwxrwx 1 root root 12 May 24 19:53 pci-0000:63:00.4-usb-0:1:1.0-video-index0 -> ../../video0
lrwxrwxrwx 1 root root 12 May 24 19:53 pci-0000:63:00.4-usb-0:1:1.0-video-index1 -> ../../video1
lrwxrwxrwx 1 root root 12 May 24 19:53 pci-0000:63:00.4-usb-0:1:1.2-video-index0 -> ../../video2
lrwxrwxrwx 1 root root 12 May 24 19:53 pci-0000:63:00.4-usb-0:1:1.2-video-index1 -> ../../video3
lrwxrwxrwx 1 root root 12 May 24 19:53 pci-0000:63:00.4-usbv2-0:1:1.0-video-index0 -> ../../video0
lrwxrwxrwx 1 root root 12 May 24 19:53 pci-0000:63:00.4-usbv2-0:1:1.0-video-index1 -> ../../video1
lrwxrwxrwx 1 root root 12 May 24 19:53 pci-0000:63:00.4-usbv2-0:1:1.2-video-index0 -> ../../video2
lrwxrwxrwx 1 root root 12 May 24 19:53 pci-0000:63:00.4-usbv2-0:1:1.2-video-index1 -> ../../video3

Give more information if you have I can see IR emitter turn on and step-wise increase intensity as different configuration are applied, but it never blinks. In the manual mode it can blink only one time.

Additional info

  • Computer (or camera) model: Lenovo IdeaPad Pro 5 14AHP9
  • Linux distribution: Ubuntu 25.04
  • Version of linux-enable-ir-emitter: 6.1.1

vonaviv avatar May 24 '25 18:05 vonaviv

sudo linux-enable-ir-emitter tweak , enter 12, then input 1 3 2 0 0 0 0 0 0

After that, maybe you will see your emitter blinking

EmixamPP avatar May 24 '25 18:05 EmixamPP

sudo linux-enable-ir-emitter tweak , enter 12, then input 1 3 2 0 0 0 0 0 0

After that, maybe you will see your emitter blinking

This worked! ✨ Thanks a lot for such a fast response! There is only one issue left, which is that I need to run sudo linux-enable-ir-emitter run every time after using the IR emitter to see the blinking again.

vonaviv avatar May 24 '25 22:05 vonaviv

Do you really mean each time you are using the IR emitter or you are putting the computer to sleep? Because for that, you also need to enable the linux-enable-ir-emitter systemd service as explained in the readme

EmixamPP avatar May 25 '25 07:05 EmixamPP

Each time with no sleep in-between. For example when I run sudo howdy test the IR emotter blinks, then I stop the test and directly start it again, then there is no blinking unless I ran sudo linux-enable-ir-emitter run beforehand.

vonaviv avatar May 25 '25 08:05 vonaviv

After I restart the machine the IR emitter works directly, but again after a single use I need to rerun sudo linux-enable-ir-emitter run for IR emitter to work.

vonaviv avatar May 26 '25 09:05 vonaviv

Resolving that issue is unfortunately not that easy, since I am hitting the user api limitation offered by Linux, this mean that I will need to provide a Kernel solution. I am currently working on and searching a good and sharable way to do it, when I have time.

Some people simply setup a script that execute the run command every X minutes/secondes. But I agree that is more a trick than a proper solution.

EmixamPP avatar May 27 '25 19:05 EmixamPP

For the ones who are looking for a solution, this how I solved the issue with Systemd:

  1. Check if you have a Service Unit. There should be file /etc/systemd/system/linux-enable-ir-emitter.service with:
[Unit]
Description = enable the infrared emitter
After = suspend.target sleep.target hybrid-sleep.target hibernate.target suspend-then-hibernate.target

[Service]
Type = oneshot
ExecStartPre = modprobe uvcvideo
ExecStartPre= sleep 1
ExecStart = linux-enable-ir-emitter --verbose run

[Install]
WantedBy = multi-user.target suspend.target sleep.target hybrid-sleep.target hibernate.target suspend-then-hibernate.target
  1. Create a Timer Unit. Create file /etc/systemd/system/linux-enable-ir-emitter.timer with:
[Unit]
Description = Timer for enabling the infrared emitter every 15 seconds

[Timer]
OnUnitActiveSec=15s
Unit=linux-enable-ir-emitter.service
AccuracySec=1s

[Install]
WantedBy=timers.target

3. Enable and Start the Timer

sudo systemctl daemon-reload
sudo systemctl enable linux-enable-ir-emitter.timer
sudo systemctl start linux-enable-ir-emitter.timer

Now every 15 s linux-enable-ir-emitter run will be rerun and the emitter will blink even without suspending or restarting the laptop.

vonaviv avatar Jun 08 '25 15:06 vonaviv

I assume you are using it in combination with Howdy

In all file returned by grep -rl howdy /etc/pam.d, add the following line before the one mentioning "howdy":

auth optional pam_exec.so /usr/local/bin/linux-enable-ir-emitter run

EmixamPP avatar Sep 07 '25 15:09 EmixamPP

Hey there. I have got virtually the same camera as vonaviv (at least my outputs from sudo linux-enable-ir-emitter tweak, v4l2-ctl --list-devices, for dev in /dev/video*; do echo $dev && v4l2-ctl -d $dev --list-formats-ext; done and ls -l /dev/v4l/by-path are the same) although I have a Lenovo Yoga 7 2in1 14AHP9.

I am able to get the IR Emitter to turn on, by modifying instruction 8 with the tweak command. However I am unable to get to a "blinking" state.

Also replecating the settings from vonaviv did not work unfortunately :/

Any ideas on what I could try?

Here is my output from linux-enable-ir-emitter tweak


[ WARN:[email protected]] global cap_v4l.cpp:914 open VIDEOIO(V4L2:/dev/video3): can't open camera by index
[ WARN:[email protected]] global cap.cpp:478 open VIDEOIO(V4L2): backend is generally available but can't be used to capture by index
[INFO] Tweaking the camera /dev/video2
[INFO] Caution, you could break the camera.
0) unit: 4, selector: 2, control: 0 32 [disable]
1) unit: 4, selector: 3, control: 0 [disable]
2) unit: 4, selector: 4, control: 0 0 [disable]
3) unit: 4, selector: 5, control: 0 0 [disable]
4) unit: 4, selector: 6, control: 1 [idle]
5) unit: 4, selector: 7, control: 1 [idle]
6) unit: 4, selector: 8, control: 3 [idle]
7) unit: 4, selector: 9, control: 0 [idle]
8) unit: 5, selector: 2, control: 0 [start]
9) unit: 5, selector: 4, control: 114 0 [idle]
10) unit: 7, selector: 2, control: 1 0 0 0 0 0 0 96 97 2 0 0 0 0 0 [idle]
11) unit: 7, selector: 3, control: 16 0 0 0 0 0 0 0 0 0 0 [idle]
12) unit: 7, selector: 6, control: 1 3 1 0 0 0 0 0 0 [idle]
13) unit: 7, selector: 9, control: 0 0 0 0 [idle]
14) exit

Stretox avatar Oct 16 '25 18:10 Stretox

@Stretox you can try:

In the tweak command, enter 12, then 1 3 2 0 0 0 0 0 0, if the video preview is blinking, enter 12 again, and type start (to enable it when linux-enable-ir-emitter run is executed, e.g. by the systemd service or with my comment about howdy and pam above)

EmixamPP avatar Oct 16 '25 18:10 EmixamPP

OMG Thank you so much. Didn't realize I needed to do this. You are a Wizard! 🧙

Stretox avatar Oct 16 '25 18:10 Stretox

Ahah no problem! Mostly because I saw so many camera instructions since I started this project 😄

EmixamPP avatar Oct 16 '25 19:10 EmixamPP