Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatpak Package Won't Open After 0.8.1 Update Due To libSPIRV.so Missing. #289

Closed
GavinL2001 opened this issue Dec 7, 2023 · 22 comments
Closed

Comments

@GavinL2001
Copy link

GavinL2001 commented Dec 7, 2023

I just installed the new update from flathub, and when I try to run supersonic, it won't even open. Here is the error I get when I execute flatpak run io.github.dweymouth.supersonic in the terminal:

supersonic: error while loading shared libraries: libSPIRV.so: cannot open shared object file: No such file or directory

I tried installing spriv-tools through dnf, but it affected nothing.

Here's my system info:

OS: Nobara Linux 38 (KDE Plasma) x86_64
Kernel: 6.6.4-200.fsync.fc38.x86_64
CPU: AMD Ryzen 9 5900X (24) @ 4.95 GHz
GPU: AMD Radeon RX 5700 XT
Flatpak Version: 1.15.4-12.fc38

@dweymouth
Copy link
Owner

The version of MPV used in the flatpak was upgraded in 0.8.1. @anarcat any ideas what might be causing this? Should we roll back the mpv version bump? @GavinL2001 downgrading to 0.8.0 should work around this until we get it sorted

@GavinL2001
Copy link
Author

I've rolledback the update in the short term. Thanks for the help!

Also, for anyone else that has the same issue, here's the command to rollback to 0.8.0 in flatpak:
flatpak update --commit=09cf66371f4041871743b4971f96efda2d6996334876504a6629615aaecece6c io.github.dweymouth.supersonic

@anarcat
Copy link
Contributor

anarcat commented Dec 7, 2023

i made flathub/io.github.dweymouth.supersonic#37 to rollback the upgrade, looking into root cause.

anarcat added a commit to flathub/io.github.dweymouth.supersonic that referenced this issue Dec 7, 2023
An attempt at fixing
dweymouth/supersonic#289 without reverting
the upgrade.

The io.mpv flatpak doesn't have that issue because it builds
shaderc/vulkan and its deps.
@anarcat
Copy link
Contributor

anarcat commented Dec 7, 2023

so flathub/io.github.dweymouth.supersonic#37 (comment) has a test build with the mpv upgrade rolled back. I'm pretty sure that one should work already, you can test with:

flatpak install --user https://dl.flathub.org/build-repo/68843/io.github.dweymouth.supersonic.flatpakref

If I hear nothing I'll just merge this before EOD AOE as a safety measure. But what I would really like is if someone could test this other MR that tries to disable that library in the first place, keeping the mpv upgrade in place:

flathub/io.github.dweymouth.supersonic#38 (comment)

flatpak install --user https://dl.flathub.org/build-repo/68846/io.github.dweymouth.supersonic.flatpakref

I can't test locally right now, unfortunately, i will be able to do that next week.

@dweymouth dweymouth pinned this issue Dec 7, 2023
@Mister-Digital
Copy link
Contributor

The first build with mpv rolled back works for me (https://dl.flathub.org/build-repo/68843/io.github.dweymouth.supersonic.flatpakref).

The other build with the mpv upgrade unfortunately gives me the same error (https://dl.flathub.org/build-repo/68846/io.github.dweymouth.supersonic.flatpakref).

@anarcat
Copy link
Contributor

anarcat commented Dec 7, 2023

awesome, thanks, then i'll roll back and see where we go from there.

@anarcat
Copy link
Contributor

anarcat commented Dec 7, 2023

@dweymouth i must admit i'm a bit at a loss here. i don't quite get what SPIRV is or why it's being linked there... Is it linked to supersonic? Or is that error from mpv?

I'm trying to build a really minimal mpv in the flatpak to avoid pulling in too many dependencies, one different approach would be to just vendor the io.mpv.mpv.yml file content in our flatpak, but that seems ridiculous. There are also ways of having "base apps" (electron is one such thing), but there is, AFAIK, only electron as a base app...

so i guess the next step is probbaly to do a shared module approach... see flathub/io.github.dweymouth.supersonic#40 for that.

@dweymouth
Copy link
Owner

Supersonic does not use SPIRV as a direct dependency (I don't even know what it is) - I guess it's a new dependency in the latest MPV?

@GavinL2001
Copy link
Author

I don't know if this helps or not, but it seems like libplacebo utilizes the SPIRV library, so it could be an issue with how subsonic interacts with libplacebo, not mpv directly.

I wish I had more experience in coding to know how to help diagnose and fix the issue, but maybe this information could help.

@dweymouth
Copy link
Owner

It looks like libplacebo is a video thing... I really wish there were some player backend other than MPV to use, that didn't bring all the video baggage, but as far as I can tell there isn't a good drop-in replacement.

This is why I'm glad to have @anarcat to figure out all the complexities of how to package it because I have little knowledge of the different Linux packaging schemes and I develop mostly on Mac :D

@dweymouth
Copy link
Owner

Anyways, @GavinL2001 or anyone else facing this issue, you should be able to (force-)re-install at 0.8.1 now since anarcat rolled back the MPV version

@anarcat
Copy link
Contributor

anarcat commented Dec 7, 2023 via email

@anarcat
Copy link
Contributor

anarcat commented Dec 7, 2023 via email

@dweymouth
Copy link
Owner

I should create a separate discussion to evaluate MPV replacements, but it will not be on my priority list at all (unless I can get more core contributors to help implement more of the user-facing features in the backlog :)

MPV had all the following out of the box:

  • gapless playback
  • can stream directly from server URL, including handling range requests for seeking
  • plays pretty much any audio format
  • audio device selection, plus audio exclusive mode (where it takes exclusive use of an output device)
  • builtin equalizer (plus loads of other filters I'm not using)
  • ReplayGain support, reading the gain info from the file tags
  • reports "instantaneous" bitrate for VBR codecs (a nice-to-have for the status line on the Now Playing page)

@GavinL2001
Copy link
Author

On 2023-12-07 15:26:47, GavinL2001 wrote: I don't know if this helps or not, but it seems like libplacebo utilizes the SPIRV library, so it could be an issue with how subsonic interacts with libplacebo, not mpv directly.
That definitely helps! I thought it was something under mpv or the vulkan stuff, not placebo! I'll see how we compile placebo to see if I can tweak this properly. I'm a little puzzled by flathub/io.github.dweymouth.supersonic#40 ; it should have started a build by now but it just seems stuck there...

After looking closer at the mpv code, it does seem to incorporate SPIRV too, but unless some reference to the library got added to mpv, the only thing that should have changed is the addition of placebo.

Here are some other issues I found on libSPIRV.so errors that might be useful as a reference. My novice guess is that there's some hidden dependency that needs to be added. Otherwise, this is also way out of my depth, so best of luck @anarcat!

mpv-player/mpv#12625
mpv-player/mpv#12562
https://forum.zdoom.org/viewtopic.php?p=1103204

@anarcat
Copy link
Contributor

anarcat commented Dec 8, 2023

that's super useful info folks, thanks! i think i might have found the right plethora of deps to add to mpv in here flathub/io.github.dweymouth.supersonic#41

@dweymouth hopefully that will cut it... the problem with using mpv in a flatpak is that we need to "just build mpv" which is a moving target, and flatpak is pretty bad at reusing dependencies. every time there's an upgrade, if upstream changes something like this, i need to go grep around github.com/flathub to find how others have done this, there's basically zero code reuse.

(obviously, the worst pain for this was paid during the initial packaging: I was hoping that would mostly be done, but then mpv did change their deps a lot in that tiny-looking 0.37 release, so that is kind of a big deal of a change.)

but yeah: that's not your problem. :) it would also be absolutely not a problem if i was packaging this for debian: mpv is already packaged well there and that probelm (of reusing deps) have been solved for decades. but packaging the golang side of things (and fyne in particular) is much harder, so pick your poison i guess.

finally, i did look around for golang deps and i suspect you're right, there's no high-level "here's an already implemented music player" library out there... but there's a bunch of golang music players that could serve as inspiration, for example i found gotune, lunar and gomu doing a quick search. all of those seem to use beep, which seems promising, until you scratch the lid a little and find beep is a high-level wrapper around oto which, it turns out, only uses ALSA, a major regression (and a problem for the flatpak) on linux. urghl.

so yeah, maybe don't get distracted by this too much for now, mpv generally works fine, from what i can tell, even if it's kind of a pain in the arse to maintain in the flatpak...

so anyway, TL;DR: a build is happening now, and so far so good... there should be one ready for testing soon... it is taking much longer than before now (which is another downside of chasing that dep update)...

@anarcat
Copy link
Contributor

anarcat commented Dec 8, 2023

oh, and one more thing, sorry for the noise here, but @dweymouth if you do not want to get distracted by packaging issues, feel free to send those fine people that way by closing the issue here and sending folks to https://github.com/flathub/io.github.dweymouth.supersonic/issues/new, i think it's fine to track package-specific issues in their respective trackers. :)

@dweymouth
Copy link
Owner

Yeah in terms of MPV replacements we'd definitely need to search for C libraries. Some possibilities could be Phazor - the custom playback backend from Tauon Music box; the same thing from Deadbeef (unnamed); or libgroove which looked really cool but unfortunately hasn't really taken off.

@GavinL2001
Copy link
Author

Sorry if I should have opened an issue at the flatpak repo. I'll know for next time. Thanks for the help, and I'll go ahead and close this issue!

@anarcat
Copy link
Contributor

anarcat commented Dec 8, 2023

well, i didn't mean to close this issue without opening another one :) no harm done in any case...

i wonder if someone here can test the build provided here flathub/io.github.dweymouth.supersonic#41 (comment) - it's trying a much more elaborate mpv build that will hopefully resolve those issues...

@Mister-Digital
Copy link
Contributor

The build from https://dl.flathub.org/build-repo/69210/io.github.dweymouth.supersonic.flatpakref worked for me. I tested a couple things that I thought might be MPV related (playback, selecting audio devices, equalizer) to make sure nothing broke along the way and it all worked.

@anarcat
Copy link
Contributor

anarcat commented Dec 9, 2023

amazing! i'll merge that and that will do absolutely nothing for people if all goes well (ie. it will just keep working :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants