RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Bug (solved): OMXPlayer on Stretch-based builds stutters on composite

    Scheduled Pinned Locked Moved Help and Support
    stuttervideosomxplayeremulationstatioscreensaver
    56 Posts 7 Posters 15.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      psyke83 Global Moderator
      last edited by psyke83

      It seems highly likely that the new 4.14 kernel is the explanation. Jools' testing builds include the new kernel (which is upgraded via a standard apt-get upgrade), but I'm guessing that the stretch or stretch lite image/installation is still using the 4.9 kernel.

      I suggest checking the kernel revision on both builds:
      uname -a

      Edit: @mitu beat me to it ;)

      1 Reply Last reply Reply Quote 0
      • matchamanM
        matchaman
        last edited by

        On the Raspbian setup I get:

        Linux raspberrypi 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv71 GNU/Linux

        On RetroPie I get:

        Linux retropie 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv71 GNU/Linux

        As for the dependences with omxplayer.bin I'll have to compare by taking photos of the screen, which I'll do shortly.

        Meanwhile, could anyone please check with composite? I can't be the only user that uses composite for 240p on a CRT...

        1 Reply Last reply Reply Quote 0
        • P
          psyke83 Global Moderator
          last edited by psyke83

          Unfortunately I don't have a cable to check.

          See these lines: https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/supplementary/emulationstation.sh#L282-L289

          Can you try to comment those lines (that are added via the iniSet function) from your /boot/config.txt and reboot?

          1 Reply Last reply Reply Quote 0
          • matchamanM
            matchaman
            last edited by matchaman

            Big discovery!

            I exited EmulationStation with F4 the moment I booted into it (without entering a system). When I tried omxplayer, the video plays smoothly! Then I entered ES again, browsed for a moment, went back and stuttering came back as usual.

            Here's a video I just recorded:

            Something runs along with omxplayer and makes it run slow. What's completely crazy about this is that when I use HDMI, everything runs perfectly:

            @psyke83 just edited these out, I'm getting the good old white screens of death :P

            pjftP 1 Reply Last reply Reply Quote 0
            • pjftP
              pjft @matchaman
              last edited by

              @matchaman I wonder whether the GPU split changes things for you, and/or whether installing ES on the fresh image manages to replicate the issue.

              1 Reply Last reply Reply Quote 0
              • P
                psyke83 Global Moderator
                last edited by

                Please check behaviour without the lines in config.txt, as I asked, but also, I notice that the issue starts occurring after video playback starts inside ES itself when you returned to ES. If you disable omx support in the ES menu, does it clear the bug when launching omxplayer via the shell the second time?

                1 Reply Last reply Reply Quote 0
                • matchamanM
                  matchaman
                  last edited by matchaman

                  @pjft this is a brand new image I installed yesterday again, the only thing changed is that I uploaded my media overnight and my theme (which is basically carbon video).

                  @psyke83 I disabled the gpu_mem lines, altogether and one by one. Nothing changed except for 1024=256 causing a "white screen of death" (occurred on both units).

                  I disabled omxplayer for ES (both themes videos and screensaver), rebooted, looked around systems (videos run fine but browsing feels a bit slow which I believe is normal without omxplayer), exited ES, video runs great again on omxplayer.

                  Something makes omxplayer stutter once it runs inside ES and only when the output is via composite (any sdtv setting). Via HDMI on any resolution, this issue does not happen at all. But what could it be? It definitely didn't happen on 4.3 stable with all updates last month :/

                  1 Reply Last reply Reply Quote 0
                  • matchamanM
                    matchaman
                    last edited by

                    Update:

                    I had the audio almost off and didn't notice something very serious once omxplayer runs inside ES: not only omxplayer remains stuttery outside ES but the whole system slows down like it's heavily underclocked! This is getting weirder...

                    Sorry for the length of the video but I explain it here in practice:

                    pjftP 1 Reply Last reply Reply Quote 0
                    • pjftP
                      pjft @matchaman
                      last edited by

                      @matchaman I can't watch any of the videos for the moment, but that's good then. Can you SSH into it and run"top", and see what exactly takes up the CPU when you play a video?

                      1 Reply Last reply Reply Quote 0
                      • matchamanM
                        matchaman
                        last edited by

                        Here's a capture of top before omxplayers runs inside ES:
                        alt text

                        And another afterwards, with what appears to be system-wide slowdown:
                        alt text

                        mituM 1 Reply Last reply Reply Quote 0
                        • mituM
                          mitu Global Moderator @matchaman
                          last edited by mitu

                          @matchaman Why is there a python process keeping the CPU busy ? Do you have a BGM script running ? Are there any errors reported by dmesg after the slowdown ?

                          pjftP 1 Reply Last reply Reply Quote 1
                          • pjftP
                            pjft @mitu
                            last edited by

                            @mitu @matchaman well spotted, was going to ask the same (didn't know about the bgm music script using python though).

                            The system does not appear to be in significant load though.

                            Can you install htop and run htop instead of top to assert the process trees?

                            1 Reply Last reply Reply Quote 0
                            • matchamanM
                              matchaman
                              last edited by matchaman

                              @mitu It's the background music player. I disabled this previously, it was the first thing I suspected that could interfere with omxplayer. Disabling it didn't change anything so I enabled it again. No errors on dmesg either.

                              @pjft I installed PuTTY to make matters easier. Here's what I got with htop

                              Before omxplayer in ES:
                              alt text

                              After:
                              alt text

                              1 Reply Last reply Reply Quote 0
                              • matchamanM
                                matchaman
                                last edited by matchaman

                                I came back from a friend who bought a 3 B+ model. He uses a brand new 4.3.17 test image, nothing added other than ROMs for systems. I asked him to scrape with videos for a system, switched to omxplayer in ES, used a jack to RCA cable and here we go... same problem!

                                I consider this a global issue :( someone who can use composite, PLEASE give me your input...

                                1 Reply Last reply Reply Quote 0
                                • matchamanM
                                  matchaman
                                  last edited by matchaman

                                  Excuse me for "spam-bumping" this but it's a real issue that needs to be addressed.

                                  I installed a clean image of 4.3 Jessie (on my 3 B model obviously) without any updates and the problem does not exist, as I expected.

                                  I am now updating components one by one to see what causes this and if it's exclusive to Stretch-based RP (in case everything is updated and the issue does not appear).

                                  Edit 1: I'm starting with the RetroPie Setup script. The bug does not appear yet. (WOW it shows 4.4 :D) let's keep updating...

                                  Edit 2: RetroArch. Obviously no change, as expected.

                                  Edit 3: runcommand... no change. RP conf menu... no change.

                                  Edit 4: Updating EmulationStation... holding my breath... NO CHANGE! :O

                                  Edit 5: Doing a general update, including kernel and other OS packages... nope. Nothing. Everything works perfectly. What a headache :/

                                  1 Reply Last reply Reply Quote 0
                                  • matchamanM
                                    matchaman
                                    last edited by

                                    So my "final" conclusion is that, although Raspbian Stretch itself has no issues with omxplayer (and neither does Stretch based RetroPie in console), when omxplayer runs within EmulationStation on a Stretch-based RetroPie, the system goes through a massive slowdown that doesn't go away until rebooting.

                                    The version of every single software is identical except for Jessie and Stretch bases.

                                    It won't be long until people like me who use their system with CRTs for 240p via composite will experience this. The only way to avoid this is to keep using the internal player instead of omxplayer but the results are less good looking, especially for video screensavers that look much better with omxplayer...

                                    mituM 1 Reply Last reply Reply Quote 0
                                    • mituM
                                      mitu Global Moderator @matchaman
                                      last edited by

                                      @matchaman said in Bug: OMXPlayer on Stretch-based builds stutters on composite:

                                      So my "final" conclusion is that, although Raspbian Stretch itself has no issues with omxplayer (and neither does Stretch based RetroPie in console), when omxplayer runs within EmulationStation on a Stretch-based RetroPie, the system goes through a massive slowdown that doesn't go away until rebooting.
                                      The version of every single software is identical except for Jessie and Stretch bases.

                                      I think your conclusion is contradicted by the next statement

                                      The version of every single software is identical except for Jessie and Stretch bases.

                                      I think that Stretch has a problem with the omxplayer/composite combination (though most likely it's a video driver bug in 4.14), but that problem exhibits only when running with certain parameters. If you can do 1 more test:

                                      1. Repeat the stuttering problem in ES+Omplayer and write down the parameters of the omxplayer command.
                                      2. Reboot the system, exit ES and run omxplayer with the same parameters as if it was run from ES. Does the slowdown/stuttering occurs ?
                                      matchamanM 1 Reply Last reply Reply Quote 1
                                      • pjftP
                                        pjft
                                        last edited by

                                        Nothing seems to suggest any kind of CPU-heavy workload, so - as disheartening as it may seem - there's little to no suggestion I could have here that could help.

                                        There were mentions of the .14 firmware having some troubles, so perhaps trying to install a previous Stretch firmware (.9) might be a good attempt there. Unsure what the exact package do downgrade via apt-get will be, but might be worth a shot.

                                        Another suggestion could be to explore a different memory split - try manually increasing it and see if it changes anything. I don't see why it would, but I've been wrong plenty of other times.

                                        Running sudo vcdbg reloc stats when running omxplayer and ES might suggest how much GPU memory you have available at the time, and if there's anything weird there.

                                        Another alternative may be to file an issue here and see if they have any ideas or hypotheses on how to troubleshoot or address this. Realistically, though, if ES remained unchanged, omxplayer remains unchanged, and the firmware update causes this, we're kind of hands tied given that we don't control the omxplayer development nor the firmware. The only thing we know is that Jessie doesn't work on the Pi3B+, so it needs to move to Stretch - and the upgrade won't be stalled if there's no reasonable alternative at the OS level at this moment.

                                        We will keep exploring this, but the reality is that unless someone that actually has a composite cable and a bit more knowledge of the underlying OS and drivers has the chance to look into this, we may struggle to find something unless omxplayer or the firmware fixes it.

                                        Out of curiosity, where are the videos you're running? SD card? USB drive? NAS?

                                        On a side note, thank you @mitu for the fantastic job you've been doing these last few weeks/months in helping everyone out in the forums. I've been meaning to say it to you earlier - great job!

                                        1 Reply Last reply Reply Quote 1
                                        • G
                                          G.I.Josh
                                          last edited by

                                          Hello,

                                          I had to register for this problem. I got my 3+ model and replaced it in my mega drive empty shell. I previously used a 3 model but i always upgrade. I saw that 4.4 was released in final version so i finally use it today (i did not want to use beta version). I am connecting to a tube television with RCA jack and i experience a strange problem. It is abrand new image only with upload of roms+videos.

                                          On carbon video and other theme when a video plays the whole system goes to slow motion!!! Not only video but also any emulator any rom...even music!! But when i use again HDMI 720p that i do tests the bug is not there! Crazy thing...... its like low resolutions get it tired!

                                          I had to change to non-OMX player but then the theme looks deforme and videos play with lag before playback. OMX player works fine before upgrade on model 3 non-plus. Also on same microsd on 3 i get the same problem when i swap. Unfortunatly its not backward compatible.
                                          Note i dont know linux or programming i just use Pi to play and never experience major problems like this. It is the only way (tube television) i play for retro feeling inside a empty mega drive.

                                          Yours,
                                          Joshua

                                          mituM 1 Reply Last reply Reply Quote 0
                                          • mituM
                                            mitu Global Moderator @G.I.Josh
                                            last edited by mitu

                                            @g-i-josh Something similar to this ? Seems specific to the new Stretch based build - not entirely sure it's RetroPie or Raspbian specific ?

                                            1 Reply Last reply Reply Quote 2
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.