Code Monkey home page Code Monkey logo

linux-enable-ir-emitter's Introduction

linux-enable-ir-emitter

Provides support for infrared cameras that are not directly enabled out-of-the box (at the very least, the kernel must recognise your infrared camera). The purpose of this repository is to activate the emitter when the infrared camera is called.

linux-enable-ir-emitter can automatically configure almost any (UVC) infrared emitter.

Installation

Download the latest linux-enable-ir-emitter-x.x.x.systemd.x86-64.tar.gz. Then execute:

sudo tar -C / --no-same-owner -m -h -vxzf linux-enable-ir-emitter*.tar.gz
sudo systemctl enable --now linux-enable-ir-emitter

We also support the OpenRC service manager. See docs/manual-build.md for information on how to build the project.

To uninstall the tool, see docs/uninstallation.md for the instructions.

How to enable your infrared emitter?

  1. Stand in front of and close to the camera and make sure the room is well lit.
  2. Ensure to not use the camera during the execution.
  3. Be patient, do not kill the process.
  4. Execute sudo linux-enable-ir-emitter configure.
    • If you have many emitters on the camera, specify it using the option --emitters. E.g. --emitters 2.
    • If you ir camera requires a specific resolution, specify it using the option --width and --height. E.g. --width 640 --height 360.
    • The tool should detect automatically your ir camera, but you can specify it using the option --device. E.g. --device /dev/video2; useful if you have multiple ir camera.
  5. You will see a video feedback, answer to the asked questions by pressing Y or N inside the window.
  6. Sometimes, it can request you to shut down, then boot and retry ($\neq$ reboot)

If you like the project, do not hesitate to star the repository to support me, thank you!

If the configuration failed:

  1. But you saw the ir emitter flashing, reboot and switch to manual mode by using the --manual option.
  2. Also, try the exhaustive search by using the --limit -1 option (caution: this may take several hours; do not combine it --manual).
  3. Otherwise, feel free to open an issue, but please consult the docs first.

Any criticims, ideas and contributions are welcome!

How to tweak your camera?

Some cameras provide instrutions for changing the brightness of the ir emiter. You will need to find the corresponding instructions and the correct value manually. An instruction consists of X values between 0-255.

  1. Execute sudo linux-enable-ir-emitter tweak
    • If you ir camera requires a specific resolution, specify it using the option --width and --height. E.g. --width 640 --height 360.
    • The tool should detect automatically your ir camera, but you can specify it using the option --device. E.g. --device /dev/video2; useful if you have multiple ir camera.
  2. You will see a video feedback and a menu of the available instructions.
  3. Select one, then the initial and current value for the instructions, as well as the minimum and maximum values (if exists) are displayed.
  4. Input a new value and observe the video feedback to see the difference.
  5. If you made your camera unusable, it can request you to shut down, then boot and retry ($\neq$ reboot)

linux-enable-ir-emitter's People

Contributors

dependabot[bot] avatar diaoul avatar eeems avatar emixampp avatar felixhromadko avatar iyanmv avatar justintime4tea avatar renyuneyun avatar stkai avatar supdrewin avatar web-flow avatar xz-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

linux-enable-ir-emitter's Issues

Uncorrect command help


A configuration have been found. Here is what you can do:
- activate the emitter at system startup : 'linux-ir-emitter boot enable'
- manually activate the emitter for one session : 'linux-ir-emitter run'


These commands don't work and should be:
linux-enable-ir-emitter boot enable
linux-enable-ir-emitter boot run

New release

I have published what looks like the future version of the programme on the https://github.com/EmixamPP/linux-enable-ir-emitter/tree/pre-release branch.

This new version currently includes :

  • linux-enable-ir-emitter fix command : can reset the config file and uninstall chicony-ir-toggle
  • I tried to fix the unable to open a file descriptor error caused during boot. The problem is that the camera is not yet initialized and therefore not yet accessible. I've added the line ExecStartPre=/sbin/modprobe uvcvideo to the .service file. Since I don't have this problem, I can't test, I hope it works.

What I might consider adding: move the config file to the /etc folder.

My second announcement is that I am no longer using Manjaro and therefore I will not be able to properly maintain the AUR package. @komex will you take care of updating the package for new releases? (If so, don't worry I'll let you know when it's ready).

The configuration has failed.

After installing linux-enable-ir-emitter, I entered the following for setting, but an unknown error occurred.

$ sudo linux-enable-ir-emitter -v configure
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (1100) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? No
INFO: Warning to do not kill the processus !
ERROR: The configuration has failed.
INFO: Do not hesitate to open an issue on GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter

I remember having the same problem a while ago when another device(iPhone) was connected via USB, but this time it doesn't seem to be the problem because there is no connection except for the power line.

PS. I accidentally found out that there is no 'lsusb' command, installed usbutils(ArchLinux) and tried it, and confirmed that it works.

Not working on ThinkPad X1 Carbon after previously working

NOTE: this is an odd one, originally it worked however I think after running some howdy test and maybe linux-enable-ir-emitter test and CTRL+Cing midway the configuration does not work anymore and I cannot get the IR emitter to work, even after a reboot.

Which device did you used ?
ThinkPad X1 Carbon Gen 9

Ouput of

configure command output
INFO: Warning to do not kill the processus !
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (2075) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (1053) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (616) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: unit: 13, selector: 14, curr control: ['2', '20'], max control: ['2', '100'], res control: ['1', '10']
DEBUG: unit: 14, selector: 2, curr control: ['1', '0', '0', '0', '0', '0', '0', '16', '39', '0', '0', '0', '0', '0', '0'], max control: ['7', '0', '0', '0', '0', '0', '0', '200', '20', '5', '0', '0', '0', '0', '0'], res control: ['0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0']
DEBUG: unit: 14, selector: 6, curr control: ['1', '3', '1', '0', '0', '0', '0', '0', '0'], max control: ['1', '3', '3', '0', '0', '0', '0', '0', '0'], res control: ['0', '0', '1', '0', '0', '0', '0', '0', '0']
DEBUG: control: ['1', '3', '2', '0', '0', '0', '0', '0', '0']
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (2075) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (1053) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (616) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: control: ['1', '3', '3', '0', '0', '0', '0', '0', '0']
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (2075) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (1053) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /build/opencv/src/opencv-4.5.4/modules/videoio/src/cap_gstreamer.cpp (616) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? n
ERROR: The configuration has failed.
INFO: Do not hesitate to open an issue on GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter/wiki

Output of v4l2-ctl --list-devices

Integrated Camera: Integrated C (usb-0000:00:14.0-4):
	/dev/video0
	/dev/video1
	/dev/video2
	/dev/video3

Ouput of v4l2-ctl -d /dev/video2 --list-formats-ext

v4l2 device output
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)

Additional info

  • Distro: Arch Linux
  • Version: 5.14.16-arch1-1
  • Version of linux-enable-ir-emitter: 3.2.2
  • How did you install linux-enable-ir-emitter: AUR

Your camera configuration is not in the database shared by the git community.

Output of sudo linux-enable-ir-emitter full, following the steps given here

The capturing is finished, make sure the camera is connected to the host os. Press enter when it's done
Ioctl error code: -1, errno: 2
The device does not support the given control or the specified extension unit could not be found.
Ioctl error code: -1, errno: 2
The device does not support the given control or the specified extension unit could not be found.
Did you see the ir emitter flashing ? Yes/No ? Yes
Your camera configuration is not in the database shared by the git community.
Could you please take 5 minutes to copy and paste the contents of 'linux-enable-ir-emitter manual' into a new issue: https://github.com/EmixamPP/linux-enable-ir-emitter/issues.
Thank you for the others !

Output of sudo linux-enable-ir-emitter manual

#Caution: any manual modification of this file may corrupt the operation of the>
#Please consult https://github.com/EmixamPP/linux-enable-ir-emitter/wiki/Manual>
#If you currupt the config file: execute 'linux-enable-ir-emitter fix config' t>

!!python/object:IrConfiguration.IrConfiguration
_data:
- '0x1'
- '0x0'
- '0x0'
- '0x0'
_selector: '0x9'
_unit: '0x7'
_videoPath: /dev/video2

New utility software

I have just published on a new branch a new utility that allows, in addition to before, to capture packets from the bus with wireshark. We just have to open the Windows VM.

@renyuneyun I noticed that your AUR package is still not up to date with the changes we discussed over 2 weeks ago. So I think in the end, it would be easier if I manage this AUR package.

Install error + configuration failed

Describe the bug

The following error is shown after running install.sh

install: cannot stat 'sources/autocomplete/%{name}': No such file or directory

Upon running sudo linux-enable-ir-emitter configure, the IR did not start flashing. I answered No about 10 times (and I don't have 10 cameras) and each time got:

Ioctl error code: -1, errno: 84
Illegal byte sequence.
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? No

I saw my regular camera indicator flash the last several times (but not the IR camera).
How to reproduce

I followed the instructions from the readme (version b2172cf)

Additional info

  • Distro: Ubuntu
  • Version: 20.04.3 LTS x86_64 with 5.10.0-1051-oem kernel
  • Version of linux-enable-ir-emitter: 3.2.3
  • Version of python3: 3.8.10
  • How did you install linux-enable-ir-emitter: bash

Boot no longer works with Fedora 35 and Ubuntu 21.10

Today I tried with Ubuntu 21.10 and Fedora 35, the configuration process worked fine, IR leds activated and flashed OK, no issues.

Then activated boot enable, output was ok as well, nonetheless when booting the IR leds will never turn on, I reinstalled both distributions 2 times from scratch, same outcome.

This is very weird, because I have done this 20 times, always success at the first try, never a problem.

"launch improvement of the recognition of Windows Hello" not found

I'd like to improve to config for webcam on Lenovo X1C7. I've installed virtualbox and Windows 10 20.04 as guest and captured USB traffic.
Unfortunately I do not find step 8):

In the VM, go in the security options tab of the Windows settings and click on launch an improvement of the recognition of Windows Hello. A pop up is displayed and asks if we want to start the test, you can go back to Wireshark without having to go any further.

Maybe it's because I cannot setup Windows Hello Face?
Screenshot_20210105_145617

This webcam should be compatible to Windows Hello but I think it's the problem with the driver from virtual box...
How did you solve this?

However, I could capture some USB traffic:

Setup Data
    bmRequestType: 0x21
    bRequest: 1
    wValue: 0x0200
    wIndex: 1 (0x0001)
    wLength: 48
    Data Fragment: 01000207151605000000000000000000200000600900f40b0000c0e1e400070000000000000000000000000000000000

but I'm not sure if these are the default values and they will change if I launch an improvement of the recognition of Windows Hello?

Possibility to control emitters during authentication?

All Windows Hello cameras that i have come across have blinking IR emitters that do not necessarily sync with the camera framerate. Currently Howdy relies on analysing the darkness of frames to filter out these unlit frames. Filtering them out speeds up recognition as Howdy will only analyse well-lit frames that have a higher chance of success.

As you are much more knowledgable on the packets send to the camera from Windows Hello, do you think it would be possible to read the status of the emitters for each frame or even sync up this blinking with the camera?

Directory for saved configuration

I was trying to get updated to how to use this software, and figured out a saved configuration file needs to be generated/created first. One way to do so is to execute linux-enable-ir-emitter quick.
When drilling down to the source code, it looks like the generated configuration is saved to /usr/lib/linux-enable-ir-emitter/irConfig.yaml.

In my experience, the /usr/ directories are normally not modified by the user / user softwares, especially not for saving configuration files. Configuration files are usually saved under /etc/ or /var/lib/ (e.g. mysql/mariadb). Files under /etc/ are normally open for (admin) users to modify, and are normally human-friendly; files under /var/lib/ are normally not for the user to directly manipulate.
Though I have to admit there are some exceptions, particularly for apps in early development (e.g. mycroft).

I'm not an expert in that either, and there are no mandatory rules for that. Therefore, I'm bringing this up for discussion, and wait to see if others have better suggestions.

Error after installation

Hello,

I'm on Ubuntu 20.04, and I'm unable to use your tool.
The installation process sucess (I think), and show me that :

$ sudo bash installer.sh install
Requirement already satisfied: opencv-python in /usr/local/lib/python3.8/dist-packages (4.5.2.52)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (5.3.1)
Requirement already satisfied: numpy>=1.17.3 in /usr/local/lib/python3.8/dist-packages (from opencv-python) (1.20.3)
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 21.1.2; however, version 21.2.4 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
make: Entering directory '/home/*****/linux-enable-ir-emitter/sources/uvc'
make: Nothing to be done for 'all'.
make: Leaving directory '/home/*****/linux-enable-ir-emitter/sources/uvc'
install: creating directory '/usr/lib/linux-enable-ir-emitter'
install: creating directory '/usr/lib/linux-enable-ir-emitter/uvc'
'sources/uvc/get_query' -> '/usr/lib/linux-enable-ir-emitter/uvc/get_query'
'sources/uvc/len_query' -> '/usr/lib/linux-enable-ir-emitter/uvc/len_query'
'sources/uvc/set_query' -> '/usr/lib/linux-enable-ir-emitter/uvc/set_query'
'sources/uvc/execute_query.o' -> '/usr/lib/linux-enable-ir-emitter/uvc/execute_query.o'
install: creating directory '/usr/lib/linux-enable-ir-emitter/command'
'sources/command/boot.py' -> '/usr/lib/linux-enable-ir-emitter/command/boot.py'
'sources/command/configure.py' -> '/usr/lib/linux-enable-ir-emitter/command/configure.py'
'sources/command/fix.py' -> '/usr/lib/linux-enable-ir-emitter/command/fix.py'
'sources/command/__init__.py' -> '/usr/lib/linux-enable-ir-emitter/command/__init__.py'
'sources/command/manual.py' -> '/usr/lib/linux-enable-ir-emitter/command/manual.py'
'sources/command/run.py' -> '/usr/lib/linux-enable-ir-emitter/command/run.py'
'sources/command/test.py' -> '/usr/lib/linux-enable-ir-emitter/command/test.py'
'sources/globals.py' -> '/usr/lib/linux-enable-ir-emitter/globals.py'
'sources/IrConfiguration.py' -> '/usr/lib/linux-enable-ir-emitter/IrConfiguration.py'
'sources/linux-enable-ir-emitter.py' -> '/usr/lib/linux-enable-ir-emitter/linux-enable-ir-emitter.py'
'sources/linux-enable-ir-emitter.service' -> '/usr/lib/systemd/system/linux-enable-ir-emitter.service'

But when I try a command (sudo linux-enable-ir-emitter -h, or sudo linux-enable-ir-emitter configure), an error occur :

Traceback (most recent call last):
  File "/usr/bin/linux-enable-ir-emitter", line 20, in <module>
    logging.basicConfig(encoding='utf-8', format='%(levelname)s: %(message)s', level=logging.INFO)
  File "/usr/lib/python3.8/logging/__init__.py", line 2009, in basicConfig
    raise ValueError('Unrecognised argument(s): %s' % keys)
ValueError: Unrecognised argument(s): encoding

Is it a bug in your program, or a misconfiguration in pip ? And how could I repair that ?
Thanks in advance

Auto config

On the auto-config branch, you can see an auto directory, as well as inside a python script auto-enable-ir-emitter.py that will test each configuration of config.json. If the C script runs without error, the user should confirm that the infrared emitter is working. If yes, the python script proposes to create the systemd service.

I will test the program a few more days and if there are no problems I will merge it with the master
Edit: the branches have been merged

@renyuneyun
You proposed to make an AUR package, personally I'm on Manjaro but I don't know if I'm going to be there for long, so it might be better if you took care of it. I don't know if I should create a new repo? Or this one is enough and I put you as a collaborator? Or we use your repo, I don't mind.

Any other help or comment is of course welcome.

Dell Inspiron 15 5567

Hello!
I am using a Dell Inspiron 15 5567 laptop with a windows hello compatible camera. I would like to make it work on linux (Arch Linux or Ubuntu) I followed every step in your guide and I don't get any errors but my IR emitter not turning on. Here is the output of lsusb and v4l2-ctl --list-devices:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 0cf3:e005 Qualcomm Atheros Communications 
Bus 001 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 003: ID 0bda:58c2 Realtek Semiconductor Corp. Integrated_Webcam_HD
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-5):
	/dev/video0
	/dev/video1

Can you please help me?

Thanks for your help in advance!

The configuration has failed.

  • After the new update, the IR broke, so I run
  • systemctl status linux-enable-ir-emitter.service
  • I saw a message saying config file is corrupted, please run linux-enable-ir-emitter fix config
  • I ran the command and run linux-enable-ir-emitter configure
  • however, it said configuration has failed. I tried restarting my computer, linux-enable-ir-emitter boot disable and run config command again but still fail.
  • Below is my log:

vuth@vuth-xps159500 Linux 5.14.2-1-MANJARO x86_64 21.1.3 Pahvo
~ >>> sudo linux-enable-ir-emitter configure
[ WARN:0] global /build/opencv/src/opencv-4.5.3/modules/videoio/src/cap_gstreamer.cpp (2056) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:0] global /build/opencv/src/opencv-4.5.3/modules/videoio/src/cap_gstreamer.cpp (1034) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /build/opencv/src/opencv-4.5.3/modules/videoio/src/cap_gstreamer.cpp (597) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
All frames were too dark, please check dark_threshold in config
Average darkness: 0.0, Threshold: 100.0
Face detection image too dark
[ WARN:0] global /build/opencv/src/opencv-4.5.3/modules/videoio/src/cap_gstreamer.cpp (2056) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:0] global /build/opencv/src/opencv-4.5.3/modules/videoio/src/cap_gstreamer.cpp (1034) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /build/opencv/src/opencv-4.5.3/modules/videoio/src/cap_gstreamer.cpp (597) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
All frames were too dark, please check dark_threshold in config
Average darkness: 0.0, Threshold: 100.0
Face detection image too dark
[sudo] password for vuth:
[ WARN:0] global /build/opencv/src/opencv-4.5.3/modules/videoio/src/cap_gstreamer.cpp (1081) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? no
INFO: Warning to do not kill the processus !
ERROR: The configuration has failed.
INFO: Do not hesitate to open an issue on GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter
~ >>> sudo linux-enable-ir-emitter configure [1]
[ WARN:0] global /build/opencv/src/opencv-4.5.3/modules/videoio/src/cap_gstreamer.cpp (1081) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? no
INFO: Warning to do not kill the processus !
ERROR: The configuration has failed.
INFO: Do not hesitate to open an issue on GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter

The login Keyring did not get unlocked when you logged into your computer

Hi, I used your script to enable the IR emitters with my laptop and Ubuntu 20.04, Howdy alone will not be able to, it works fine until I will reboot or shutdown the laptop, then at the next login after restarting, the white led from the camera will turn on and the IR emitters will stay off and of course face authentication will fail, any idea what could be the problem? Thanks

Alienware 17R4

If you had 'ERROR: Impossible to reset the control' message, give the DEBUG info displayed

DEBUG:

Ouput of linux-enable-ir-emitter -v -d /dev/videoX configure

script cannot access the device (Yes, I used sudo)
INFO: Ensure to not use the camera during the execution.
INFO: Warning to do not kill the process !
CRITICAL: Cannot access to /dev/video1
ERROR: The configuration has failed.

Output of v4l2-ctl --list-devices

Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-7):
        /dev/video0
        /dev/video1
        /dev/media0

Ouput of v4l2-ctl -d /dev/videoX --list-formats-ext

Nothing listed
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture


Additional info

  • Distro: Arch
  • Version: 5.18.12-arch1-1 1 SMP PREEMPT_DYNAMIC Fri, 15 Jul 2022 15:33:02 +0000 x86_64 GNU/Linux
  • Version of linux-enable-ir-emitter: 1:4.1.2-1
  • How did you install linux-enable-ir-emitter: AUR

Please NOTE: /dev/video0 is my regular (non-IR) integrated camera, /dev/video1 is the IR camera. If I try to configure /dev/video0, it just flashes my regular camera light, not the IR (which is red) so I know it's not working.

ImportError: libjsoncpp.so.24

When trying to run any command on the linux-enable-ir-emitter I get the following error:

Traceback (most recent call last):
File "/usr/bin/linux-enable-ir-emitter", line 8, in <module>
from command import boot, fix, manual, run, configure
File "/usr/lib/linux-enable-ir-emitter/command/manual.py", line 6, in <module>
from driver.Driver import Driver
File "/usr/lib/linux-enable-ir-emitter/driver/Driver.py", line 3, in <module>
import cv2 as cv
ImportError: libjsoncpp.so.24: cannot open shared object file: No such file or directory

Running Garuda Linux - Fresh Install

Lenovo Yoga14s (Slim 7) Configuration has failed

When I first configured this program, the infrared fill light flashed and red could be seen.

After I selected enable and restarted, the fill light could not be used.

After reinstalling the program, no red light is on when the configuration is found.

(I've tried it many times, but it doesn't seem to work)

Camera

Bus 003 Device 002: ID 04f2:b6cb Chicony Electronics Co., Ltd Integrated Camera

Which device did you used ?
Lenovo Yoga14s (Slim 7)

Ouput of linux-enable-ir-emitter --verbose configuration

configure command output
─>$ sudo linux-enable-ir-emitter -v configure
INFO: Warning to do not kill the process !
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (1356) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: unit: 13, selector: 14, curr control: ['2', '20'], max control: ['2', '100'], res control: ['1', '10']
DEBUG: unit: 14, selector: 2, curr control: ['1', '0', '0', '0', '0', '0', '0', '16', '39', '0', '0', '0', '0', '0', '0'], max control: ['7', '0', '0', '0', '0', '0', '0', '200', '20', '5', '0', '0', '0', '0', '0'], res control: ['0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0']
DEBUG: unit: 14, selector: 6, curr control: ['1', '3', '1', '0', '0', '0', '0', '0', '0'], max control: ['1', '3', '3', '0', '0', '0', '0', '0', '0'], res control: ['0', '0', '1', '0', '0', '0', '0', '0', '0']
DEBUG: control: ['1', '3', '2', '0', '0', '0', '0', '0', '0']
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (1356) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: control: ['1', '3', '3', '0', '0', '0', '0', '0', '0']
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (1356) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? n
ERROR: The configuration has failed.
INFO: Do not hesitate to open an issue on GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter/wiki

Output of v4l2-ctl --list-devices

╰─>$ sudo  v4l2-ctl --list-devices
Integrated Camera: Integrated C (usb-0000:00:14.0-1):
        /dev/video0
        /dev/video1
        /dev/video2
        /dev/video3
        /dev/media0
        /dev/media1

Ouput of v4l2-ctl -d /dev/video2 --list-formats-ext

v4l2 device output
╰─>$ v4l2-ctl -d /dev/video2 --list-formats-ext
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)

Additional info

  • Distro: Archlinux
  • Version: None
  • Version of linux-enable-ir-emitter: linux-enable-ir-emitter 3.2.5
  • How did you install linux-enable-ir-emitter: AUR->GIT

IR emitters work but keep red and get small frame. As windows hello, it should blink

Start

general

  • Device: XiaoXinPro-13ARE 2020
  • Situation: video0 work without IR. video2 work with IR keep red.
    The python script auto-config.py not work. I have read your README and run script. The last part I have not tried but I will in your way or other way.

The device name and path I got in windwos 10's Device Manager.

  • Integrated Camera USB\VID_04F2&PID_B67C&MI_00\7&26fcf372&1&0000
  • Integrated IR Camera USB\VID_04F2&PID_B67C&MI_02\7&26FCF372&1&0002

work

  • /dev/video0: max 1280x720 30fps. White light always on
  • /dev/video2: max 640x360 30 fps. Both white light and red light always on.

we used to talk about this in hodwy IR emitters not working on Dell Inspiron 5567 #543

unwork

  • /dev/video1
    [video4linux2,v4l2 @ 0x7fe514000c80] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device

  • /dev/video3
    /dev/video1: Inappropriate ioctl for device
    [video4linux2,v4l2 @ 0x7fc310000c80] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video3: Inappropriate ioctl for device

detail bash output

show all camera

$ v4l2-ctl --list-devices
Integrated Camera: Integrated C (usb-0000:03:00.4-2):
        /dev/video0
        /dev/video1
        /dev/video2
        /dev/video3

ffplay test

/dev/video0 and /dev/video2 play well. Other fail to open.

arch

$ ffplay /dev/video0
ffplay version n4.4 Copyright (c) 2003-2021 the FFmpeg developers
  built with gcc 10.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, video4linux2,v4l2, from '/dev/video0':B sq=    0B f=0/0   
  Duration: N/A, start: 5144.686043, bitrate: 147456 kb/s
  Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 147456 kb/s, 10 fps, 10 tbr, 1000k tbn, 1000k tbc
Switch subtitle stream from #-1 to #-1 vq=    0KB sq=    0B f=0/0   
5147.67 M-V:  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0

$ ffplay /dev/video1
ffplay version n4.4 Copyright (c) 2003-2021 the FFmpeg developers
  built with gcc 10.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[video4linux2,v4l2 @ 0x7fe514000c80] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device
/dev/video1: Inappropriate ioctl for device
    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0
$ ffplay /dev/video2
ffplay version n4.4 Copyright (c) 2003-2021 the FFmpeg developers
  built with gcc 10.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, video4linux2,v4l2, from '/dev/video2':B sq=    0B f=0/0   
  Duration: N/A, start: 5231.617628, bitrate: 27648 kb/s
  Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 640x360, 27648 kb/s, 15 fps, 15 tbr, 1000k tbn, 1000k tbc
5233.15 M-V:  0.004 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0 

$ ffplay /dev/video3
ffplay version n4.4 Copyright (c) 2003-2021 the FFmpeg developers
  built with gcc 10.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[video4linux2,v4l2 @ 0x7fc310000c80] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device
/dev/video3: Inappropriate ioctl for device
    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0

windwos 10

fine to open
ffplay -f dshow video="Integrated Camera" does work.
ffplay "Integrated Camera" fail to open.
ffplay -f dshow video="Integrated IR Camera" does not work!

> ffmpeg -list_devices true -f dshow -i dummy
ffmpeg version 4.3.1-2020-11-19-essentials_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[dshow @ 00000226d5ead840] DirectShow video devices (some may be both video and audio devices)
[dshow @ 00000226d5ead840]  "Integrated Camera"
[dshow @ 00000226d5ead840]     Alternative name "@device_pnp_\\?\usb#vid_04f2&pid_b67c&mi_00#7&26fcf372&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 00000226d5ead840] DirectShow audio devices
[dshow @ 00000226d5ead840]  "麦克风阵列 (Realtek(R) Audio)"
[dshow @ 00000226d5ead840]     Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{0D8E2DF3-4177-4CB4-86C0-FC58EFE5A744}"
dummy: Immediate exit requested

> ffplay  "Integrated Camera"
ffplay version 4.3.1-2020-11-19-essentials_build-www.gyan.dev Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Integrated Camera: No such file or directory  0KB sq=    0B f=0/0   

> ffplay "@device_pnp_\\?\usb#vid_04f2&pid_b67c&mi_00#7&26fcf372&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
ffplay version 4.3.1-2020-11-19-essentials_build-www.gyan.dev Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
@device_pnp_\\?\usb#vid_04f2&pid_b67c&mi_00#7&26fcf372&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global: No such file or directory

> ffplay -f dshow video="Integrated Camera"
ffplay version 4.3.1-2020-11-19-essentials_build-www.gyan.dev Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, dshow, from 'video=Integrated Camera':B sq=    0B f=0/0   
  Duration: N/A, start: 1568.956000, bitrate: N/A
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 30 fps, 30 tbr, 10000k tbn, 10000k tbc
PS D:\Documents\CAU\Lion\repositiries\Python\temp> q=    0B f=10/10 

> ffplay -f dshow video="Integrated IR Camera"
ffplay version 4.3.1-2020-11-19-essentials_build-www.gyan.dev Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[dshow @ 000002403b63c280] Could not find video device with name [Integrated IR Camera] among source devices of type video.
video=Integrated IR Camera: I/O error

python-opencv test

I used to do such things before here. Just to use it to open camera and record video.

import numpy as np
import cv2 as cv

cap = cv.VideoCapture(0)  # 使用0、1、2选择摄像头


VIDEOFILEPATH = 'output.avi'
FPS = 30  # 帧率
# 获取相机帧的宽高,默认640×480
FRAME_WIDTH = cap.get(cv.CAP_PROP_FRAME_WIDTH)
FRAME_HEIGHT = cap.get(cv.CAP_PROP_FRAME_HEIGHT)
print("WIDTH: ", FRAME_WIDTH, "HEIGHT: ",FRAME_HEIGHT)  

# 设置视频编码格式、创建视频流对象
fourcc = cv.VideoWriter_fourcc(*'XVID')
out = cv.VideoWriter(VIDEOFILEPATH, fourcc, FPS, (FRAME_WIDTH, FRAME_HEIGHT))

if not cap.isOpened():
    print("Cannot open camera")
    exit(0)
while True:
    ret, frame = cap.read()  # 一帧一帧获取画面
    if not ret:
        print("Can't receive frame (stream end?). Exiting ...")
        break

    # frame = cv.flip(frame, 0)  # 上下翻转帧
    out.write(frame)  # 写入帧到文件中
    cv.imshow('frame', frame)  # 显示图像

    if cv.waitKey(1) == ord('q'):  # 按q退出
        break

cap.release()  # 务必释放摄像头
cv.destroyAllWindows()

arch

The result is the same as ffplay's.
Python 3.9.5 + numpy 1.20.2 + python-opencv 4.5.2-4

windows 10

The result is dirrerent.
python 3.9.0 + numpy 1.19.4 + opencv-python 4.4.0.46

VideoCapture(0) work as /dev/video0

VideoCapture(!~3) fail as below:

[ WARN:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-95hbg2jt\opencv\modules\videoio\src\cap_msmf.cpp (435) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
WIDTH:  0.0 HEIGHT:  0.0
Cannot open camera

Then I use potplayer try to open camera. It only shows one camera without IR.

v4l2-ctl get size + fps

$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'MJPG' (Motion-JPEG, compressed)
                Size: Discrete 1280x720
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 320x180
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 352x288
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 424x240
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 848x480
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 960x540
                        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 320x180
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 352x288
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 424x240
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 848x480
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 960x540
                        Interval: Discrete 0.067s (15.000 fps)

$ v4l2-ctl -d /dev/video1 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

$ v4l2-ctl -d /dev/video2 --list-formats-ext
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)

$ v4l2-ctl -d /dev/video3 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

End

LAN camera

I can not find the device under the /dev
(base) vci-1@vci1-UNO-3083G-3085G-D64E:/dev$ ls
maybe I need installl anther driver?
my camera is a infrare camera made by FOTRIC and connect with the computer with the LAN Port.
I do the command ifconfig -a`` and find the connected messages as following:

eno1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether c4:00:ad:02:a8:aa  txqueuelen 1000  (Ethernet)
        RX packets 6861  bytes 7929217 (7.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3868  bytes 740444 (740.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7f00000-f7f20000  

Lenovo Yoga14s (Slim 7) Configuration has failed

When I first configured this program, the infrared fill light flashed and red could be seen.

After I selected enable and restarted, the fill light could not be used.

After reinstalling the program, no red light is on when the configuration is found.

(I've tried it many times, but it doesn't seem to work)

Camera

Bus 003 Device 002: ID 04f2:b6cb Chicony Electronics Co., Ltd Integrated Camera

Which device did you used ?
Lenovo Yoga14s (Slim 7)

Ouput of linux-enable-ir-emitter --verbose configuration

configure command output
─>$ sudo linux-enable-ir-emitter -v configure
INFO: Warning to do not kill the process !
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (1356) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: unit: 13, selector: 14, curr control: ['2', '20'], max control: ['2', '100'], res control: ['1', '10']
DEBUG: unit: 14, selector: 2, curr control: ['1', '0', '0', '0', '0', '0', '0', '16', '39', '0', '0', '0', '0', '0', '0'], max control: ['7', '0', '0', '0', '0', '0', '0', '200', '20', '5', '0', '0', '0', '0', '0'], res control: ['0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0']
DEBUG: unit: 14, selector: 6, curr control: ['1', '3', '1', '0', '0', '0', '0', '0', '0'], max control: ['1', '3', '3', '0', '0', '0', '0', '0', '0'], res control: ['0', '0', '1', '0', '0', '0', '0', '0', '0']
DEBUG: control: ['1', '3', '2', '0', '0', '0', '0', '0', '0']
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (1356) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: control: ['1', '3', '3', '0', '0', '0', '0', '0', '0']
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (1356) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? n
ERROR: The configuration has failed.
INFO: Do not hesitate to open an issue on GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter/wiki

Output of v4l2-ctl --list-devices

╰─>$ sudo  v4l2-ctl --list-devices
Integrated Camera: Integrated C (usb-0000:00:14.0-1):
        /dev/video0
        /dev/video1
        /dev/video2
        /dev/video3
        /dev/media0
        /dev/media1

Ouput of v4l2-ctl -d /dev/video2 --list-formats-ext

v4l2 device output
╰─>$ v4l2-ctl -d /dev/video2 --list-formats-ext
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)

Additional info

  • Distro: Archlinux
  • Version: None
  • Version of linux-enable-ir-emitter: linux-enable-ir-emitter 3.2.5
  • How did you install linux-enable-ir-emitter: AUR->GIT

not working after reboot on Dell XPS15

Hi.
Your script is working properly in the current session. I can see the ir-leds blinking and facial recognition ends successfully. But after reboot it doesn't work. I have to restart the program manually. I have the latest version and Your fix https://github.com/EmixamPP/linux-enable-ir-emitter/wiki/Issues doesn't work for me. :~$ linux-enable-ir-emitter boot enable freezes and i have to strike Ctrl-C and launch "fix config" to make everything work again. Until restart...
I work on Dell XPS-15, Ubuntu 21.04.

linux-enable-ir-emitter boot status :

Loaded: loaded (/lib/systemd/system/linux-enable-ir-emitter.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2021-10-14 21:30:38 CEST; 38min ago
Process: 1828 ExecStartPre=/sbin/modprobe uvcvideo (code=exited, status=0/SUCCESS) Process: 1832 ExecStart=/usr/bin/linux-enable-ir-emitter run (code=exited, status=0/SUCCESS)
Main PID: 1832 (code=exited, status=0/SUCCESS)
paź 14 21:30:37 aga-XPS systemd[1]: Starting enable the infrared emitter...
paź 14 21:30:38 aga-XPS systemd[1]: linux-enable-ir-emitter.service: Succeeded.
paź 14 21:30:38 aga-XPS systemd[1]: Finished enable the infrared emitter.

journalctl -xeu linux-enable-ir-emitter.service :

:~$ journalctl -xeu linux-enable-ir-emitter.service
-- Boot 2229e250c9b743bb8a9071900f0fe8d5 --
paź 14 21:30:37 aga-XPS systemd[1]: Starting enable the infrared emitter.>
░░ Subject: A start job for unit linux-enable-ir-emitter.service has begun exec>
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit linux-enable-ir-emitter.service has begun execution.
░░ 
░░ The job identifier is 134.
paź 14 21:30:38 aga-XPS systemd[1]: linux-enable-ir-emitter.service: Succ>
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit linux-enable-ir-emitter.service has successfully entered the 'dead'>
paź 14 21:30:38 aga-XPS systemd[1]: Finished enable the infrared emitter.
░░ Subject: A start job for unit linux-enable-ir-emitter.service has finished s>
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit linux-enable-ir-emitter.service has finished successful>
░░ 
░░ The job identifier is 134.

Have no idea how to make this script working after reboot.

Thinkpad X1 Yoga 4th Gen

Which device did you used ?

The default device.

Ouput of linux-enable-ir-emitter --verbose configuration

configure command output
[gctrindade@goose-yoga ~]$ sudo linux-enable-ir-emitter --verbose configure
INFO: Warning to do not kill the process !
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (1356) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:[email protected]] global /build/opencv/src/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? Yes
ERROR: Your infrared camera is already working, skipping the configuration.
ERROR: The configuration has failed.
INFO: Do not hesitate to open an issue on GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter/wiki
[gctrindade@goose-yoga ~]$ 

Output of v4l2-ctl --list-devices

list devices output ``` [gctrindade@goose-yoga ~]$ v4l2-ctl --list-devices Video Capture 3 (usb-0000:00:14.0-8): /dev/video0 /dev/video1 /dev/video2 /dev/video3 /dev/media0 /dev/media1 ```

Ouput of v4l2-ctl -d /dev/video2 --list-formats-ext

v4l2 device output
[gctrindade@goose-yoga ~]$ v4l2-ctl -d /dev/video2 --list-formats-ext
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)

Additional info

  • OS: Arch Linux x86_64
  • Host: 20SA0004US ThinkPad X1 Yoga 4th
  • Kernel: 5.15.13-arch1-1
  • CPU: Intel i5-10210U (8) @ 4.200GHz
  • GPU: Intel CometLake-U GT2 [UHD Graphics]
  • Version of linux-enable-ir-emitter: 3.2.5
  • How did you install linux-enable-ir-emitter: AUR

Configuration Error: "OSError: [Errno 8] Exec format error"

Ouput of linux-enable-ir-emitter -v -d /dev/videoX configure

configure command output
INFO: Ensure to not use the camera during the execution.
INFO: Warning to do not kill the process !
Traceback (most recent call last):
  File "/usr/bin/linux-enable-ir-emitter", line 82, in <module>
    configure.execute(device, args.limit[0])
  File "/usr/lib/linux-enable-ir-emitter/command/configure.py", line 21, in execute
    exit_code = subprocess.call([DRIVER_GENERATOR_PATH, device, str(neg_answer_limit), driver_path, str(log_level)])
  File "/usr/lib/python3.10/subprocess.py", line 345, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/usr/lib/linux-enable-ir-emitter/driver/driver-generator'

Output of v4l2-ctl --list-devices

Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-6):
	/dev/video0
	/dev/video1
	/dev/video2
	/dev/video3
	/dev/media0
	/dev/media1

Ouput of v4l2-ctl -d /dev/videoX --list-formats-ext

v4l2 device output
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'GREY' (8-bit Greyscale)
		Size: Discrete 640x360
			Interval: Discrete 0.033s (30.000 fps)

Additional info

  • Distro: Manjaro Linux
  • Version: 21.3.6
  • Version of linux-enable-ir-emitter: 4.1.4
  • How did you install linux-enable-ir-emitter: AUR & bash

Can't access to config file during boot

Hi, first of all, thanks for your work,

The quick configuration work for me but it stops working after reboot. It's seems that the configuration path is wrong before login,

save_config_file_path = os.path.expanduser("~") + "/.irConfig.yaml"

expanduser("~") in command.py gives a wrong path in this case.

Thanks!

Not working at boot

Even if I ran the "linux-enable-ir-emitter boot enable" command and the status is:

● linux-enable-ir-emitter.service - enable the infrared emitter
     Loaded: loaded (/lib/systemd/system/linux-enable-ir-emitter.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Thu 2021-10-14 08:28:01 CEST; 3h 24min ago
   Main PID: 1477 (code=exited, status=0/SUCCESS)

okt 14 08:28:01 user-linux systemd[1]: Starting enable the infrared emitter...
okt 14 08:28:01 user-linux systemd[1]: linux-enable-ir-emitter.service: Succeeded.
okt 14 08:28:01 user-linux systemd[1]: Finished enable the infrared emitter.

It just doesn't enable the emitter during face scan. I need to run the command again to make it work at the current session.
I'm on Ubuntu 20.4.3 LTS

AUR package fails to build

Yes
Describe the bug

both of the AUR packages fail to build with this error:

make: Entering directory '/home/winux/.cache/paru/clone/linux-enable-ir-emitter-git/src/linux-enable-ir-emitter-git/sources/driver'
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
Package 'opencv', required by 'virtual:world', not found
g++ driver-generator.cpp getquery.h lenquery.h setquery.h executequery.h driver.hpp -O3 -std=c++17 -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual -Wconversion -Wunreachable-code -Winit-self -I/usr/include/opencv4 -lopencv_gapi -lopencv_stitching -lopencv_alphamat -lopencv_aruco -lopencv_barcode -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_cvv -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_viz -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core  -o driver-generator 
/usr/bin/ld: warning: libfmt.so.8, needed by /usr/lib/libvtkFiltersGeneral.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/lib/libvtkFiltersGeneral.so.1: undefined reference to `fmt::v8::vformat[abi:cxx11](fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)'
collect2: error: ld returned 1 exit status
make: *** [Makefile:14: driver-generator] Error 1
make: Leaving directory '/home/winux/.cache/paru/clone/linux-enable-ir-emitter-git/src/linux-enable-ir-emitter-git/sources/driver'

Who to reproduce
Try installing the AUR package

Additional info

  • Distro: Arch Linux
  • Version: -
  • Version of linux-enable-ir-emitter: latest
  • How did you install linux-enable-ir-emitter: AUR

Skips Adding Config Even Though It's Required

$ sudo linux-enable-ir-emitter configure 
[ INFO:0] global /builddir/build/BUILD/opencv-4.5.2/modules/videoio/src/videoio_registry.cpp (217) VideoBackendRegistry VIDEOIO: Enabled backends(9, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); MSMF(970); V4L2(960); CV_IMAGES(950); CV_MJPEG(940); FIREWIRE(930); UEYE(920)
[ INFO:0] global /builddir/build/BUILD/opencv-4.5.2/modules/videoio/src/cap_gstreamer.cpp (831) open OpenCV | GStreamer: v4l2src device=/dev/video2 ! videoconvert ! appsink drop=true
[ INFO:0] global /builddir/build/BUILD/opencv-4.5.2/modules/videoio/src/cap_gstreamer.cpp (864) open OpenCV | GStreamer: mode - MANUAL
[ WARN:0] global /builddir/build/BUILD/opencv-4.5.2/modules/videoio/src/cap_gstreamer.cpp (1081) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? yes
ERROR: Your infrared camera is already working, skipping the configuration.

$ sudo linux-enable-ir-emitter test     
ERROR: No configuration is currently saved.
Traceback (most recent call last):
  File "/usr/bin/linux-enable-ir-emitter", line 83, in <module>
    test.execute()
  File "/usr/lib64/linux-enable-ir-emitter/command/test.py", line 12, in execute
    exitIfFileDescriptorError(exit_code, ir_config.device)
AttributeError: 'NoneType' object has no attribute 'device'

No 2.0.1 tag

The PKGBUILD file is trying to pull source from the 2.0.1 tag, but it doesn't exist.

Lenovo X1 Carbon Gen 9

I followed the instructions to get the right parameters for a new laptop (VM + Wireshark) and found a set of parameters that work with enable-ir-emitter (i.e., that do not give any error) on my new Lenovo X1 Carbon, Gen. 9.
.
However, the IR emitters still do not work, even after running './enable-ir-emitter' or 'sudo ./enable-ir-emitter'
I also tried setting the 'frame_width = 340' and 'frame_height = 340' in the howdy config file, but I suspect the IR camera forces the values back to 640x360.

The confic values I found are:

  • data: 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    unit: '0x0a'
    selector: '0x0a'

No module named 'cv2' - Ubuntu 18.04

(base) joe@joedesktop:~/linux-enable-ir-emitter$ linux-enable-ir-emitter -h
Traceback (most recent call last):
  File "/usr/bin/linux-enable-ir-emitter", line 8, in <module>
    from command import boot, fix, manual, run, configure
  File "/usr/lib/linux-enable-ir-emitter/command/manual.py", line 6, in <module>
    from driver.Driver import Driver
  File "/usr/lib/linux-enable-ir-emitter/driver/Driver.py", line 3, in <module>
    import cv2 as cv
ModuleNotFoundError: No module named 'cv2'

Error configuring systemd service when using custom video custom

I used the following command to try to configure the service: sudo linux-enable-ir-emitter -v -d /dev/video0 configure
I get the following message when I am done configuring:

INFO: The driver has been successfully generated.
ERROR: Error with the systemd boot service.

When I check the logs in journalctl, I saw the following:

linux-enable-ir-emitter[10416]: CRITICAL: The device /dev/video2 does not exists.
linux-enable-ir-emitter[10416]: INFO: Please choose among this list: /dev/video1 /dev/video0

It seems like it's not using the video0 device specified with the configure command.

IR camera stopped working on Windows after trying to set up

Hello, I dual boot Windows and Arch linux and I was trying to make the camera work with howdy on Arch, but after installing linux-enable-ir-emitter I tried to configure it and after several times it trying to configure the camera looping on both the infrared and the regular camera, it stopped working to open the camera device.

After rebooting on Windows now Windows can't access the camera as well. It says it can't use Windows Hello.

Running linux-enable-ir-emitter again now always times out on select for /dev/video0 and even the basic test of capturing data with gst-launch now returns an Internal data stream error.

Is there anything that happens during the emitter setup that can change the camera behaviour? Is there any way that I can restore it?

I've tried uninstalling and reinstalling the camera on Windows too hoping it would come back to defaults, but so far nothing helped.

Can't install linux-enable-ir-emitter on Intel i7-7600U

Compilation fails because of missing dependency opencv2

After installing from AUR on Manjaro (yay -S linux-enable-ir-emitter) or via installer (# ./installer install), compilation fails with the error:

  • driver-generator.cpp:23:10: fatal error: opencv2/videoio.hpp: No such file or directory

I also tried to install opencv2 manually via AUR. However that fails as well due to the following error:

  • parallel.cpp:104:14: fatal error: tbb/tbb_stddef.h: No such file or directory

This is weird because this is actually a closed issue on official OpenCV repository (link).

Additional info
Distro: Manjaro Linux
KDE Plasma Version: 5.24.6
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
Kernel Version: 5.15.57-2-MANJARO (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i7-7600U CPU @ 2.80GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 620

V4 config fails on Thinkpad X390

Ouput of linux-enable-ir-emitter -v -d /dev/videoX configure

configure command output
[~]$ 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 ? n
DEBUG: unit: 9, selector: 10, cur control: 0 8 0 187 187 187 187 187, first control to test: 0 0 0 0 0 0 0 0, res control: 1 0
0 0 0 0 0 0, max control: 255 255 255 255 255 255 255 255
DEBUG: Negative answer limit exceeded, skipping the pattern.
ERROR: Impossible to reset the control.
INFO: Please keep this debug in case of issue :
DEBUG: unit: 9, selector: 10, control: 0 8 0 187 187 187 187 187
DEBUG: unit: 10, selector: 2, cur control: 1 0 0 0 0 0 0 16 39 0 0 0 0 0 0, first control to test: 0 0 0 0 0 0 0 16 39 0 0 0 0
0 0, res control: 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0, max control: 7 0 0 0 0 0 0 200 20 5 0 0 0 0 0
Is the ir emitter flashing (not just turn on) ? Yes/No ? n
Is the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: Computing the resolution control.
DEBUG: unit: 10, selector: 6, cur control: 1 3 1 0 0 0 0 0 0, first control to test: 1 3 2 0 0 0 0 0 0, res control: 0 0 1 0 0
0 0 0 0, max control: 1 3 3 0 0 0 0 0 0
Is the ir emitter flashing (not just turn on) ? Yes/No ? n
Is the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: unit: 10, selector: 9, cur control: 0 0 0 0, first control to test: 1 0 0 0, res control: 1 0 0 0, max control: 1 0 0 0
Is the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: unit: 14, selector: 14, cur control: 0 0, first control to test: 1 10, res control: 1 10, max control: 2 100
Is the ir emitter flashing (not just turn on) ? Yes/No ? n
Is the ir emitter flashing (not just turn on) ? Yes/No ? n
Is the ir emitter flashing (not just turn on) ? Yes/No ? n
DEBUG: unit: 14, selector: 16, cur control: 0, first control to test: 1, res control: 1, max control: 1
Is the ir emitter flashing (not just turn on) ? Yes/No ? n
ERROR: The configuration has failed.
INFO: Do not hesitate to visit the GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter/wiki

Output of v4l2-ctl --list-devices

[~]$ v4l2-ctl --list-devices
Integrated Camera: Integrated C (usb-0000:00:14.0-8):
        /dev/video0
        /dev/video1
        /dev/video2
        /dev/video3
        /dev/media0
        /dev/media1

Ouput of v4l2-ctl -d /dev/videoX --list-formats-ext

v4l2 device output
[~]$ v4l2-ctl -d /dev/video2 --list-formats-ext
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)

Additional info

  • Distro: Arch Linux
  • Version: latest
  • Version of linux-enable-ir-emitter: 4.1.2
  • How did you install linux-enable-ir-emitter: AUR
  • Device: Lenovo Thinkpad X390

Possibly related to Issue #71
Until V4 it was working without any issues but after updating to V4 the program broke. I have tried reinstalling it several times both from the AUR and directly from github and it fails the same way every time. Installing V3 from git creates a functioning configuration but upgradig to V4.1.2 and running the script to migrate the config breaks the program and subsequent attempts to reconfigure the program fails.

Launch script loads too early in systemd

I have a Dell XPS 9310 2in1. Everything works fine except service script.

I get this at startup

"enable-ir-emitter[355]: Unable to open a file descriptor for /dev/video2"

I think launch script run before video drivers. How can we fix?

Update 3.2

I updated today to 3.2 in Fedora 34, after the update it stopped working, I had to remove it and install again

AUR

alerque - https://aur.archlinux.org/pkgbase/linux-enable-ir-emitter/
This packaging in goofed up. It using a repository with no fixed version as it's source, and yet it doesn't have a pkgver() function. If it did it would be a VCS package, but that already exists elsewhere. This should be changed to only package tagged stable releases and use fixed source packages (whether tarballs or source builds are git archives, they need to be fixed with a checksum or specific SHA).

@komex, do you know how to handle it to comply with the guidelines ?

I will also try to contact the maintainer of the "-git" package to update it (#28 @FabioLolix).

Latest fedora version command not found

$ linux-enable-ir-emitter                           
zsh: linux-enable-ir-emitter: command not found...
Install package 'linux-enable-ir-emitter' to provide command 'linux-enable-ir-emitter'? [N/y] y


 * Waiting in queue... Failed to install packages: linux-enable-ir-emitter-3.0.0-1.fc34.x86_64 is already installed

error while loading shared libraries: libopencv_videoio.so.4.5d

If you had 'ERROR: Impossible to reset the control' message, give the DEBUG info displayed

DEBUG:

Ouput of linux-enable-ir-emitter -v -d /dev/videoX configure

configure command output
**I am using video2 for this command**
/usr/lib/linux-enable-ir-emitter/driver/driver-generator: error while loading shared libraries: libopencv_videoio.so.4.5d: cannot open shared object file: No such file or directory
ERROR: The configuration has failed.

Output of v4l2-ctl --list-devices

Integrated Camera: Integrated C (usb-0000:00:14.0-7):
	/dev/video0
	/dev/video1
	/dev/video2
	/dev/video3

Ouput of v4l2-ctl -d /dev/videoX --list-formats-ext

v4l2 device output
**I am using video2 for this command**
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'GREY' (8-bit Greyscale)
		Size: Discrete 360x360
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 640x360
			Interval: Discrete 0.033s (30.000 fps)

Additional info

  • Distro: Ubuntu
  • Version: Focal Fossa (20.04 LTS)
  • Version of linux-enable-ir-emitter: 4.2.1
  • How did you install linux-enable-ir-emitter: PPA

IR emitter working, but not after restart

Hi,

First of all a big thanks for creating this fix, I've got a Dell XPS 9510 and this fix works like a charm - until I restart the computer. After the restart it only starts to work again once I've run linux-enable-ir-emitter configure. Simply restarting the service doesn't work. I'm running Pop OS 21.04.

It also doesn't work after suspending the computer. After doing that the configure fails as well, at which point I need to restart the computer, log in, and run the configuration one more time to get it to work.

Any ideas what might cause this?

Kind regards,
Joakim

TypeError: 'type' object is not subscriptable

yes
Describe the bug

the command doesn't start
Who to reproduce

After uninstalling the earlier version, updating and reinstalling the latest version, the command doesn't start at all with any argument:

output:

linux-enable-ir-emitter -h Traceback (most recent call last): File "/usr/bin/linux-enable-ir-emitter", line 9, in <module> from command import boot, fix, manual, run, configure File "/usr/lib/linux-enable-ir-emitter/command/boot.py", line 5, in <module> from Systemd import Systemd File "/usr/lib/linux-enable-ir-emitter/Systemd.py", line 19, in <module> class Systemd: File "/usr/lib/linux-enable-ir-emitter/Systemd.py", line 20, in Systemd def __init__(self, devices: list[str]) -> None: TypeError: 'type' object is not subscriptable

Additional info

  • Distro: Ubuntu
  • Version: 20.04
  • Version of linux-enable-ir-emitter: the latest on 2021.11.06
  • How did you install linux-enable-ir-emitter:
    bash

Device as Symlink

If I used a device which is a symlink /dev/videohowdy -> video2 OR video6 I get this error:

Traceback (most recent call last):
  File "/usr/bin/linux-enable-ir-emitter", line 83, in <module>
    test.execute()
  File "/usr/lib64/linux-enable-ir-emitter/command/test.py", line 11, in execute
    exit_code = ExitCode.FAILURE if not ir_config else ir_config.triggerIr()
  File "/usr/lib64/linux-enable-ir-emitter/IrConfiguration.py", line 89, in triggerIr
    capture = cv2.VideoCapture(int(self.device[-1]))
ValueError: invalid literal for int() with base 10: 'y'

Multiple device support

As requested by @dav-is, version 3.2.0 supports the configuration of multiple infrared emitters.

To do this, simply run linux-enable-ir-emitter configure -d /dev/deviceX several times and change the desired camera each time.

The version is present on the dev branch to be tested.
In order to install it you need to run the bash script: sudo bash installer.sh install (remove the installed version first).

Service initialization failed with `Unable to open a file descriptor for /dev/video2`

This guide worked perfectly, so thank you!

I have one issue left, though: on boot, the service fails to start with the message
Unable to open a file descriptor for /dev/video2.
I guess this is due to enable-ir-emitter.service starting before the webcam is properly detected by the system. I am unsure how to keep the service from starting, until the webcam is detected, as my technical knowledge of systemd is fairly limited. I tried adding after=systemd-udev-settle.service, but this did not solve the issue.
Interestingly, the IR-Blaster sometimes still works fine after a reboot when logging in in sddm, but not reliably.

Turning on continuously + disable IR emitter

Hi,

I'm trying to do something a bit different from what this project does, namely to make the IR emitter of my IR camera always be on when the camera is on.

I have a Chicony integrated camera which I'm trying to use to monitor a room at night. At the moment, when I turn on the IR camera, the emitter flashes; this would be the correct behavior for facial recognition but of course for a continuous video stream, it makes the video flash too.

I understand this is not the main purpose of this project but if you could tell me how to tweak it to achieve this or had any insights, that would be super helpful.

Here are some tech infos:

$ lsusb|grep -i camera 
3:Bus 003 Device 003: ID 04f2:b684 Chicony Electronics Co., Ltd Chicony USB2.0 Camera

$ sudo linux-enable-ir-emitter configure
INFO: Warning to do not kill the process !
Did you see the ir emitter flashing (not just turn on) ? Yes/No ? Yes
ERROR: Your infrared camera is already working, skipping the configuration.
ERROR: The configuration has failed.
INFO: Do not hesitate to open an issue on GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter/wiki

$ sudo linux-enable-ir-emitter run
CRITICAL: Cannot access to /dev/videoX.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.