linux-enable-ir-emitter: Segmentation Fault

Ouput of linux-enable-ir-emitter -v configure

configure command output
$ sudo linux-enable-ir-emitter -v configure
INFO: Stand in front of and close to the camera and make sure the room is well lit.
INFO: Ensure to not use the camera during the execution.
INFO: Warning to do not kill the process !
Segmentation fault

Output of v4l2-ctl --list-devices

$ v4l2-ctl --list-devices
Integrated Camera: Integrated C (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
$ 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 640x480
			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 848x480
			Interval: Discrete 0.050s (20.000 fps)
		Size: Discrete 960x540
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.100s (10.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 360x360
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 640x360
			Interval: Discrete 0.033s (30.000 fps)

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

$ v4l2-ctl -d /dev/media0 --list-formats-ext
Unable to detect what device /dev/media0 is, exiting.

$ v4l2-ctl -d /dev/media1 --list-formats-ext
Unable to detect what device /dev/media1 is, exiting.


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

$ ls -l /dev/v4l/by-path
total 0
lrwxrwxrwx. 1 root root 12 Nov 28 17:09 pci-0000:00:14.0-usb-0:6:1.0-video-index0 -> ../../video0
lrwxrwxrwx. 1 root root 12 Nov 28 17:09 pci-0000:00:14.0-usb-0:6:1.0-video-index1 -> ../../video1
lrwxrwxrwx. 1 root root 12 Nov 28 17:09 pci-0000:00:14.0-usb-0:6:1.2-video-index0 -> ../../video2
lrwxrwxrwx. 1 root root 12 Nov 28 17:09 pci-0000:00:14.0-usb-0:6:1.2-video-index1 -> ../../video3
lrwxrwxrwx. 1 root root 12 Nov 28 17:09 pci-0000:00:14.0-usbv2-0:6:1.0-video-index0 -> ../../video0
lrwxrwxrwx. 1 root root 12 Nov 28 17:09 pci-0000:00:14.0-usbv2-0:6:1.0-video-index1 -> ../../video1
lrwxrwxrwx. 1 root root 12 Nov 28 17:09 pci-0000:00:14.0-usbv2-0:6:1.2-video-index0 -> ../../video2
lrwxrwxrwx. 1 root root 12 Nov 28 17:09 pci-0000:00:14.0-usbv2-0:6:1.2-video-index1 -> ../../video3

Give more information if you have

Additional info

  • Computer (or camera) model: Razer Blade Stealth 13 (Late 2020)
  • Linux distribution: Fedora 39
  • Version of linux-enable-ir-emitter: 5.2.4

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Comments: 27 (14 by maintainers)

Most upvoted comments

Apologies for taking so long to get back to you on this ticket. Got sidetracked with the holidays. I really appreciate you helping with this. This is a great project.

I don’t appear to be getting the segmentation fault with the latest v6 so that’s good. It’s now just hanging. It runs and I start to see the IR camera light up after video2 (I think, it happens quick). However it comes on. I did let it run for a few minutes and then halted it because it doesn’t seem to stop.

$sudo linux-enable-ir-emitter -v configure -g DEBUG: Executing configure command. INFO: Stand in front of and close to the camera and make sure the room is well lit. INFO: Ensure to not use the camera during the execution. DEBUG: Checking if /dev/video0 is a greyscale camera. DEBUG: Checking if /dev/video1 is a greyscale camera. DEBUG: Checking if /dev/video2 is a greyscale camera.

I did also try running it with -g and -m but that didn’t seem to change anything.

If you’d like I can open a new ticket for the configuration not working since it seems for me the segmentation fault at least is resolved.

Hmm I take it back, the segfault is intermittent. I’ve tried the latest build. It either hangs forever (well, I’ve let it sit for 5-10min), or finally segmentation faults. I am running with -v and -g:

$ sudo linux-enable-ir-emitter -v -w 640 -t 360 configure -g
DEBUG: Executing configure command.
INFO: Stand in front of and close to the camera and make sure the room is well lit.
INFO: Ensure to not use the camera during the execution.
DEBUG: Checking if /dev/video0 is a greyscale camera.
DEBUG: Checking if /dev/video1 is a greyscale camera.
DEBUG: Checking if /dev/video2 is a greyscale camera.
DEBUG: /dev/video2 is a greyscale camera.
INFO: Configuring the camera /dev/video2
DEBUG: yaml error: bad file: /etc/linux-enable-ir-emitter/pci-0000:05:00.0-usb-0:1:1.2-video-index0
DEBUG: No previous configuration found.
Is the ir emitter flashing (not just turn on) ? Yes/No ? No
DEBUG: no  inputed.
DEBUG: Instruction applied: unit: 4, selector: 2, control: 1 0
DEBUG: Instruction applied: unit: 4, selector: 2, control: 2 0
DEBUG: Instruction applied: unit: 4, selector: 2, control: 3 0
DEBUG: Instruction applied: unit: 4, selector: 2, control: 4 0
DEBUG: Instruction applied: unit: 4, selector: 2, control: 5 0
DEBUG: Instruction applied: unit: 4, selector: 2, control: 6 0
DEBUG: Instruction applied: unit: 4, selector: 2, control: 7 0
DEBUG: Instruction applied: unit: 4, selector: 2, control: 8 0
DEBUG: Instruction applied: unit: 4, selector: 2, control: 9 0
DEBUG: Instruction applied: unit: 4, selector: 2, control: 255 255
DEBUG: Instruction applied: unit: 4, selector: 3, control: 1
Segmentation fault
$ 

For my machine (Lenovo Thinkpad AMD T16 Gen 1), what happens is at the point it asks if its flashing, the camera indicator and the IR emitter turn on solid until I answer No. Then throughout each of the first 10 tests, both the IR emitter and camera indicator turn on and off together. Then when it reaches the end, the camera indicator comes on permanently while it hands and then eventually dies.

Concerning the verbosity, there is the -v option, but indeed I should output more debug information. I will work on that.

This I was already using. As said, maybe it needs some print line before even something is happening 😃

It is a generation 13 Intel, the first cpu via /proc/cpuinfo

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 186
model name      : 13th Gen Intel(R) Core(TM) i7-1355U
stepping        : 3
microcode       : 0x411c
cpu MHz         : 732.289
cache size      : 12288 KB
physical id     : 0
siblings        : 12
core id         : 0
cpu cores       : 10
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 32
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities
vmx flags       : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs ept_mode_based_exec tsc_scaling usr_wait_pause
bugs            : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb
bogomips        : 5224.00
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

Hi,

first of all thank you for working on this. My setup is a ThinkPad X1 Yoga gen 8 which has a intel ipu6 system. It seems that the camera is not “connected” via USB but rather directly PCI.

v4l2-ctl --list-devices
ipu6 (PCI:pci:pci0000:00):
        /dev/video1
        /dev/video2
        /dev/video3
        /dev/video4
        /dev/video5
        /dev/video6
        /dev/video7
        /dev/video8

ipu6 (pci:pci0000:00):
        /dev/media0

Intel MIPI Camera (platform:v4l2loopback-000):
        /dev/video0

/dev/video0 is the main camera and now properly working via a v4l2loopback.

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

        [0]: 'Y10 ' (10-bit Greyscale)
        [1]: 'BX24' (32-bit XRGB 8-8-8-8)
        [2]: 'Y12I' (Interleaved 12-bit Greyscale)
        [3]: 'Z16 ' (16-bit Depth)
        [4]: 'YUYV' (YUYV 4:2:2)
        [5]: 'Y8I ' (Interleaved 8-bit Greyscale)
        [6]: 'BG12' (12-bit Bayer BGBG/GRGR)
        [7]: 'GB12' (12-bit Bayer GBGB/RGRG)
        [8]: 'BA12' (12-bit Bayer GRGR/BGBG)
        [9]: 'RG12' (12-bit Bayer RGRG/GBGB)
        [10]: 'BG10' (10-bit Bayer BGBG/GRGR)
        [11]: 'GB10' (10-bit Bayer GBGB/RGRG)
        [12]: 'BA10' (10-bit Bayer GRGR/BGBG)
        [13]: 'RG10' (10-bit Bayer RGRG/GBGB)
        [14]: 'BA81' (8-bit Bayer BGBG/GRGR)
        [15]: 'GBRG' (8-bit Bayer GBGB/RGRG)
        [16]: 'GRBG' (8-bit Bayer GRGR/BGBG)
        [17]: 'RGGB' (8-bit Bayer RGRG/GBGB)
        [18]: 'GREY' (8-bit Greyscale)

and

ls -l /dev/v4l/by-path
lrwxrwxrwx 1 root root 12 Jan 14 11:45 pci-0000:00:05.0-video-index0 -> ../../video7
lrwxrwxrwx 1 root root 12 Jan 14 11:45 pci-0000:00:05.0-video-index1 -> ../../video1
lrwxrwxrwx 1 root root 12 Jan 14 11:45 pci-0000:00:05.0-video-index2 -> ../../video2
lrwxrwxrwx 1 root root 12 Jan 14 11:45 pci-0000:00:05.0-video-index3 -> ../../video3
lrwxrwxrwx 1 root root 12 Jan 14 11:45 pci-0000:00:05.0-video-index4 -> ../../video4
lrwxrwxrwx 1 root root 12 Jan 14 11:45 pci-0000:00:05.0-video-index5 -> ../../video5
lrwxrwxrwx 1 root root 12 Jan 14 11:45 pci-0000:00:05.0-video-index6 -> ../../video6
lrwxrwxrwx 1 root root 12 Jan 14 11:45 pci-0000:00:05.0-video-index7 -> ../../video8

I receive the same segmentation fault as the original author. I tried almost all versions v5 and v6 either the pre-compiled or self compiled. As the output is not very comprehensive, is there a way for a more verbose version? Interestingly I have no file in

/etc/linux-enable-ir-emitter/

It looks to me that the segmentation fault happens early on.

Thank you