Audio and Video Playback Stuck in QT6 Docker
-
Hi,
I tried to dockerize a Qt6 application using the torizon/qt6-wayland-imx8:next image from Docker Hub as the base. For my specific Qt6 application, I needed to install the following packages to the above-mentioned Qt6 image:
RUN apt-get install imx-gpu-viv-wayland-dev
RUN apt-get update && apt-get -y install qml6-module-qtquick qml6-module-qtquick-controls qml6-module-qtqml-workerscript qml6-module-qtquick-templates qml6-module-qtquick-layouts qml6-module-qtquick-window qml6-module-qtmultimedia libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudioAfter installing these packages, I encountered the following issues while running the application:
i)The Qt6 application is supposed to continuously playback audio, but after dockerizing, the audio only plays once and then stops.
ii)When running the application, the video plays with frequent stuttering and displays the error: qt.multimedia.player: Warning: "A lot of buffers are being dropped."I then switched to Qt5 and replaced the GStreamer pipeline with:
gst-launch-1.0 playbin uri=file:///<file location>When I switched to Qt5 with the new pipeline, the audio played more consistently than with Qt6. However, after some time, the audio still got stuck, and no sound was produced, although the sound card remained in a running state.
I used the following flags in my docker run command:
--privileged -v /dev/snd:/dev/snd --network host -e QT_QPA_PLATFORM=wayland -v /run/user/0:/tmp/1000-runtime-dirDespite these attempts, the audio playback issues persist with both Qt5 and Qt6 when running inside the Docker container. Further investigation and troubleshooting are required to resolve these audio and video playback problems.
Any advice or suggestions from the community would be greatly appreciated.