Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111152

Android QML Video/MediaPlayer component freezes UI on component removal

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P1: Critical
    • 6.4.3, 6.5.0, 6.6.0
    • 6.4.1
    • Multimedia
    • None
    • AOSP Android 11, Poco X3, arm64
    • Android
    • 2023wk06FOQtforAndroid

    Description

      (Qt 6.4.1, Android 11 ARM64, QtMultimedia)

      When removing a MediaPlayer item (or MediaPlayer based item like Video) at QML runtime, the UI freezes and does not react anymore on Android.

      Please check the attached video. screenrecord-2023-02-14_13.23.23.webm

      The Android debug feature to show device taps is enabled, so my display taps are marked with a circle.
      As it's visible, the whole UI not reacts anymore to clicks as soon setting the Loader to inactive, thus making MediaPlayer item disappear.
      The same also happens when there are QML Pages on a Stack and popping the page where a video is played. So the UI stays frozen on the page with the Video.

      Another interesting point is, the rotating Rectangle keep rotating while staying in the app. However when switching away to another app and going back to the example, also the Rectangle is frozen. As well lots of spam in the debug log form seemingly an endless loop.

      Deadlock in some QtMultimedia code / Android Java Multimedia code?

      Example code, also attached: Qt6AndroidMediaPlayerFreeze.zip

      import QtQuick
      import QtQuick.Controls
      import QtMultimedia
      
      Window {
        width: 640
        height: 480
        visible: true
        readonly property string bigbuckbunnyurl: "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4"
      
        Page {
          anchors.fill: parent
          anchors.margins: 10
          Column {
            Text {
              text: "Qt6AndroidMediaPlayerFreezeExample"
            }
            Rectangle {
              id: rotatingBox
              width: 50
              height: 50
              color: "red"
              RotationAnimator {
                target: rotatingBox
                to: 360
                duration: 1000
                loops: 999999
                running: true
              }
            }
            Button {
              text: "Loader MediaPlayer+"
              onClicked: {
                mediaPlayerLoader.active = true
                mediaPlayerLoader.item.stop()
                mediaPlayerLoader.item.play()
              }
            }
            Button {
              text: "Loader MediaPlayer-"
              onClicked: mediaPlayerLoader.active = false
            }
      
            Loader {
              id: mediaPlayerLoader
              active: false
      
              sourceComponent: Video {
                width: 200
                height: 200
                source: bigbuckbunnyurl
              }
            }
          }
        }
      }
      
      

      Attachments

        1. Qt6AndroidMediaPlayerFreeze.zip
          2 kB
          Gregor Santner
        2. screenrecord-2023-02-14_13.23.23.webm
          3.18 MB
          Gregor Santner

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              bartlomiejmoskal Bartlomiej Moskal
              de-live-gdev Gregor Santner
              Votes:
              5 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes