Skip to content

Conversation

@igorkorsukov
Copy link
Contributor

see #27552

This allows us to build assemblies on CI with multimedia support to test the functions that use it.
Need to switch on the option: QT_ADD_MULTIMEDIA

But it won't affect other developers. We can turn on multimedia support by default when we get ready-made functionality that can be provided to users.

@Jojo-Schmitz
Copy link
Contributor

The wiki would need to get updated accoringly, https://github.com/musescore/MuseScore/wiki/Install-Qt-and-Qt-Creator#select-qt-components

@cbjeukendrup

This comment was marked as resolved.

@igorkorsukov

This comment was marked as resolved.

@ModernMozart

This comment was marked as resolved.

@cfirwin3

This comment was marked as resolved.

@Jojo-Schmitz

This comment was marked as resolved.

@diedeno

This comment was marked as resolved.

@Jojo-Schmitz

This comment was marked as resolved.

@igorkorsukov igorkorsukov force-pushed the build/add_qt_multimedia branch from 2f80a5c to e2c89cd Compare April 8, 2025 07:59
@diedeno
Copy link
Contributor

diedeno commented Apr 8, 2025

Nevertheless, QtMultimedia is not in the appimage with this build. => Video Sync 2.qml:2 module "QtMultimedia" is not installed\n"

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Apr 8, 2025

It seems to be part of the Windows and Mac artifacts though. Indeed seems missing from the Linux artifact.

But regardless having Qt6Multimedia.dll in the bin folder, the Windows artifact doesn't open that plugin and complains in the logs:

file:///C:/Users/Jojo/Documents/MuseScore4Development/Plugins/Video Sync 2/Video Sync 2.qml:3 module "QtQuick.Dialogs" is not installed
file:///C:/Users/Jojo/Documents/MuseScore4Development/Plugins/Video Sync 2/Video Sync 2.qml:2 module "QtMultimedia" is not installed

@cbjeukendrup
Copy link
Member

Maybe the problem is that LinuxDeploy skips it because we're not using it. Solution might be to add a dummy QML file somewhere in the repo (I don't even think it needs to be registered anywhere) that imports MultiMedia, so that LinuxDeploy does think it's used. Not sure though. Maybe it's cleaner to just deploy it manually after running LinuxDeploy.

@diedeno
Copy link
Contributor

diedeno commented Apr 9, 2025

Adding this to ci/linux/tools/make_appimage.sh fixes the not installed issue with the Linux appimage:

# ADDITIONAL QT COMPONENTS
# linuxdeploy-plugin-qt may have missed some Qt files or folders that we need.
# List them here using paths relative to the Qt root directory. Report new
# additions at https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues
additional_qt_components=(
  plugins/printsupport/libcupsprintersupport.so

  # At an unknown point in time, the libqgtk3 plugin stopped being deployed
  plugins/platformthemes/libqgtk3.so

  # Wayland support (run with QT_QPA_PLATFORM=wayland to use)
  plugins/wayland-decoration-client
  plugins/wayland-graphics-integration-client
  plugins/wayland-shell-integration

  # QtMultimedia components
  lib/libQt6Multimedia.so.6
  lib/libQt6MultimediaQuick.so.6
  lib/libQt6MultimediaWidgets.so.6
  qml/QtMultimedia
)

@igorkorsukov
Copy link
Contributor Author

Sorry, I was very busy yesterday, I didn't have time to fix this problem. I plan to do this today, I was considering both options, I wanted to conduct experiments, I like the second option, only there the files are named differently and we need to make symlinks

@igorkorsukov igorkorsukov force-pushed the build/add_qt_multimedia branch from e2c89cd to 3162506 Compare April 9, 2025 11:56
@Jojo-Schmitz
Copy link
Contributor

I'm still getting

file:///C:/Users/Jojo/Documents/MuseScore4Development/Plugins/Video Sync 2/Video Sync 2.qml:2 module "QtMultimedia" is not installed

@diedeno
Copy link
Contributor

diedeno commented Apr 9, 2025

Over here (appimage) =>
Video Sync 2.qml:2 Cannot load library /tmp/.mount_MuseSczJkmAi/qml/QtMultimedia/libquickmultimediaplugin.so: (libQt6MultimediaQuick.so.6: cannot open shared object file: No such file or directory)\n"
Obviously because lib/libQt6MultimediaQuick.so.6 is not present in the appimage.

@igorkorsukov igorkorsukov force-pushed the build/add_qt_multimedia branch 2 times, most recently from 3fd3c9a to 805696b Compare April 9, 2025 14:01
@igorkorsukov
Copy link
Contributor Author

igorkorsukov commented Apr 9, 2025

I'll let you know when I'm done... :)

It pack and works locally for me.
but I found on CI we need install gstreamer

@diedeno
Copy link
Contributor

diedeno commented Apr 9, 2025

Again:

Cannot load library /tmp/.mount_MuseScJ8J94X/qml/QtMultimedia/libquickmultimediaplugin.so: (libQt6MultimediaQuick.so.6: cannot open shared object file: No such file or directory)\n"

This library is not in the appimage.
My build works just fine without installing gstreamer.
(But gstreamer is of course installed on the system with the package manager. I suspect it is installed as part of a basic installation on Ubuntu)

@cfirwin3
Copy link

cfirwin3 commented Apr 9, 2025

Again:

Cannot load library /tmp/.mount_MuseScJ8J94X/qml/QtMultimedia/libquickmultimediaplugin.so: (libQt6MultimediaQuick.so.6: cannot open shared object file: No such file or directory)\n"

This library is not in the appimage. My build works just fine without installing gstreamer. (But gstreamer is of course installed on the system with the package manager. I suspect it is installed as part of a basic installation on Ubuntu)

gstreamer has been a standard component of Ubuntu variants for some time. But, I suppose if it can be contained to the build, that wouldn't be a bad thing..?

@diedeno
Copy link
Contributor

diedeno commented Apr 9, 2025

But if gstreamer is to be included in the appimage, then all dependencies must be included as well. Seems like a bad idea to me. Another 3rd party piece of software to maintain and to keep up to date.;

@igorkorsukov
Copy link
Contributor Author

Locally for me, linuxdeploy copies QtMultimedia.
But on CI an error occurs: ERROR: Could not find dependency: libgstpbutils-1.0.so.0
and QtMultimedia not copied

@igorkorsukov igorkorsukov force-pushed the build/add_qt_multimedia branch from 805696b to 08bad72 Compare April 9, 2025 14:53
@igorkorsukov
Copy link
Contributor Author

But if gstreamer is to be included in the appimage, then all dependencies must be included as well. Seems like a bad idea to me. Another 3rd party piece of software to maintain and to keep up to date.;

But that's exactly how AppImage works, it includes all dependencies and is system independent. It is designed for all distributions, not just Ubuntu.

@diedeno
Copy link
Contributor

diedeno commented Apr 9, 2025

But if gstreamer is to be included in the appimage, then all dependencies must be included as well. Seems like a bad idea to me. Another 3rd party piece of software to maintain and to keep up to date.;

But that's exactly how AppImage works, it includes all dependencies and is system independent. It is designed for all distributions, not just Ubuntu.

OK. sorry, my bad.

@igorkorsukov
Copy link
Contributor Author

It should work now

@diedeno
Copy link
Contributor

diedeno commented Apr 9, 2025

I confirm. Linux Appimage is working fine. Thanks

@igorkorsukov
Copy link
Contributor Author

igorkorsukov commented Apr 10, 2025

It's a pity that the problems are not solved. I need to go on a business trip for a week and a half. So I can come back to this in a week and a half, or someone else can continue to solve the problems. As we can see, the task is not just to add Multimedia and compile, but to configure the deployment so that it works on different platforms and distributions.
We have added a multimedia library to the Qt itself.

@igorkorsukov
Copy link
Contributor Author

If we do not include libgstreamer in the appimage, then the one on the system is used. this works on 22.04 and 24.04 and probably any other linux distro.

In this case, LinuxDeploy will not be able to add multimedia libraries, we will need to do it yourself, and we will probably need to take care of changing the rpath of these libraries.
And as I understand it, gstreamer is not installed by default in other distributions that are not based on the latest Ubuntu

@Jojo-Schmitz
Copy link
Contributor

Ah, about Windows, now I realise: we don't yet use windeployqt, so we need to copy some of the dlls manually in app/CMakeLists.txt, around line 381.

And I was already about starting to wine about Windows being neglected ;-)

@igorkorsukov igorkorsukov force-pushed the build/add_qt_multimedia branch from 08bad72 to bf26618 Compare April 23, 2025 12:25
@cfirwin3
Copy link

cfirwin3 commented Apr 23, 2025

Build: 4.6.0.251131226 Linux appimage crashed upon opening the plugin similarly to the last build. But I think the log might be showing a different reason. See the attached .txt log file. Xubuntu 24.04
Crash.txt

EDIT: It at least, in part, still seems related to gstreamer versions...? Possibly?

@diedeno
Copy link
Contributor

diedeno commented Apr 23, 2025

Crash also with ubuntu 22.04

6:39:28.835 | DEBUG | main_thread     | addPluginToDockMU4 | Attempting to add Playback Control plugin to dock
16:39:28.835 | DEBUG | main_thread     | addPluginToDockMU4 | Creating new dock panel

(mscore4portabledev:19349): GStreamer-CRITICAL **: 16:39:28.924: gst_element_link_many: assertion 'GST_IS_ELEMENT (element_2)' failed
[19362:19362:20250423,163928.939005:ERROR elf_dynamic_array_reader.h:61] tag not found
[19362:19362:20250423,163928.940336:ERROR elf_dynamic_array_reader.h:61] tag not found
[19362:19362:20250423,163928.942909:ERROR elf_dynamic_array_reader.h:61] tag not found

@igorkorsukov igorkorsukov force-pushed the build/add_qt_multimedia branch 2 times, most recently from 0fe9c5b to 7ad91b3 Compare April 24, 2025 10:14
@cfirwin3
Copy link

cfirwin3 commented May 2, 2025

Any update on the status of this, particularly related to the last failed Linux build?

@igorkorsukov igorkorsukov force-pushed the build/add_qt_multimedia branch from 7ad91b3 to ca929db Compare May 5, 2025 09:08
@igorkorsukov
Copy link
Contributor Author

igorkorsukov commented May 5, 2025

We are currently in the active process of switching to Qt 6.9. It's a bit different there... That's why we're waiting for the transition to be completed.

I've now finalized the build for Linux x86-64, it would be good to check the work. It hasn't been done for other platforms yet, we're waiting for Qt 6.9

@igorkorsukov igorkorsukov marked this pull request as draft May 5, 2025 10:02
@diedeno
Copy link
Contributor

diedeno commented May 5, 2025

I am using Ubuntu 24.04 now ..

Some errors in the logs with this build:

/usr/lib/x86_64-linux-gnu/gvfs/libgvfscommon.so: undefined symbol: g_task_set_static_name
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so

Eventually, after quit some time, ModernMozart's plugin shows after all - and seems to work.

Also, the appimage has now 238MB. My multimedia build, without the libgstreamer stuff included, only has 138MB ( and does not produce any errors; not with ubuntu 22.04 nor with 24.04).
I wonder if we should we include for 100MB multimedia libraries in the appimage. (just my idea, i don't want to argue about it)

@igorkorsukov
Copy link
Contributor Author

I wonder if we should we include for 100MB multimedia libraries in the appimage. (just my idea, i don't want to argue about it)

I would be happy not to add them, but there are two problems:

  • Linux deploy won't be able to add multimedia because it won't be able to add its dependencies. We'll need to add multimedia manually, but there may be problems with paths for working in AppImage, i.e. it's easy to add locally so that it works on the machine where it was compiled, but only relative paths should be used in AppImage.

  • What should users do who don't use Ubuntu and don't have gstreamer installed? It's even hard to ask them to install it, and if the user is new to Linux... then even if we ask them to install it, they might not be able to do it.

We can't do something for a limited circle of enthusiasts ((

@diedeno
Copy link
Contributor

diedeno commented May 5, 2025

As i understand it, most modern mainstream distro's (Debian, Ubuntu, but also Fedora) have gstreamer installed by default, and others have at least a package to install it easily. Shouldn't Linux users be able to install a package from the own distro repository? It is not more difficult than installing a .msi on Windows.
I guess that most users will not need a multimedia plugin, in which case gstreamer is not needed or loaded and the ignorant user does not need to install anything.
Why shouldn't qt multimedia be loaded manually, while this is already done for cups and wayland?

PS. mybuild: https://github.com/diedeno/MuseScore/actions/runs/14339912925

@cfirwin3
Copy link

cfirwin3 commented May 5, 2025

The plugin loads (Ubuntu 24.04) with a delayed start, as described. But things seem to be generally working. The plugin is doing some strange stuff that it didn't do with other builds outside of this PR, but those issues are probably the plugin's problem at this point.

On the gstreamer issue:
My concern is that adding a robust capability that significantly expands the footprint of the application, but is not employed by most users... seems like an easy justification for the top decision makers to just reject the capability. So there is a potential for a 'catch 22':

  • Portable apps require onboard dependencies to be provided. Building without = rejected
  • Large expansions in underused capability defies the anti-bloat philosophy. Building with = rejected

Those are the fears anyway. The proverbial cooks at the very top need to see vital value in everything that is thrown in the soup. Ultimately, the head chefs approve what tastes good to them, for their own reasons. So I'm not sure what side I'm on re: gstreamer onboard or as an external dependency for the capability in question. All I know is that these capabilities are pretty normal (if not widely used) for music/notation software these days and MS should support it. So whatever strategy gets it through the pipeline to the master and keeps MS truly competitive for all kinds of professional work is fine by me!

@cbjeukendrup
Copy link
Member

Increasing the AppImage size with 100MB just because of a few dependencies that should actually be available on most systems, seems clearly no option, no matter how many people will benefit from this lib.

@igorkorsukov Let's investigate @diedeno's solution; to me, that seems the way to go.

@cfirwin3
Copy link

cfirwin3 commented May 5, 2025

Increasing the AppImage size with 100MB just because of a few dependencies that should actually be available on most systems, seems clearly no option, no matter how many people will benefit from this lib.

@igorkorsukov Let's investigate @diedeno's solution; to me, that seems the way to go.

I think this route is less likely to be rejected. I agree.

@igorkorsukov
Copy link
Contributor Author

Let's try without a gstreamer and see what happens

@igorkorsukov
Copy link
Contributor Author

igorkorsukov commented May 5, 2025

There will be a problem...
This will work if there is not a single built-in file with multimedia in MuseScore
If we add at least one file with multimedia, even just for testing, then Linuxdeploy will try to deploy multimedia.
If a gstreamer is installed in the system, then it will also deploy it as a dependency... (but without gstreamer plugins)
If it is not installed, then Linuxdeploy will report an error that it cannot deploy multimedia. It seems that there should be nothing terrible here, just an error and the proposed solution with manual addition will work.

But if a pre-installed gstreamer is added to CI with a new update, or if someone builds AppImage locally, where there is a gstreamer, then a problem will arise.

@igorkorsukov igorkorsukov force-pushed the build/add_qt_multimedia branch 2 times, most recently from c4a0bc2 to 4546f27 Compare May 6, 2025 08:42
@igorkorsukov igorkorsukov force-pushed the build/add_qt_multimedia branch from 4546f27 to 849d0ed Compare May 6, 2025 11:10
@cfirwin3
Copy link

cfirwin3 commented May 6, 2025

Build 251261110 Linux works. Video sync plugin loads quickly and operates as expected.
Xubuntu 24.04 / pipewire / gstreamer 1.24.2 (part of base installation)

@cbjeukendrup
Copy link
Member

@igorkorsukov It might be good to revisit this PR when you have time again

@igorkorsukov igorkorsukov deleted the build/add_qt_multimedia branch November 11, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants