Closed alfureu closed 1 year ago
I'm guessing it's not running on Fedora because of libmpv being installed in a different location or different .so file name. Building from source would probably get it running.
I don't know much at all about Linux packaging (other than installing things via apt and snap), so I'm hoping someone from the community would be able to step up and volunteer for this! Though I'll look into it eventually if not
I posted a flatpak request to their forum, see https://discourse.flathub.org/t/supersonic-lightweight-cross-platform-desktop-client-for-subsonic-music-servers/3984
Thanks! I am not too familiar with flatpaks, do you know if there are any git branching/tagging conventions I need to follow as a developer to play nicely with flatpak?
I'm not sure, but I don't think so? As long as you tag releases, you should be fine.
If you want to just jump into this, there's a good first steps tutorial. I doubt it will get you going though, because you'll probably need some permissions to access the network, graphical interface and so on. They also have guides for specific environments but Golang is unfortunately not in there. You'll probably need to go through at least parts of the full build guide.
In any case, it looks like it's pretty well documented... I haven't gone through this process myself yet, but I've been considering it for this project considering how exciting it is. :)
That would be awesome if you or someone else could volunteer to look into the Flatpak build guide, since I have some new features I'd like to focus on implementing and also I have my day job too :)
Especially someone who uses Fedora, since it looks like the build steps should be simple enough to translate over (you'd probably want to omit the make package_linux
step though since at least for apt the package itself is responsible for installing the executable to /usr/bin, and the .desktop file to /usr/share/applications, etc.
I think the biggest thing to figure out is what are the names of the dependency packages to install in the Flatpak environment
i'm working on something now. so far I have this nasty blob:
app-id: com.github.dweymouth.supersonic
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.golang
command: supersonic
finish-args:
# Wayland
- --socket=wayland
# Fallback X11 + XShm access
- --socket=fallback-x11
- --share=ipc
# for network, obviously
- --share=network
# for audio
- --socket=pulseaudio
# System tray icon
- --talk-name=org.kde.StatusNotifierWatcher
# cargo-cult from https://github.com/flathub/com.github.iwalton3.jellyfin-mpv-shim/blob/master/com.github.iwalton3.jellyfin-mpv-shim.json
- --talk-name=org.gnome.SettingsDaemon.MediaKeys
modules:
- name: supersonic
buildsystem: simple
build-options:
append-path: /usr/lib/sdk/golang/bin
env:
GOBIN: /app/bin
build-args:
- --share=network
build-commands:
- |
. /usr/lib/sdk/golang/enable.sh
export GOPATH=$PWD/go
go version
echo "installing fyne"
# TODO: this should be split in a module
go install -v fyne.io/fyne/v2/cmd/fyne@latest
echo "building"
go build -v .
- echo "installing"
- install -Dm755 -t /app/bin supersonic
sources:
- type: archive
url: https://github.com/dweymouth/supersonic/archive/refs/tags/v0.1.0-beta.tar.gz
sha256: 4baeea51f759c6571bb0e6450e3928838640bb9df80bded77cd8a15528c85163
modules:
- name: libass
sources:
- type: archive
url: https://github.com/libass/libass/releases/download/0.17.1/libass-0.17.1.tar.xz
sha256: f0da0bbfba476c16ae3e1cfd862256d30915911f7abaa1b16ce62ee653192784
x-checker-data:
type: anitya
project-id: 1560
stable-only: true
url-template: https://github.com/libass/libass/releases/download/$version/libass-$version.tar.xz
- type: script
commands:
- autoreconf -fiv
dest-filename: autogen.sh
cleanup:
- /include
- /lib/pkgconfig
- /share
- name: mpv
buildsystem: simple
build-commands:
- python3 waf configure --prefix=${FLATPAK_DEST} --disable-cplayer --disable-lua --disable-build-date --disable-manpage-build --disable-debug-build --disable-tv --disable-uchardet --disable-javascript --enable-vaapi --enable-pulse --enable-alsa --enable-libmpv-shared
- python3 waf build
- python3 waf install
sources:
- type: archive
url: https://github.com/mpv-player/mpv/archive/refs/tags/v0.35.1.tar.gz
sha256: 41df981b7b84e33a2ef4478aaf81d6f4f5c8b9cd2c0d337ac142fc20b387d1a9
x-checker-data:
type: anitya
project-id: 5348
stable-only: true
url-template: https://github.com/mpv-player/mpv/archive/refs/tags/v$version.tar.gz
- type: file
url: https://waf.io/waf-2.0.25
sha256: 21199cd220ccf60434133e1fd2ab8c8e5217c3799199c82722543970dc8e38d5
dest-filename: waf
x-checker-data:
type: anitya
project-id: 5116
stable-only: true
url-template: https://waf.io/waf-$version
cleanup:
- /include
- /share
it's horrible in many ways, coming from debian packaging (#129):
/usr/lib/sdk/golang/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lmpv: No such file or directory
collect2: error: ld returned 1 exit status
so it looks like the mpv headers are there, but not the shared library, ugh.
this almost works now, so i pushed it to a repo:
this almost works now, so i pushed it to a repo:
"almost" as in: it doesn't actually work. the app compiles, and i can relink it with the Fyne command, but then it crashes on startup with:
panic: NotInitialized: The GLFW library is not initialized
full trace:
anarcat@angela:com.github.dweymouth.supersonic$ flatpak run com.github.dweymouth.supersonic
(flatpak run:631919): GVFS-WARNING **: 20:51:10.359: Error creating proxy: Error calling StartServiceByName for org.gtk.vfs.Daemon: Unit gvfs-daemon.service is masked. (g-io-error-quark, 36)
F: Can't find a11y bus: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit at-spi-dbus-bus.service is masked.
2023/04/13 20:51:10 Starting supersonic...
2023/04/13 20:51:10 Using config dir: /home/anarcat/.var/app/com.github.dweymouth.supersonic/config/supersonic
2023/04/13 20:51:10 Using cache dir: /home/anarcat/.var/app/com.github.dweymouth.supersonic/cache/supersonic
2023/04/13 20:51:10 Error reading app config file: open /home/anarcat/.var/app/com.github.dweymouth.supersonic/config/supersonic/config.toml: no such file or directory
2023/04/13 20:51:10 PlatformError: X11: The DISPLAY environment variable is missing
panic: NotInitialized: The GLFW library is not initialized
goroutine 1 [running, locked to thread]:
github.com/go-gl/glfw/v3.3/glfw.acceptError({0x0, 0x0, 0xc000617ac0?})
/home/anarcat/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20221017161538-93cebf72946b/error.go:174 +0x1ae
github.com/go-gl/glfw/v3.3/glfw.panicError(...)
/home/anarcat/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20221017161538-93cebf72946b/error.go:185
github.com/go-gl/glfw/v3.3/glfw.CreateStandardCursor(0xbf5ba0?)
/home/anarcat/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20221017161538-93cebf72946b/input.go:530 +0x45
fyne.io/fyne/v2/internal/driver/glfw.initCursors()
/home/anarcat/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20230331041414-b548301c117c/internal/driver/glfw/window_desktop.go:47 +0x5f
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).initGLFW.func1()
/home/anarcat/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20230331041414-b548301c117c/internal/driver/glfw/loop_desktop.go:27 +0x54
sync.(*Once).doSlow(0xc000617bd0?, 0x44c585?)
/usr/lib/sdk/golang/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
/usr/lib/sdk/golang/src/sync/once.go:65
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).initGLFW(0x440cd0?)
/home/anarcat/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20230331041414-b548301c117c/internal/driver/glfw/loop_desktop.go:16 +0x45
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1()
/home/anarcat/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20230331041414-b548301c117c/internal/driver/glfw/window.go:965 +0x4a
fyne.io/fyne/v2/internal/driver/glfw.runOnMain(0xc00044a360)
/home/anarcat/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20230331041414-b548301c117c/internal/driver/glfw/loop.go:61 +0x11d
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow(0xc000448460, {0xcc7172, 0xa}, 0x1)
/home/anarcat/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20230331041414-b548301c117c/internal/driver/glfw/window.go:964 +0xd8
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).CreateWindow(0x58?, {0xcc7172?, 0xc000617d01?})
/home/anarcat/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20230331041414-b548301c117c/internal/driver/glfw/window.go:956 +0x25
fyne.io/fyne/v2/app.(*fyneApp).NewWindow(0x49b3a5?, {0xcc7172?, 0xfed02da7de003996?})
/home/anarcat/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20230331041414-b548301c117c/app/app.go:69 +0x26
supersonic/ui.NewMainWindow({0xe09038, 0xc0002701b0}, {0xcc7172, 0xa}, {0xcc6c04, 0xa}, 0xc00037c180, {0x466be5?, 0x0?})
/run/build/supersonic/ui/mainwindow.go:53 +0xd6
main.main()
/run/build/supersonic/main.go:39 +0x1b6
@dweymouth any idea what could be missing in there?
you mentioned something about a fork of Fyne somewhere in #129, i don't think i see that in the README instructions... what are you refering to there?
The flatpak metadata file is here:
it should be relatively readable, can you see if I am missing anything?
ah, i simply needed to expose the normal x11 socket (not fallback). any chance this runs under wayland natively btw? :)
The go build command pulls dependencies listed in the go.mod file, which will pull down my fork of Fyne. If it compiles, that's not your problem. Does Flatpack disable OpenGL access by default? If so you need to enable it. The error message looks like it failed to initialize OpenGL
i think i got past the graphical problems, i'm stuck at playing audio (e.g. #112) now. i suspect i might have hit the same bug i hit when i was running the beta release. i tried applying the patch (see #130 for the actual patch i did) and i don't get any output, so it fails before that step.
What subsonic server are you using? Does it work with the Navidrome demo server? #112 seems to be that MPV itself chokes on some playback URLs from airsonic, but I have never seen it with Navidrome
What subsonic server are you using?
Navidrome.
Does it work with the Navidrome demo server?
Untested, but I did manage to make Supersonic work outside of the flatpak, remember, by compiling from git directly.
112 seems to be that MPV itself chokes on some playback URLs from airsonic, but I have never seen it with Navidrome
After recompiling from the latest HEAD, I do get more debug output:
2023/04/13 22:15:30 Adding playback URL: https://sonic.anarc.at/rest/stream?c=supersonic&f=xml&id=REDACTED&s=REDACTED&t=REDACTED&u=REDACTED&v=1.8.0
but still no sound, and the "play" button turns back off after playing, so it doesn'T really work.
playing the above file in mpv itself on the commandline (outside of the flatpak, not sure how to do it inside) works fine.
i'm recompiling again with the latest latest (after your merge) to make sure i have the latest goods. :)
after recompiling with the latest head (440dee15ac1bb42fcd899578576098542ffc4a19), i see the same behavior: the play button turns to pause momentarily and then back to "play" again and no audio comes out.
running out of ideas on this one... if you want to reproduce the issue, install flatpak
and flatpak-builder
on your platform of choice and follow the instructions in the README in https://github.com/anarcat/com.github.dweymouth.supersonic
i'm at the step where i run supersonic through strace
and get way too much noise, i assume because of the golang concurrency stuff. you can get a shell in the sandbox with:
flatpak run --command=sh --devel com.github.dweymouth.supersonic
Progress! I've been able to fix the mpv build to provide me with a mpv
binary and, lo and behold, it can't play the file on its own!
anarcat@angela:com.github.dweymouth.supersonic[2]$ flatpak run --command=sh --devel com.github.dweymouth.supersonic
(flatpak run:742610): GVFS-WARNING **: 09:50:06.794: Error creating proxy: Error calling StartServiceByName for org.gtk.vfs.Daemon: Unit gvfs-daemon.service is masked. (g-io-error-quark, 36)
0F: Can't find a11y bus: GDBuspersonic ~]$ mpv 'https://sonic.anarc.at/rest/stream?c=supersonic&f=xml&id=REDACTED&s=REDACTED&t=REDACTED com.github.dweymouth.supersonic ~]$ mpv 'https://sonic.anarc.at/rest/stream?c=supersonic&f=xml&id=REDACTED&s=REDACTED&t=REDACTED&v=1.8.0'
[ffmpeg] https protocol not found, recompile FFmpeg with openssl, gnutls or securetransport enabled.
[ffmpeg] Protocol not found. Make sure ffmpeg/Libav is compiled with networking support.
Failed to open https://sonic.anarc.at/rest/stream?c=supersonic&f=xml&id=REDACTED&s=REDACTED&t=REDACTED&v=1.8.0.
Exiting... (Errors when loading file)
[📦 com.github.dweymouth.supersonic ~]$
Ha! so i need to fix my mpv build, whoohoo!
submitted this as a PR to flathub: https://github.com/flathub/flathub/pull/4073
audio plays now, and the thing just generally works! the challenge now is to remove the --share=network
at build time, which basically means bundling all the golang dependencies (!) in the manifest. i haven't figured out a clean way to do this just yet.
Go typically builds all the Golang dependencies into the binary statically, so makes sense.
the flatpak PR is now ready to be merged, i believe i've done everything i could on that end. so if all goes well, you should end up on flathub shortly, whoohoo!
and, again, good job on this awesome client. :)
@dweymouth the build fails because I haven't set an appstream data file... do you have one handy? see:
https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html
the automated flathub build failed because of that:
the PR was merged and is now available on flathub! see https://github.com/flathub/io.github.dweymouth.supersonic for the repository and of course this page for installation instructions!
https://flathub.org/apps/details/io.github.dweymouth.supersonic
@dweymouth let me know if you want access to the flathub repository so you can make changes there yourself. generally, i'll make sure there's a bot that makes PRs when there are new changes upstream, but please do let me know the next time there's a release as i had to package the git version for now...
thanks!
oh and this ticket can be closed of course, although I cannot do that myself...
Added the Flathub link to the readme. Thanks @anarcat!
@anarcat I released a new version today. I'm not sure what is the procedure to update the Flatpak. I did update the appstream metadata file.
On 2023-04-22 12:09:23, Drew Weymouth wrote:
@anarcat I released a new version today. I'm not sure what is the procedure to update the Flatpak. I did update the appstream metadata file.
Normally, Flathun should issue me a PR automatically, I'll wait a few days to see if it happens, otherwise i'll just do it myself. Feel free to remind me if i forget! :)
i timed out on the bot, not sure it is supposed to pick it up because i don't actually have the tag in there yet. i made https://github.com/flathub/io.github.dweymouth.supersonic/pull/8 to update to v0.1.0, but i see you already have a bunch of fixes on top of that... i guess i could make a beta branch for that as well?
ah, i simply needed to expose the normal x11 socket (not fallback). any chance this runs under wayland natively btw? :)
what did you do to make this work? After switching to fedora for better overall arm support, I sadly lost access to a repo package of supersonic, meaning I have to rely on flatpak. I'm facing the crash you mentioned and I have no idea how you made this work on wayland - could you tell me how?
Would it be please possible to provide a flatpak release please? Quite interested, but does not run on Fedora 37