VIDIOC_G_STD: failed: Inappropriate ioctl doer device - python

I attempted the command below:
v4l2-ctl -d 0 --get-standard
But I get the error
VIDIOC_G_STD: failed: Inappropriate ioctl for device
The below command however works completely fine.
v4l2-ctl -d 0 --all
Any help would be appreciated. In my program when resetting the controls for my camera I am getting the Inappropriate ioctl for device.
v4l2-compliance
The above command fails four tests. I showed some of the failed tests below. I definitely need VIDIOC_QUERYCTRL to work.
Driver name : uvcvideo
Card type : HD Web Camera
Bus info : usb-3610000.xhci-4.1
Driver version: 4.9.140
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Compliance test for device /dev/video0 (not using libv4l2):
Test input 0:
Control ioctls:
fail: v4l2-test-controls.cpp(202): invalid query_ext_ctrl return code (5)
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: FAIL
fail: v4l2-test-controls.cpp(312): invalid queryctrl return code (5)
test VIDIOC_QUERYCTRL: FAIL
V4L2_CAP_TIMEPERFRAME
fail: v4l2-test-formats.cpp(1140): node->has_frmintervals && !cap->capability
test VIDIOC_G/S_PARM: FAIL
test VIDIOC_G_FMT: FAIL
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
fail: v4l2-test-buffers.cpp(574): VIDIOC_EXPBUF is supported, but the V4L2_MEMORY_MMAP support is missing, probably due to earlier failing format tests.
Test input 0:

Related

Python sounddevice gives "Blocking API not supported yet" error

Consider the following code
import sounddevice as sd
stream = sd.OutputStream(device = 1)
This runs without an error when I set device to be internal speaker of a windows laptop. But when I change the device number to another output device (earphone), I get the following error:
PortAudioError: Error opening OutputStream: Unanticipated host error [PaErrorCode -9999]: 'Blocking API not supported yet' [Windows WDM-KS error -9999]
Why is one of my devices working and the other not working?

Azure IOTEdge - Raspberry Pi 4 (standard_init_linux.go:207: exec user process caused "exec format error")

I am trying to follow the https://github.com/Azure/ai-toolkit-iot-edge/blob/master/IoT%20Edge%20anomaly%20detection%20tutorial/00-anomaly-detection-tutorial.ipynb tutorial. The one difference is that I am pushing to a Raspberry Pi 4. The edgeHub and edgeAgent start fine but my container machinelearningmodule fails.
sudo docker logs -f machinelearningmodule
standard_init_linux.go:207: exec user process caused "exec format error"
I have looked at this github issue which suggests using arm64v8/python images https://github.com/emqx/emqx-docker/issues/108.
However when I put this into the code...
image_config = ContainerImage.image_configuration(runtime= "python",
execution_script="iot_score.py",
conda_file="myenv.yml",
tags = {'area': "iot", 'type': "classification"},
description = "IOT Edge anomaly detection demo",
base_image = 'arm64v8/python'
)
I get the following error:
Step 2/25 : FROM arm64v8/python
no matching manifest for linux/amd64 in the manifest list entries
latest: Pulling from arm64v8/python
2020/02/18 17:48:41 Container failed during run: acb_step_0. No retries remaining.
So guessing that is a dead end. Any suggestions on where to go from here?
p.s. also tried this
https://stackoverflow.com/questions/59000007/standard-init-linux-go207-exec-user-process-caused-exec-format-error
doesn't work either sadly.

How to make from mpts udp (a pack of programs with id's) to video-stream with one program id (spts)

I trying to get the link of stream with one channel (not a pack of channels which gives me mpt stream) to paste it string to opencv VideoCapure. Because if I paste it mpt stream link to VideoCapture it give me the random (one of this channels in pack) program.
For example I have link : udp://#255.1.1.7:1234 and it have pack of programs (nikelodion, blablatv, brazzerstv and etc.).
I can visualize necessary channel via vlc like that:
vlc -vv -d udp://#225.1.1.7:1234 --program=24919
Where --program - it's id of necessary channel.
I can make stream via vlc:
vlc --ttl 12 udp://#225.1.1.7:1234 --program=24919 --sout '#std{access=udp, mux=ts, dst=192.168.40.73:1235}'
but it's giving me errors. I can videocapture that stream via opencv. But it also random channels on it
Errors that happened when I ran the second command:
ts demux error: libdvbpsi error (EIT decoder): 'last_section_number' differs whereas no discontinuity has occured
main decoder error: buffer deadlock prevented

Digital trigger for analog output

I want to trigger an analog output from a digital trigger on NI PCI 6713
http://www.ni.com/pdf/manuals/371011c.pdf
According to the datasheet I can use PFI <0..9> and those pins are indeed shown in green in NI MAX with ao/StartTrigger
My code is the following:
task = nidaqmx.Task()
task.ao_channels.add_ao_voltage_chan("Dev12/ao0")
task.triggers.start_trigger.cfg_dig_edge_start_trig("Dev12/PFI0")
task.timing.cfg_samp_clk_timing(rate=1)
task.start()
task.write([1,2,3,4,5,6,7,8,9,10,0])
I recieve the following error:
DaqError: Source terminal to be routed could not be found on the device.
Make sure the terminal name is valid for the specified device. Refer to Measurement & Automation Explorer for valid terminal names.
Property: DAQmx_DigEdge_StartTrig_Src
Property: DAQmx_DigEdge_StartTrig_Edge
Source Device: Dev12
Source Terminal: Dev12/PFI0
Channel Name: Dev12/ao0
Task Name: _unnamedTask<1C>
Status Code: -89120
I use Python 3.7
When specifying names for channels, the format is device_name/channel_name.
For physical terminals, the format is /device_name/terminal.
Note the leading slash for terminals:
task.ao_channels.add_ao_voltage_chan("Dev12/ao0")
task.triggers.start_trigger.cfg_dig_edge_start_trig("/Dev12/PFI0")
^
Here

Python crashed; how to decode segfault in dmesg log?

I have a Python daemon running on a 64-bit Linux box. It is crashing. Not a friendly, straightforward to debug, Python exception stack trace sort of crash, either-- this is a segmentation fault. Linux's dmesg log has a succinct post-mortem:
python2.7[27509]: segfault at 7fe500000008 ip 00007fe56644a891 sp 00007fe54e1fa230 error 4 in libpython2.7.so.1.0[7fe566359000+193000]
python2.7[23517]: segfault at 7f5600000008 ip 00007f568bb45891 sp 00007f5678e55230 error 4 in libpython2.7.so.1.0[7f568ba54000+193000]
libpython2.7.so.1.0 on this system has symbols and I can run objdump -d to get an assembly language dump. So I'm curious to know which function is causing the segfault.
How can I decode one of these dmesg segfault notices and find the errant function? One line says "7fe566359000+193000" and the next says "7f568ba54000+193000". I'm guessing this means both segfaults come from the same location. 193000 = 0x2f1e8. I thought that 0x2f1e8 would lead to an instruction in the Python library assembly dump, but it didn't; 0x2f1e8 is well out of range of the disassembly.
That is the address from the base of the library load, so you should compare it with the load address of .text as returned by (for example) eu-readelf:
flame#saladin ~ % eu-readelf -S /usr/lib/libpython2.7.so
There are 25 section headers, starting at offset 0x1b1a80:
Section Headers:
[Nr] Name Type Addr Off Size ES Flags Lk Inf Al
[ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0
[….]
[10] .text PROGBITS 000000000003f220 0003f220 000e02a0 0 AX 0 0 16
[….]
What you should be able to do is to use the address you got with the addr2line tool:
addr2line -e /usr/lib/libpython2.7.so 0x6e408
In this case I can't get the data because my copy of the library differs from yours so the address makes no sense.
Of course you still won't get a full backtrace unless you had a core file.

Categories

Resources