Tuesday, September 17, 2024

Tracking not working webcam in LG 5K Display

misc@,

I hope that this is the rigth place for this email.

I do have LG 5K Display which works well as external monitor. It has embeded
audio which works, and webcam which doesn't.

Here an attempt to run ffplay as:

ktrace ffplay -f v4l2 -input_format mjpeg -video_size 1920x1080 -i /dev/video0

which turn for a moment green led inside cam on, but just for a moment.

Quite soon it had an error:

ioctl(VIDIOC_DQBUF): Invalid argument

and ffplay goes to state from where I can't kill it, nor exit. ps shows it as:

catap 32871 0.0 0.3 29236 45860 p1 RE+/3 10:37PM 0:00.55 (ffplay)

Anyway, I can share dmesg from kernel which was build with UVIDEO_DEBUG,
ktrace on ffplay and its stdout here:

- https://kirill.korins.ky/pub/LG-UltraFine-video.dmesg
- https://kirill.korins.ky/pub/LG-UltraFine-video.ffplay
- https://kirill.korins.ky/pub/LG-UltraFine-video.ktrace.out

kdump shows calls near ioctl(VIDIOC_DQBUF):

32871 ffplay CALL kbind(0xebc99793208,24,0x5736b1de16970d69)
32871 ffplay RET kbind 0
32871 ffplay CALL kbind(0xebc997932a8,24,0x5736b1de16970d69)
32871 ffplay RET kbind 0
32871 ffplay CALL ioctl(9,VIDIOC_DQBUF,0xebc99793280)
32871 ffplay STRU struct timespec { 0 }
32871 ffplay RET nanosleep 0
32871 ffplay CALL write(2,0x6ff015cd47d4,0x45)
32871 ffplay GIO fd 2 wrote 69 bytes
" nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 \r"
32871 ffplay RET write 69/0x45
32871 ffplay CALL recvmsg(3,0x6ff015cd4dc0,0)
32871 ffplay RET recvmsg -1 errno 35 Resource temporarily unavailable
32871 ffplay CALL recvmsg(3,0x6ff015cd4de0,0)
32871 ffplay RET recvmsg -1 errno 35 Resource temporarily unavailable
32871 ffplay CALL recvmsg(3,0x6ff015cd4d90,0)
...
32871 ffplay RET recvmsg -1 errno 35 Resource temporarily unavailable
32871 ffplay CALL nanosleep(0x6ff015cd50c0,0x6ff015cd50c0)
32871 ffplay STRU struct timespec { 0.010000000 }
32871 ffplay RET ioctl -1 errno 22 Invalid argument
32871 ffplay CALL kbind(0xebc99793158,24,0x5736b1de16970d69)
32871 ffplay RET kbind 0
32871 ffplay CALL kbind(0xebc99793158,24,0x5736b1de16970d69)
32871 ffplay RET kbind 0
32871 ffplay CALL kbind(0xebc99793118,24,0x5736b1de16970d69)
32871 ffplay RET kbind 0
32871 ffplay CALL kbind(0xebc99791c18,24,0x5736b1de16970d69)
32871 ffplay RET kbind 0
32871 ffplay CALL write(2,0xebc99791420,0x2f)
32871 ffplay GIO fd 2 wrote 47 bytes
"\^[[0;35m[video4linux2,v4l2 @ 0xebd29912000] \^[[0m"
32871 ffplay RET write 47/0x2f
32871 ffplay CALL write(2,0xebc99791420,0x31)
32871 ffplay GIO fd 2 wrote 49 bytes
"\^[[1;31mioctl(VIDIOC_DQBUF): Invalid argument
\^[[0m"

and dmesg has only:

uvideo0: uvideo_open: sc=0xffff800001ecd000
uvideo0: uvideo_s_fmt: requested width=1920, height=1080
uvideo0: uvideo_find_res: frame index 0: width=1920, height=1080
uvideo0: uvideo_find_res: frame index 1: width=1280, height=720
uvideo0: uvideo_find_res: frame index 2: width=1024, height=768
uvideo0: uvideo_find_res: frame index 3: width=640, height=480
uvideo0: uvideo_find_res: frame index 4: width=320, height=240
uvideo0: SET probe request successfully
bmHint=0x01
bFormatIndex=0x02
bFrameIndex=0x02
dwFrameInterval=333333 (100ns units)
wKeyFrameRate=0
wPFrameRate=0
wCompQuality=0
wCompWindowSize=0
wDelay=0 (ms)
dwMaxVideoFrameSize=0 (bytes)
dwMaxPayloadTransferSize=0 (bytes)
uvideo0: GET probe request successfully
bmHint=0x00
bFormatIndex=0x02
bFrameIndex=0x02
dwFrameInterval=333333 (100ns units)
wKeyFrameRate=0
wPFrameRate=0
wCompQuality=0
wCompWindowSize=0
wDelay=0 (ms)
dwMaxVideoFrameSize=4147200 (bytes)
dwMaxPayloadTransferSize=46080 (bytes)
uvideo0: SET commit request successfully
uvideo0: uvideo_s_fmt: offered width=1920, height=1080
uvideo0: uvideo_reqbufs: count=256
uvideo0: allocated 33177600 bytes mmap buffer
uvideo0: uvideo_reqbufs: index=0, offset=0, length=4147200
uvideo0: uvideo_reqbufs: index=1, offset=4147200, length=4147200
uvideo0: uvideo_reqbufs: index=2, offset=8294400, length=4147200
uvideo0: uvideo_reqbufs: index=3, offset=12441600, length=4147200
uvideo0: uvideo_reqbufs: index=4, offset=16588800, length=4147200
uvideo0: uvideo_reqbufs: index=5, offset=20736000, length=4147200
uvideo0: uvideo_reqbufs: index=6, offset=24883200, length=4147200
uvideo0: uvideo_reqbufs: index=7, offset=29030400, length=4147200
uvideo0: uvideo_querybuf: index=0, offset=0, length=4147200
uvideo0: uvideo_querybuf: index=1, offset=4147200, length=4147200
uvideo0: uvideo_querybuf: index=2, offset=8294400, length=4147200
uvideo0: uvideo_querybuf: index=3, offset=12441600, length=4147200
uvideo0: uvideo_querybuf: index=4, offset=16588800, length=4147200
uvideo0: uvideo_querybuf: index=5, offset=20736000, length=4147200
uvideo0: uvideo_querybuf: index=6, offset=24883200, length=4147200
uvideo0: uvideo_querybuf: index=7, offset=29030400, length=4147200
uvideo0: uvideo_vs_open
uvideo0: set alternate iface to bAlternateSetting=0x00 psize=512 max_packet_size=46080
uvideo0: open pipe for bEndpointAddress=0x83
uvideo0: nframes=40
uvideo0: allocated 46080 bytes bulk VS xfer buffer
uvideo0: uvideo_vs_alloc_frame: allocated 4147200 bytes frame buffer

I made an assumption that it contains some bugs which requires some quirks,
and I had search in linux kernel, but I haven't found aynthing.

Here, I have no idea how and where dig future.


--
wbr, Kirill

No comments:

Post a Comment