popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.01k stars 334 forks source link

2 instances of omxplayer using mpeg2 causes gpu lockup #386

Closed jmeiners closed 8 years ago

jmeiners commented 8 years ago

If you play 2 instances of omxplayer (windowed display) and both are using mpeg2 sources the gpu both videos will freeze and the gpu will stop responding to any vc commands till rebooted. (mpeg2 is licensed)

Is there a hardware/software limitation to only a single mpeg2 stream?

VittGam commented 8 years ago

Have you tried increasing the RAM allocated to the GPU to more than 128 MB? You can do it with gpu_mem in /boot/config.txt, or via raspi-config.

jmeiners commented 8 years ago

Yes, using 196M gpu on a pi2. It can run 6+ instances if it is h.264, but only 1 if mpeg2

carlonluca commented 8 years ago

Probably not the same issue, but it seems similar to raspberrypi/firmware#449. Although the problem is related also to h264 there.

jmeiners commented 8 years ago

Not really. This lockup happens immediately every time.

carlonluca commented 8 years ago

If you read all the messages you'll see that I can reproduce the same (or very similar) freeze in a few seconds when I run multiple players concurrently. The backtrace in every case is very similar (you'll have to read the messages after the first report).

carlonluca commented 8 years ago

Also maybe related to #379?

jmeiners commented 8 years ago

I think I have also seen the lockup you are referring to. Very rare but can happen.

This issue is I can run lots of h.264 instances but only 1 mpeg2.

carlonluca commented 8 years ago

If I run multiple players I get a complete lock of the GPU in a few seconds. If I run a single player I have a very rare lock, maybe related to frequent seek or however not sure. But I typically see both on h264. If you can run on gdb your omxplayer you may compare your backtraces with the ones I reported.

gkreidl commented 8 years ago

I suppose it's a firmware issue. I could play up to four SD MPEG TS channels a short while ago (before upgrading to Jessie) with the same omxplayer version, Now it doesn't work any more.

jmeiners commented 8 years ago

Do you recall what firmware version you were running (that worked)?

popcornmix commented 8 years ago

Try with --nodeinterlace - I suspect that will work.

It's the change to the QPU deinterlacer which causes this. It grabs a lock on the QPUs which prevents a second stream from also using QPU deinterlace. I'll see if we can either fall back to VPU deinterlace if QPU is not available, or whether we can share for SD resolutions. 1080i deinterlace is never going to support multiple streams (it's very expensive for GPU).

gkreidl commented 8 years ago

it does work and now I know why it always worked for me until a short while ago: for some reason I had --deinterlace in my live-tv options (a special settings field in omxplayerGUI).

jmeiners commented 8 years ago

You, my friend, are a genius :) Is that locking done in the open source interface lib or the gpu?

popcornmix commented 8 years ago

It's in the firmware. I'm looking into it.

popcornmix commented 8 years ago

Can you test: https://dl.dropboxusercontent.com/u/3669512/temp/firmware_multideint.zip

jmeiners commented 8 years ago

That firmware actually crashes my pi2. I am running a custom kernel though, so probably not the best test subject. Maybe someone of a recent kernel can try it?

popcornmix commented 8 years ago

How does it crash? Do you get rainbow splash screen? Do you get any kernel console log? Can you log in?

jmeiners commented 8 years ago

Very strange. The device will lock up (custom screen saver freezes, ssh freezes, etc). Sometimes it will recover for awhile and then lock up again. This is just after boot, not running omxplayer. Seems unlikely to have anything to do with your specific change. My systems are firmware/kernel locked down so I can't actually use a firmware update anyway. I'm perfectly happy with using --nodeinterlace for the windowed display case (thanks again). The quality difference isn't a big deal in the smaller window.

popcornmix commented 8 years ago

@gkreidl are you able to test the dropbox firmware?

gkreidl commented 8 years ago

Sorry, not at the moment.

Am 04.11.2015, 17:48 Uhr, schrieb popcornmix notifications@github.com:

@gkreidl are you able to test the dropbox firmware?


Reply to this email directly or view it on GitHub: https://github.com/popcornmix/omxplayer/issues/386#issuecomment-153788741

popcornmix commented 8 years ago

The fix is in latest rpi-update firmware. I can now play 4 SD videos with deinterlace.