-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing video signal(?) when running hello_triangle and omxplayer at the same time #407
Comments
Does adding dispmanx_offline=1 to config.txt avoid the issue (most likely with reduced framerate and increased gpu memory)? |
That does indeed help but as you said greatly reduces the framerate when the video is then played in fullscreen. I didn't know about dispmanx_offline before, and I found this thread on the forum: http://www.raspberrypi.org/forums/viewtopic.php?f=67&t=80218. I have a few questions now:
Thanks for your quick response! |
You currently have 4 overlays on the screen: The HVS (hardware video scalar) can work in an online or offline mode. The alternative is offline mode. We composite to an offscreen buffer in memory, and then output that to the display. This removes the real time constraint, but it is much less efficient, so you tend to halve the framerate. I'd suggest you remove the framebuffer, and remove the --blank option (which is just hiding the unwanted framebuffer). Easiest way to remove framebuffer is You can also remove framebuffer with: |
Thanks for the explanation. Echoing 0 to vtcon1/bind seems to stops the framebuffer from being updated but its current content is still visible. So I suspect the layer is still composed by the hardware? Is there a way to see how many layers are currently active? Your proposed solution would of course work for that setup, but that's just the easiest way to replicate a problem I having with my own program. I might not be able to predict layer sizes and counts there so it might be helpful to better understand the hardware limits. I didn't have problems displaying 4 videos (non-FullHD) at the same time. Each of them rendering using their own render component. So I guess it all depends on how expensive resizing and memory bandwidth is? Do you think it might help to resize the video (using a resize component) to the layer size? |
Unscaled images are cheaper than scaled. |
Thanks again. One last questions (for now): I guess there is no way to detect an HVS underrun other than looking at the screen? Because then I might at least throw some error instead of producing broken output. |
It will likely show in "sudo vcdbg log assert" output, but exactly how it shows depends on which resource ran out. |
It does:
Having a way to query this somehow using vcgencmd would be nice. |
See: raspberrypi/linux#766 kernel: Guard fiq_fsm_spin_lock with fiq_enable check See: raspberrypi/linux#913 kernel: BCM270x_DT: Add interrupt pin to enc28j60-overlay See: raspberrypi/linux#795 kernel: Add Device Tree support for RPi-DAC See: raspberrypi/linux#916 firmware: image_fx: Preserve the DATACORRUPT flag in the generated deinterlaced frame firmware: image_encode: Send ABORT_ENCODE when flushing codec to avoid a hang firmware: hdmi: Add config options for setting MAI threshold and dma priority See: http://forum.kodi.tv/showthread.php?tid=222061 firmware: gencmd: Add command for querying if hvs asserts have occurred See: #407
See: raspberrypi/linux#766 kernel: Guard fiq_fsm_spin_lock with fiq_enable check See: raspberrypi/linux#913 kernel: BCM270x_DT: Add interrupt pin to enc28j60-overlay See: raspberrypi/linux#795 kernel: Add Device Tree support for RPi-DAC See: raspberrypi/linux#916 firmware: image_fx: Preserve the DATACORRUPT flag in the generated deinterlaced frame firmware: image_encode: Send ABORT_ENCODE when flushing codec to avoid a hang firmware: hdmi: Add config options for setting MAI threshold and dma priority See: http://forum.kodi.tv/showthread.php?tid=222061 firmware: gencmd: Add command for querying if hvs asserts have occurred See: raspberrypi/firmware#407
Thanks for that. I assume
returns the number of times the HVS had an underrun and resets the internal counter. Right? |
Correct. |
Thanks again. While this doesn't really "fix the problem" I now at least know what's going on and might work around it. Closing this issue. |
@popcornmix Is there a vcdbg command to get a list of currently active overlays that the HVS has to process? I just stumbled into this issue again (loosing HDMI sync for a second or two) and am wondering what might cause the HVS to fail here... Having an overview of active layers might help. |
There isn't currently. I agree a vcdbg/vcgencmd that displays the formats, source/dest rectangles and transform flags currently on the display, would be useful for debugging. vcdbg makes sense logically, but vcdbg works by directly reading the GPU's data structures. Need to check if doing this without locking and/or cache coherency produces useful information. A vcgencmd would parse the info on the GPU side, so will be cache coherent and can lock the structures. No promises when, but I'll add this to my list. |
@popcornmix Cool, thank you |
@julianscheel |
@popcornmix That was fast, thanks :) - I'll be able to test it on thursday. |
@popcornmix thanks for adding that feature! It's will be really useful to see what's going on. How is 'cost' calculated? What is 'lbm'? What's the meaning of the transform value? I guess it's the DISPMANX_TRANSFORM_T value that is used when creating a layer, except I pass DISPMANX_NO_ROTATE (0) for my GL layer and I see 20000. Or are GL layers always implicitly using DISPMANX_FLIP_VERT (2 << 17)? Would it be possible to include the layer number?
|
cost is an estimate of the number of cycles of HVS processing required for that element. If the sum of costs gets too high you may get HVS underruns and HDMI dropouts. lbm is the line buffer memory. That is the context required for vertical resizing. That is a dedicated block of memory in the HVS hardware of 96K. Go above that and elements can't be displayed. Adding the layer number can be done. The transform values are from DISPMANX_TRANSFORM_T. GL buffers do get an implicit vertical flip. There may be other bits set for internal status (like 3D left/right flags). |
@popcornmix Do you have an estimated threshold where cost will be too high? |
No. It is going to vary with hdmi mode (and the pixel clock used). It will vary with overclock (core_freq mostly, but sdram_freq will have an effect). It will vary with the busyness off the system (sdram latency may mean more cycles are required to process an element). |
Ok, makes sense. I am wondering a bit that in my case the dropout seem to happen randomly and last for 1-2 seconds. I do not see any hvs_asserts in this case though (so far still running with firmware from May 18th, will update tomorrow). It might be that my setup is right at the edge of what can be handled and the pixelclock adjustments done by the mmal latency target cause it to collapse from time to time. Does this sound sane to you? |
It's possibly, but I'd say sdram being busier periodically means the composition sometimes takes a bit longer is a more likely reason. |
Seems more likely indeed. Varying stream bandwidth might make the difference... I'll investigate it further. |
@popcornmix I'm having a bit of trouble running that firmware (in fact it's not a problem with the test firmware, but with any recent firmware. I probably have to bisect what's the first broken one for me). USB devices do not work anymore on a Model B Pi. I can see that bcm2708_usb is initialised by the kernel but no detected peripheral including the smsc network chip is detected. I've upgrade my kernel to 4.1.9 now, but without any change. I'm not using a device-tree enabled kernel yet, though. Do you have a clue what change might be related and what needs to be done to get USB back alive? |
kernel: config: Add CONFIG_UHID See: raspberrypi/linux#1148 firmware: gencmd: Add ability to dump display lists See: #407 firmware: arm_loader: Enable hypervisor mode and modify common startup code for 2836 See: #369
kernel: config: Add CONFIG_UHID See: raspberrypi/linux#1148 firmware: gencmd: Add ability to dump display lists See: raspberrypi/firmware#407 firmware: arm_loader: Enable hypervisor mode and modify common startup code for 2836 See: raspberrypi/firmware#369
@popcornmix f6ce0b0 is the breaking one for me. I presume the relevant change is: |
No immediate answer. Can you create a new issue for this as it's in danger of being lost in this closed issue. |
@popcornmix You're right, it's a bit misplaced in here. See #479 |
@popcornmix dispmanx_list works quite well for me. One thing that would be nice to have would be a pid of the owning process of that layer. But probably that's not easily achievable, is it? |
Not from where the command is implemented (dispmanx). I think the layer above (display_server) may have that info, but I'll have to see how ugly it would be to get hold of that. |
See: raspberrypi/linux#766 kernel: Guard fiq_fsm_spin_lock with fiq_enable check See: raspberrypi/linux#913 kernel: BCM270x_DT: Add interrupt pin to enc28j60-overlay See: raspberrypi/linux#795 kernel: Add Device Tree support for RPi-DAC See: raspberrypi/linux#916 firmware: image_fx: Preserve the DATACORRUPT flag in the generated deinterlaced frame firmware: image_encode: Send ABORT_ENCODE when flushing codec to avoid a hang firmware: hdmi: Add config options for setting MAI threshold and dma priority See: http://forum.kodi.tv/showthread.php?tid=222061 firmware: gencmd: Add command for querying if hvs asserts have occurred See: raspberrypi#407
kernel: config: Add CONFIG_UHID See: raspberrypi/linux#1148 firmware: gencmd: Add ability to dump display lists See: raspberrypi#407 firmware: arm_loader: Enable hypervisor mode and modify common startup code for 2836 See: raspberrypi#369
While developing an omx based video player for the Pi I observed that sometimes the video signal gets lost when I play videos. I've been able to reproduce it by running these two programs at the same time:
I'm using a NOOBs installed raspbian with all packages updated to the latest version. I updated the firmware files using rpi-update. I observed the above behavior on different screens:
On the last screen it works when I'm using the
win
parameters above. But once I change them to0 0 1280 100
it stops working. I tried different things but I keep getting a blank screen/lost video signal:Using the complete screen space in the
win
parameter (or simply omitting it) works. It sometime also works with otherwin
sizes, but I did not yet find any reliable pattern. It also works when I get rid of the blank layer.There is also a corresponding thread on http://www.raspberrypi.org/forums/viewtopic.php?f=67&t=105906
It sounds a bit like #286, so I tried running tvservice -s in a loop while the screen goes blank: tvservice keeps reporting the correct resolution. This thread sounds like it might have the same root cause: http://www.raspberrypi.org/forums/viewtopic.php?f=67&t=50126, sadly there is no solution.
Firmware version is
Kernel is
omxplayer versions tested are (from raspbian):
and latest version from omxplayer.sconde.net
The text was updated successfully, but these errors were encountered: