Tuesday, August 10, 2021

OpenCV no support for memory mapping / insufficient buffer memory

Hello!

This is a follow-up to a post I made to misc@ about OpenCV not being
able to open a camera to capture images.  Switching to ports@ as this
seems more appropriate for this error.

https://marc.info/?l=openbsd-misc&m=162853582527839&w=2

Kevin Lo had also run into the problem and had submitted a patch:

https://marc.info/?l=openbsd-ports-cvs&m=162857744213080&w=2

I built the new version of OpenCV 4.5.2 today and yes, it can open the
camera, but attempting to capture an image prints the following for each
image: [ WARN:0] global
/usr/ports/pobj/opencv-4.5.2/opencv-4.5.2/modules/videoio/src/cap_v4l.cpp
(798) requestBuffers VIDEOIO(V4L2:/dev/video0): no support for memory
mapping [ WARN:0] global
/usr/ports/pobj/opencv-4.5.2/opencv-4.5.2/modules/videoio/src/cap_v4l.cpp
(777) requestBuffers VIDEOIO(V4L2:/dev/video0): Insufficient buffer
memory Trying to access the list of captured images yields this:
OpenCV(4.5.2)
/usr/ports/pobj/opencv-4.5.2/opencv-4.5.2/modules/core/src/matrix.cpp:456:
error: (-215:Assertion failed) total() == 0 || data != NULL in function
'Mat' Exception caught! OpenCV(4.5.2)
/usr/ports/pobj/opencv-4.5.2/opencv-4.5.2/modules/core/src/matrix.cpp:456:
error: (-215:Assertion failed) total() == 0 || data != NULL in function
'Mat' At that point my python script exits due to the exception. OpenCV
docs don't seem to get into buffer management other than via an internal
function to be used only by OpenCV. Would this be a missing parameter in
how OpenCV is built or is it something I can control from a sysctl of
some kind? dmesg follows but this stick computer has 4G of ram and
doesn't have much anything running on it. Thanks! Jeff Ross OpenBSD 6.9 (GENERIC.MP) #473: Mon Apr 19 10:40:28 MDT 2021
deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4099731456 (3909MB)
avail mem = 3960102912 (3776MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.0 @ 0xe9c60 (84 entries)
bios0: vendor American Megatrends Inc. version "2.0" date 09/18/2020
bios0: AXON Mini PC Stick
acpi0 at bios0: ACPI 6.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP FPDT FIDT MCFG DBG2 DBGP LPIT APIC NPKT PRAM WSMT SSDT SSDT SSDT SSDT SSDT SSDT SSDT SSDT UEFI BGRT WDAT NHLT
acpi0: wakeup devices HDAS(S3) PRT0(S4) PRT1(S4) XHC_(S4) XDCI(S4) BRCM(S0) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) PXSX(S4) RP04(S4) PXSX(S4) RP05(S4) PXSX(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimcfg0 at acpi0
acpimcfg0: addr 0xe0000000, bus 0-255
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Celeron(R) CPU J3355 @ 2.00GHz, 1996.20 MHz, 06-5c-09
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SMEP,ERMS,MPX,RDSEED,SMAP,CLFLUSHOPT,PT,SHA,MD_CLEAR,IBRS,IBPB,STIBP,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu0: 1MB 64b/line 16-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 19MHz
cpu1 at mainbus0: apid 4 (application processor)
cpu1: Intel(R) Celeron(R) CPU J3355 @ 2.00GHz, 1995.43 MHz, 06-5c-09
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SMEP,ERMS,MPX,RDSEED,SMAP,CLFLUSHOPT,PT,SHA,MD_CLEAR,IBRS,IBPB,STIBP,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu1: 1MB 64b/line 16-way L2 cache
cpu1: smt 0, core 2, package 0
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 120 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (RP01)
acpiprt2 at acpi0: bus 2 (RP02)
acpiprt3 at acpi0: bus -1 (RP03)
acpiprt4 at acpi0: bus -1 (RP04)
acpiprt5 at acpi0: bus -1 (RP05)
acpiprt6 at acpi0: bus -1 (RP06)
aplgpio0 at acpi0 GPO0 uid 1 addr 0xd0c50000/0x76c irq 14, 78 pins
acpipci0 at acpi0 PCI0: 0x00000000 0x00000011 0x00000001
acpicmos0 at acpi0
acpibtn0 at acpi0: PWRB
aplgpio1 at acpi0 GPO1 uid 2 addr 0xd0c40000/0x764 irq 14, 77 pins
aplgpio2 at acpi0 GPO2 uid 3 addr 0xd0c70000/0x674 irq 14, 47 pins
aplgpio3 at acpi0 GPO3 uid 4 addr 0xd0c00000/0x654 irq 14, 43 pins
"ACPI0011" at acpi0 not configured
"INT33A1" at acpi0 not configured
"INT3400" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
acpicpu0 at acpi0: C3(10@150 io@0x419), C2(10@50 io@0x415), C1(1000@1 halt), PSS
acpicpu1 at acpi0: C3(10@150 io@0x419), C2(10@50 io@0x415), C1(1000@1 halt), PSS
acpipwrres0 at acpi0: SPPR
acpipwrres1 at acpi0: SPPR
acpipwrres2 at acpi0: UPPR
acpipwrres3 at acpi0: PX03, resource for HS03, MODM
acpipwrres4 at acpi0: UPPR
acpipwrres5 at acpi0: UPPR
acpipwrres6 at acpi0: UPPR
acpipwrres7 at acpi0: UPPR
acpipwrres8 at acpi0: UPPR
acpipwrres9 at acpi0: PXP_, resource for RP01
acpipwrres10 at acpi0: PXP_, resource for RP03
acpipwrres11 at acpi0: PXP_, resource for RP04
acpipwrres12 at acpi0: PXP_, resource for RP06
acpipwrres13 at acpi0: PAUD
acpipwrres14 at acpi0: LSPR, resource for I2C0, I2C1, I2C2, I2C3, I2C4, I2C5, I2C6, I2C7, URT1, URT2, URT3, URT4, SPI1, SPI2, SPI3, PWM_
acpipwrres15 at acpi0: SDPR, resource for SDHA, SDIO
acpipwrres16 at acpi0: USBC, resource for XDCI
acpipwrres17 at acpi0: FN00, resource for FAN0
acpitz0 at acpi0: critical temperature is 100 degC
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: Enhanced SpeedStep 1996 MHz: speeds: 2001, 2000, 1900, 1800, 1700, 1600, 1500, 1400, 1300, 1200, 1100, 1000, 900, 800 MHz
pci0 at mainbus0 bus 0
0:24:2: mem address conflict 0xfea10000/0x1000
pchb0 at pci0 dev 0 function 0 "Intel Apollo Lake Host" rev 0x0b
vendor "Intel", unknown product 0x5a8c (class DASP subclass miscellaneous, rev 0x0b) at pci0 dev 0 function 1 not configured
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 500" rev 0x0b
drm0 at inteldrm0
inteldrm0: msi, BROXTON, gen 9
azalia0 at pci0 dev 14 function 0 "Intel Apollo Lake HD Audio" rev 0x0b: msi
azalia0: no supported codecs
"Intel Apollo Lake TXE" rev 0x0b at pci0 dev 15 function 0 not configured
ppb0 at pci0 dev 20 function 0 "Intel Apollo Lake PCIE" rev 0xfb
pci1 at ppb0 bus 1
ppb1 at pci0 dev 20 function 1 "Intel Apollo Lake PCIE" rev 0xfb: msi
pci2 at ppb1 bus 2
iwm0 at pci2 dev 0 function 0 "Intel AC 7265" rev 0x59, msi
xhci0 at pci0 dev 21 function 0 "Intel Apollo Lake xHCI" rev 0x0b: msi, xHCI 1.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev 3.00/1.00 addr 1
dwiic0 at pci0 dev 22 function 0 "Intel Apollo Lake I2C" rev 0x0b: apic 1 int 27
iic0 at dwiic0
dwiic1 at pci0 dev 22 function 1 "Intel Apollo Lake I2C" rev 0x0b: apic 1 int 28
iic1 at dwiic1
dwiic2 at pci0 dev 22 function 2 "Intel Apollo Lake I2C" rev 0x0b: apic 1 int 29
iic2 at dwiic2
dwiic3 at pci0 dev 22 function 3 "Intel Apollo Lake I2C" rev 0x0b: apic 1 int 30
iic3 at dwiic3
dwiic4 at pci0 dev 23 function 0 "Intel Apollo Lake I2C" rev 0x0b: apic 1 int 31
iic4 at dwiic4
dwiic5 at pci0 dev 23 function 1 "Intel Apollo Lake I2C" rev 0x0b: apic 1 int 32
iic5 at dwiic5
dwiic6 at pci0 dev 23 function 2 "Intel Apollo Lake I2C" rev 0x0b: apic 1 int 33
iic6 at dwiic6
dwiic7 at pci0 dev 23 function 3 "Intel Apollo Lake I2C" rev 0x0b: apic 1 int 34
iic7 at dwiic7
com4 at pci0 dev 24 function 0 "Intel Apollo Lake HSUART" rev 0x0b: ns16550, no working fifo
com5 at pci0 dev 24 function 1 "Intel Apollo Lake HSUART" rev 0x0b: ns16550, no working fifo
com6 at pci0 dev 24 function 2 "Intel Apollo Lake HSUART" rev 0x0b: not a UART
com7 at pci0 dev 24 function 3 "Intel Apollo Lake HSUART" rev 0x0b: ns16550, no working fifo
"Intel Apollo Lake SPI" rev 0x0b at pci0 dev 25 function 0 not configured
"Intel Apollo Lake SPI" rev 0x0b at pci0 dev 25 function 1 not configured
"Intel Apollo Lake SPI" rev 0x0b at pci0 dev 25 function 2 not configured
"Intel Apollo Lake PWM" rev 0x0b at pci0 dev 26 function 0 not configured
sdhc0 at pci0 dev 27 function 0 "Intel Apollo Lake SD/MMC" rev 0x0b: apic 1 int 3
sdhc0: SDHC 3.0, 200 MHz base clock
sdmmc0 at sdhc0: 4-bit, sd high-speed, mmc high-speed, ddr52, dma
sdhc1 at pci0 dev 28 function 0 "Intel Apollo Lake eMMC" rev 0x0b: apic 1 int 39
sdhc1: SDHC 3.0, 200 MHz base clock
sdmmc1 at sdhc1: 8-bit, sd high-speed, mmc high-speed, ddr52, dma
pcib0 at pci0 dev 31 function 0 "Intel Apollo Lake LPC" rev 0x0b
ichiic0 at pci0 dev 31 function 1 "Intel Apollo Lake SMBus" rev 0x0b: polling
iic8 at ichiic0
isa0 at pcib0
isadma0 at isa0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
efifb at mainbus0 not configured
scsibus1 at sdmmc1: 2 targets, initiator 0
sd0 at scsibus1 targ 1 lun 0: <SD/MMC, SLD64G, 0000> removable
sd0: 59000MB, 512 bytes/sector, 120832000 sectors
uvideo0 at uhub0 port 2 configuration 1 interface 0 "USB 4K Camera USB 4K Camera" rev 2.00/4.19 addr 2
video0 at uvideo0
uaudio0 at uhub0 port 2 configuration 1 interface 3 "USB 4K Camera USB 4K Camera" rev 2.00/4.19 addr 2
uaudio0: class v1, high-speed, sync, channels: 0 play, 2 rec, 2 ctls
audio0 at uaudio0
ugen0 at uhub0 port 7 "Intel Bluetooth" rev 2.00/0.03 addr 3
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (e0ba285b066ac610.a) swap on sd0b dump on sd0b
drm:pid0:rc6_supported *NOTICE* RC6 and powersaving disabled by BIOS
inteldrm0: 1024x768, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
iwm0: hw rev 0x210, fw ver 17.3216344376.0, address b8:9a:2a:88:b8:af

No comments:

Post a Comment