Closed floydelcy closed 1 month ago
The project runs fine on rk3568. Please use the project configuration for testing first. If it still doesn't work, consider whether there is a problem with the kernel.
run with --encoder=mpp --resolution=1920x1080 in gdb and unpluged the hdmi streamer will create two New Threads LWP 18387(us_mpp_jpeg_encoder_init in encoder.c) and LWP 18388(worker pool),but it only destoryed LWP 18388 Thread when ERROR ,and it will increase the memory usage about 16M in each polling.
================================================================================
-- INFO [2671.418 stream] -- Device fd=9 opened
-- INFO [2671.418 stream] -- Using resolution: 1920x1080
-- INFO [2671.418 stream] -- Using format: UYVY
-- INFO [2671.418 stream] -- Querying HW FPS changing is not supported
-- INFO [2671.418 stream] -- Using IO method: MMAP
-- INFO [2671.430 stream] -- Requested 5 device buffers, got 5
-- INFO [2671.455 stream] -- Capturing started
-- INFO [2671.456 stream] -- Switching to MPP encoder ...
`[New Thread 0x7fef4edd60 (LWP 18387)]`
-- INFO [2671.466 stream] -- Using JPEG quality: 80%
-- INFO [2671.466 stream] -- Creating pool JPEG with 1 workers ...
`New Thread 0x7feecddd60 (LWP 18388)]`
-- INFO [2671.468 stream] -- Capturing ...
-- ERROR [2672.469 stream] -- Mainloop select() error: Inappropriate ioctl for device
-- INFO [2672.469 stream] -- Destroying workers pool JPEG ...
`[Thread 0x7feecddd60 (LWP 18388) exited]`
-- INFO [2673.016 stream] -- Capturing stopped
-- INFO [2673.022 stream] -- Device fd=9 closed
================================================================================
-- INFO [2673.024 stream] -- Device fd=9 opened
-- INFO [2673.024 stream] -- Using resolution: 1920x1080
-- INFO [2673.024 stream] -- Using format: UYVY
-- INFO [2673.024 stream] -- Querying HW FPS changing is not supported
-- INFO [2673.024 stream] -- Using IO method: MMAP
-- INFO [2673.029 stream] -- Requested 5 device buffers, got 5
-- INFO [2673.040 stream] -- Capturing started
-- INFO [2673.040 stream] -- Switching to MPP encoder ...
[New Thread 0x7feecddd60 (LWP 18389)]
-- INFO [2673.044 stream] -- Using JPEG quality: 80%
-- INFO [2673.044 stream] -- Creating pool JPEG with 1 workers ...
[New Thread 0x7fee4cdd60 (LWP 18390)]
-- INFO [2673.046 stream] -- Capturing ...
-- ERROR [2674.047 stream] -- Mainloop select() error: Inappropriate ioctl for device
-- INFO [2674.047 stream] -- Destroying workers pool JPEG ...
[Thread 0x7fee4cdd60 (LWP 18390) exited]
-- INFO [2674.599 stream] -- Capturing stopped
-- INFO [2674.622 stream] -- Device fd=9 closed
================================================================================
Maybe you can refer to here https://github.com/pikvm/ustreamer/issues?q=Mainloop+select%28%29+error%3A+Inappropriate+ioctl+for+device
Inappropriate ioctl for device is not the keypoint that is caused by unpluged the HDMI cable or HDMI no signal ,the keyponit is memory leaking in that situation.
if (type == US_ENCODER_TYPE_MPP) {
US_LOG_INFO("Switching to MPP encoder ...");
_ER(mpp) = us_mpp_jpeg_encoder_init(dev->width, dev->height, MPP_FMT_YUV422_UYVY, 30, quality);
n_workers = 1;
}
when I changed the config "forever:false" and comment "--persistent" in override.yaml to let streamer poll the states all time, It works well before hdmi-in unpluged or no signal,when hdmi has no signal or unpluged for few minutes the kvmd will crush and restart, there are some OOM mesesages in kernel log