Skip to content

kms/RPi4: 4096x2160-30 output broken since clock request changes #4339

Closed

Description

@HiassofT

Describe the bug
Trying to use 4096x2160-30 on RPi4 with kms and latest rpi-update kernel results in no signal output and "flip_done timed out" messages in dmesg unless force_turbo=1 is used in config.txt

This mode worked fine until rpi-update version Hexxeh/rpi-firmware@5fa7013

To reproduce
run modetest -s 32:4096x2160-30 on a RPi4 with plain config.txt and only vc4.-kms-v3d overlay added

Expected behaviour
Video output works, eg modetest shows test pattern.

Actual behaviour
No signal on TV and modetest hangs.

System
RPi4 4GB running RPiOS with all updates and latest rpi-update kernel Hexxeh/rpi-firmware@c1737c7

Also LibreELEC master with kernel 5.10.33 (and newer) is affected - see LibreELEC/LibreELEC.tv#5348 (comment)

Additional context
Checking through kernel commits showed that 8b66448 is the first bad version, 9e081a7 is fine.

Comparing clk_summary taken while modetest was running/hanging showed that in the non-working state the core clock was running at 200 MHz while in the working state it was at 500MHz

root@raspberrypi:~# diff -u clk-err clk-ok 
--- clk-err	2021-05-12 15:06:09.735748650 +0100
+++ clk-ok	2021-05-12 15:08:28.068190366 +0100
@@ -5,7 +5,7 @@
  fw-clk-m2mc                          1        1        0   299970000          0     0  50000
  fw-clk-hevc                          0        0        0   250000000          0     0  50000
  fw-clk-v3d                           0        0        0   250000000          0     0  50000
- fw-clk-core                          1        1        0   200000000          0     0  50000
+ fw-clk-core                          1        1        0   500000000          0     0  50000
  fw-clk-arm                           0        0        0   600000000          0     0  50000
  108MHz-clock                         0        0        0   108000000          0     0  50000
     hdmi1-108MHz                      0        0        0   108000000          0     0  50000

ping @popcornmix

Activity

  1. popcornmix commented on May 12, 2021

    @popcornmix
    Collaborator

    So, the firmware has two boost requests for core frequency that relate to hdmi.
    It requests max core frequency at start of the mode set, that is removed when it completes.
    And it requests a frequency roughly proportional to the pixel clock (but it is somewhat complicated) that persists until the next mode change.

    I believe the vc4 driver only does the former. And before the "clock request changes" commit, a bug meant the former boost was never removed.

    The correct solution is to add the latter request.
    FYI @mripard (I'll have to explain the firmware side logic when I understand it myself).

  2. user13571113 commented on May 12, 2021

    @user13571113

    The problem description and the fact that it emerged after the upgrade to kernel 5.10.31 leads me to suspect that this problem is the same encountered by me: #4317

    In fact, I can confirm that adding force_turbo=1 to /boot/config.txt results in a working display for me, whereas the monitor reports "No HDMI input signal" without the option set.

  3. AlexanderStein commented on May 25, 2021

    @AlexanderStein
    Contributor

    I hit this problem too. Bisected to 8b66448 as well.

    My use case is playing a 1080p Youtube video in kodi. After the offending commit the video desynchronizes with the audio and gets reset after a while, while the desynchro starts again. Local playback of mp4 files is not affected though.

    As mentioned before force_turbo=1 to /boot/config.txt also works here.

  4. mripard commented on May 26, 2021

    @mripard
    Contributor

    #4365 should fix this issue. Can you test and report if it works?

    Thanks!

  5. AlexanderStein commented on May 27, 2021

    @AlexanderStein
    Contributor

    I applied both the patches to commit c2f585a, but unfortunately they don't fix my problem on youtube playback. The fw-clk-core is set to 500MHz, but using grep fw-clk-core /sys/kernel/debug/clk/clk_summary. I noticed that it falls back to 200MHz once in a while, about 2-3 every 10s using watch. Not very accurate but the clock switch can be detected this way. Dunno what the effect actually is.

    There is also another difference in the clocks which might explain my problem with the video decoding:

    --- clk_good    2021-05-27 18:41:46.964726722 +0200
    +++ clk_fixed   2021-05-27 18:45:57.006687269 +0200
    @@ -35,8 +35,8 @@
            plla_ccp2                      0        0        0    11718750          0     0  50000
            plla_dsi0                      0        0        0    11718750          0     0  50000
            plla_core                      2        2        0   499999998          0     0  50000
    -          h264                        0        0        0   444444442          0     0  50000
    -          isp                         0        0        0   444444442          0     0  50000
    +          h264                        0        0        0   415584413          0     0  50000
    +          isp                         0        0        0   415584413          0     0  50000
               vpu                         3        3        0   500000000          0     0  50000
                  aux_spi2                 0        0        0   500000000          0     0  50000
                  aux_spi1                 0        0        0   500000000          0     0  50000
  6. mripard commented on Jun 4, 2021

    @mripard
    Contributor

    I updated the PR with a few fixes, can you test this new version?

  7. AlexanderStein commented on Jun 5, 2021

    @AlexanderStein
    Contributor

    Thanks for the update. Unfortunately none of my issues has changed. The fw-clk-core still alternates bewteen 20 and 500 MHz during playback. My youtube playback desyncs on video and audio. And the h264/isp clocks still have a lower frequency than before.

  8. mripard commented on Jun 7, 2021

    @mripard
    Contributor

    It looks like a separate issue than the one that started this bug report. Can you open a new one? Thanks.

  9. user13571113 commented on Jun 12, 2021

    @user13571113

    After upgrading to kernel 5.10.42 (pertaining to commit da6937f), my issue still persists: Without force_turbo=1 in /boot/config.txt, my monitor reports "No HDMI input signal" when starting X; it works with force_turbo=1.

  10. mripard commented on Jun 16, 2021

    @mripard
    Contributor

    Did you test with #4365 ?

  11. popcornmix commented on Jun 16, 2021

    @popcornmix
    Collaborator

    #4365 will be present in today's rpi-update firmwware.

  12. user13571113 commented on Jun 20, 2021

    @user13571113

    The issue is resolved (X launches without force_turbo=1) with kernel 5.10.44 (commit 2b13c54) and EEPROM

    BOOTLOADER: up to date
       CURRENT: Thu Apr 29 16:11:25 UTC 2021 (1619712685)
        LATEST: Thu Apr 29 16:11:25 UTC 2021 (1619712685)
       RELEASE: critical (/lib/firmware/raspberrypi/bootloader/critical)
    
      VL805_FW: Using bootloader EEPROM
         VL805: up to date
       CURRENT: 000138a1
        LATEST: 000138a1
    

    Thank you very much for these updates.

  13. popcornmix commented on Jun 23, 2021

    @popcornmix
    Collaborator

    @HiassofT is this okay to close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions