PetePriority / chicony-ir-toggle

MIT License
37 stars 8 forks source link

doesn't work on Thinkpad T570 #14

Open 532910 opened 3 years ago

532910 commented 3 years ago
% ./chicony-ir-toggle -d /dev/video0 off       
Error code: -1, errno: 2, error: No such file or directory

% ./chicony-ir-toggle -d /dev/video1 off
Error code: -1, errno: 25, error: Inappropriate ioctl for device

mpv shows image from video0 and fails for video1:

% mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg --vf=hflip av://v4l2:/dev/video1
[ffmpeg/demuxer] video4linux2,v4l2: ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device
[lavf] avformat_open_input() failed
Failed to recognize file format.

Exiting... (Errors when loading file)

lsusb:

Bus 001 Device 006: ID 04f2:b5ab Chicony Electronics Co., Ltd Integrated Camera
% v4l2-ctl -d /dev/video0 --all

Driver Info:
    Driver name      : uvcvideo
    Card type        : Integrated IR Camera: Integrate
    Bus info         : usb-0000:00:14.0-5
    Driver version   : 5.10.40
    Capabilities     : 0x84a00001
        Video Capture
        Metadata Capture
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps      : 0x04200001
        Video Capture
        Streaming
        Extended Pix Format
Media Driver Info:
    Driver name      : uvcvideo
    Model            : Integrated IR Camera: Integrate
    Serial           : 
    Bus info         : usb-0000:00:14.0-5
    Media version    : 5.10.40
    Hardware revision: 0x00000024 (36)
    Driver version   : 5.10.40
Interface Info:
    ID               : 0x03000002
    Type             : V4L Video
Entity Info:
    ID               : 0x00000001 (1)
    Name             : Integrated IR Camera: Integrate
    Function         : V4L2 I/O
    Flags         : default
    Pad 0x01000007   : 0: Sink
      Link 0x02000019: from remote pad 0x100000a of entity 'Extension 6': Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
    Width/Height      : 640/480
    Pixel Format      : 'MJPG' (Motion-JPEG)
    Field             : None
    Bytes per Line    : 0
    Size Image        : 614400
    Colorspace        : sRGB
    Transfer Function : Rec. 709
    YCbCr/HSV Encoding: ITU-R 601
    Quantization      : Default (maps to Full Range)
    Flags             : 
Crop Capability Video Capture:
    Bounds      : Left 0, Top 0, Width 640, Height 480
    Default     : Left 0, Top 0, Width 640, Height 480
    Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 640, Height 480, Flags: 
Streaming Parameters Video Capture:
    Capabilities     : timeperframe
    Frames per second: 60.000 (60/1)
    Read buffers     : 0
                     brightness 0x00980900 (int)    : min=0 max=255 step=1 default=128 value=128
                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=32 value=32
                     saturation 0x00980902 (int)    : min=0 max=100 step=1 default=64 value=64
                            hue 0x00980903 (int)    : min=-180 max=180 step=1 default=0 value=0
 white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1
                          gamma 0x00980910 (int)    : min=90 max=150 step=1 default=120 value=120
                           gain 0x00980913 (int)    : min=1 max=7 step=1 default=1 value=1
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=2 value=2
                0: Disabled
                1: 50 Hz
                2: 60 Hz
      white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=1 default=4000 value=4000 flags=inactive
                      sharpness 0x0098091b (int)    : min=0 max=7 step=1 default=2 value=2
         backlight_compensation 0x0098091c (int)    : min=0 max=1 step=1 default=0 value=0
                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=3
                1: Manual Mode
                3: Aperture Priority Mode
              exposure_absolute 0x009a0902 (int)    : min=10 max=333 step=1 default=156 value=156 flags=inactive
         exposure_auto_priority 0x009a0903 (bool)   : default=0 value=1
% v4l2-ctl -d /dev/video1 --all

Driver Info:
    Driver name      : uvcvideo
    Card type        : Integrated IR Camera: Integrate
    Bus info         : usb-0000:00:14.0-5
    Driver version   : 5.10.40
    Capabilities     : 0x84a00001
        Video Capture
        Metadata Capture
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps      : 0x04a00000
        Metadata Capture
        Streaming
        Extended Pix Format
Media Driver Info:
    Driver name      : uvcvideo
    Model            : Integrated IR Camera: Integrate
    Serial           : 
    Bus info         : usb-0000:00:14.0-5
    Media version    : 5.10.40
    Hardware revision: 0x00000024 (36)
    Driver version   : 5.10.40
Interface Info:
    ID               : 0x03000005
    Type             : V4L Video
Entity Info:
    ID               : 0x00000004 (4)
    Name             : Integrated IR Camera: Integrate
    Function         : V4L2 I/O
Priority: 2
Format Metadata Capture:
    Sample Format   : 'UVCH' (UVC Payload Header Metadata)
    Buffer Size     : 1024
EmixamPP commented 3 years ago

I allow myself to advise you to have a look at my repo https://github.com/EmixamPP/linux-enable-ir-emitter.