-
Notifications
You must be signed in to change notification settings - Fork 7
Description
I was curious to see if this could be a viable work-around of reufer/rpihddevice#5 for my Raspberry Pi 2.
Good news first: the code as of cbccef7 compiled out of the box after the following:
sudo apt install libasound2-dev libavfilter-dev
and applying the patch:
diff --git a/Makefile b/Makefile
index 93391b5..f51e21b 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ PLUGIN = softhddevice-drm
### Configuration (edit this for your needs)
# enable this for MMAL (RaspberryPi 2)
-MMAL ?= 0
+MMAL ?= 1
CONFIG := #-DDEBUG # enable debug output+functions
#CONFIG += -DAV_SYNC_DEBUG # enable debug messages AV_SYNC
On startup, I got an on-screen-display layer for the current channel, followed by a SIGSEGV before any video or audio played:
vdr --no-kbd --lirc -Psofthddevice-drm -v /var/lib/vdr/video
Here is the output followed by a stack trace of the crashing thread:
mmal: mmal_vc_port_info_set: failed to set port info (2:0): EINVAL
mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x6131e720 (EINVAL)
Failed to commit deinterlace intput format (status=3 EINVAL)
mmal: mmal_vc_port_enable: failed to enable port vc.ril.image_fx:in:0(OPQV): EINVAL
mmal: mmal_port_enable: failed to enable port vc.ril.image_fx:in:0(OPQV)(0x6131e720) (EINVAL)
Failed to enable deinterlace input port vc.ril.image_fx:in:0(OPQV) (3, EINVAL)
mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL
mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x6131eae0 (EINVAL)
Failed to commit deinterlace output format (status=3 EINVAL)
mmal: mmal_vc_port_enable: failed to enable port vc.ril.image_fx:out:0(OPQV): EINVAL
mmal: mmal_port_enable: failed to enable port vc.ril.image_fx:out:0(OPQV)(0x6131eae0) (EINVAL)
Failed to enable deinterlacer output port vc.ril.image_fx:out:0(OPQV) (3, EINVAL)
Failed send buffer to deinterlacer output port (3, EINVAL)
Failed send buffer to deinterlacer output port (3, EINVAL)
Failed send buffer to deinterlacer output port (3, EINVAL)
Thread 15 "softhddev video" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x612ff400 (LWP 2379)]
VideoRenderFrame (render=0x2ea2e0, video_ctx=<optimized out>,
frame=<optimized out>) at video_mmal.c:889
889 memcpy(qbuffer->data, buffer->data, buffer->length);
(gdb) bt
#0 VideoRenderFrame (render=0x2ea2e0, video_ctx=<optimized out>,
frame=<optimized out>) at video_mmal.c:889
#1 0x76454fe4 in CodecVideoReceiveFrame (decoder=0x309328,
no_deint=no_deint@entry=0) at codec.c:376
#2 0x7644e9d0 in VideoDecodeInput (stream=0x7646a858 <MyVideoStream>)
at softhddev.c:1117
#3 0x76450498 in DisplayHandlerThread (arg=0x2ea2e0) at video_mmal.c:723
#4 0x76f4f494 in start_thread (arg=0x612ff400) at pthread_create.c:486
#5 0x76bb0dd8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73
from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
This is not a permission issue, because I got the same crash when running the software as the super user. I repeated this crash on two kernel versions:
Linux version 5.10.63-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1496 SMP Wed Dec 1 15:58:11 GMT 2021
and the newest that is currently available in Raspberry OS Lite (Legacy), raspberrypi/rpi-firmware@921f5ef:
Linux version 5.15.78-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1599 SMP Fri Nov 11 12:23:22 GMT 2022
The current channel was in a DVB-T2 bouguet. After I edited CurrentChannel
in setup.conf
to point to a DVB-T channel, it started to work, with subtitles and everything, using between 10% and 40% of one CPU core. There was nothing output to the standard output or error streams until I attempted to switch to a DVB-T channel:
AlsaPlayer: ring buffer empty
mmal: mmal_vc_port_info_set: failed to set port info (2:0): EINVAL
mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x221b490 (EINVAL)
Failed to commit deinterlace intput format (status=3 EINVAL)
mmal: mmal_vc_port_enable: failed to enable port vc.ril.image_fx:in:0(OPQV): EINVAL
mmal: mmal_port_enable: failed to enable port vc.ril.image_fx:in:0(OPQV)(0x221b490) (EINVAL)
Failed to enable deinterlace input port vc.ril.image_fx:in:0(OPQV) (3, EINVAL)
mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL
mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x221b7a0 (EINVAL)
Failed to commit deinterlace output format (status=3 EINVAL)
mmal: mmal_vc_port_enable: failed to enable port vc.ril.image_fx:out:0(OPQV): EINVAL
mmal: mmal_port_enable: failed to enable port vc.ril.image_fx:out:0(OPQV)(0x221b7a0) (EINVAL)
Failed to enable deinterlacer output port vc.ril.image_fx:out:0(OPQV) (3, EINVAL)
These messages were followed by SIGSEGV with the above stack trace. If I understood correctly, DVB-T2 here uses the H.264 encoding. It is supported natively by rpihddevice
.