GO & GTK Native Subsonic audio streaming client.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Delta503 08013e1faa Update README.md 1 week ago
build_environment Added current work 2 weeks ago
gui Added current work 2 weeks ago
.ci.yml Update CI, update Readme 2 weeks ago
.gitignore Added current work 2 weeks ago
LICENSE Initial commit 2 weeks ago
README.md Update README.md 1 week ago
audio_player.go Added Intelligent streaming with caching and buffer, added some glib.idleadd to improve thread safety tried to fix beep unexpectedEOF 1 week ago
error_handling.go Added current work 2 weeks ago
go.mod Added Intelligent streaming with caching and buffer, added some glib.idleadd to improve thread safety tried to fix beep unexpectedEOF 1 week ago
go.sum Added Intelligent streaming with caching and buffer, added some glib.idleadd to improve thread safety tried to fix beep unexpectedEOF 1 week ago
gui_hardcoded.go Added current work 2 weeks ago
library_actions.go Added current work 2 weeks ago
pictures_actions.go Added current work 2 weeks ago
queue_actions.go Added current work 2 weeks ago
search_actions.go Added Intelligent streaming with caching and buffer, added some glib.idleadd to improve thread safety tried to fix beep unexpectedEOF 1 week ago
settings.go Added current work 2 weeks ago
shared_objects.go Added Intelligent streaming with caching and buffer, added some glib.idleadd to improve thread safety tried to fix beep unexpectedEOF 1 week ago
sonically.go Added Intelligent streaming with caching and buffer, added some glib.idleadd to improve thread safety tried to fix beep unexpectedEOF 1 week ago

README.md

Build Status

Sonically

Cross-Platform Multi-Arch client for Subsonic API compatible servers written in go & GTK targeting mainly Linux On Mobile.

Table of contents

  1. About
  2. Features
  3. Installation and first configuration
  4. Manual
  5. Requests and collaboration
  6. Technical information
  7. Benchmarks
  8. Explanation
  9. Disclaimer

1. About

There was no Audio Airsonic/Subsonic/Navidrome streaming client for Linux mobile I could call full-featured, modern, FOSS, reliable So I need to wrote it. Because Linux on mobile is modular and doesn't force developer to use platform-specific UI Libs, makes this app "write-once", "compile-for".

2. Features

GUI

All GUI .glade files are in gui/ folder in this repo

  • Main (WIP 90%)
  • Dynamicly created: Search - Song
  • Dynamicly created: Search - Album
  • Dynamicly created: Search - Artist
  • Dynamicly created: Library (Playlists) - Main
  • Dynamicly created: Library (Playlists) - Item
  • Dynamicly created: Library (Library) - Artist
  • Dynamicly created: Library (Library) - Albums (Problem with obtaining list, probably need to make a search query for albums only for specific artist)
  • Dynamicly created: Library (Library) - Songs
  • Dynamicly created: Library (starred) - Artist
  • Dynamicly created: Library (starred) - Albums
  • Dynamicly created: Library (starred) - Songs
  • Dynamicly created: Queue
  • Dynamicly created: Playlist
  • Notify about playing current song
  • Lockscreen notification with controls (Seems to be hard... No docs really)
  • Change color/picture of main view to blurred song cover (Blurring implemented but I have to figure out loading stylesheets to gtk)
  • Linux on mobile - Phosh: no need to scale-to-fit on pienphone
  • FlowPane = Floating controls of main view to use on desktop like regular app (Needs some fixes)
  • Automatic cover art re-sizing [saw tutorial in python somewhere]
  • Artist view with band picture (no free, open, cc licensed artist db really but I could try build intelligent query to wikidata)

App Control

  • Internal settings (WIP 78%)
  • Serialize and restore data as session with communication between secret service

Abilities

  • Search for song in dedicated view
  • Play song
  • Queue song
  • View meta-data (Cover, Title, Album, Artist)
  • Progress bar synced
  • View your library in dedicated view (library)
  • View starred in dedicated view (starred)
  • View Queue
  • Modify Queue
  • Use many accounts and servers (WIP)
  • View playlists
  • Edit playlists
  • Sync playlists
  • Star currently playing song
  • Repeat functionality
  • Shuffle
  • Restore queue after app close (Easy to do, but needs serialized struct update)

Cool

  • Fetch Lyrics (Subsonic API in go lacks this feature, I had to use some other API)
  • Fetch Lyrics using proxy (seems to be easy but may need upstream merge request for http.client config)
  • Fetch Lyrics using TOR (seems to bo easy as tcp only proxy)
  • App timer to automatic shutdown

Audio specific

NOTE: streaming advanced functions are not quite easy to implement, so please be patient

  • Intelligent streaming with caching (cache proxy)
  • Seeking by progress-bar (May be never because of problems with no seeking stream, also need to calculate so probably only approximate result)
  • Seeking by long-press next/prev buttons (Probably be done with multiple calling stream.Read with less control)

Codecs

  • opus (Priority)
  • ogg vorbis (Only for someone request with good explanation, this codec has been replaced by opus, ogg doesn't have advantages over opus)
  • flac (Priority)
  • wav (Only for someone request with good explanation, I don't see point, before you do please read what is flac)
  • mp3 (I won't do it but I'll accept complete merge request, it's really old codec, why do you need it?)

Installation and updates

  • installation script/mechanism (with gui loaded from .glade files, no hard-coded like now)
  • update mechanism

Operating systems

arch/os Linux glib Linux musl Windows OSX
x86_64 yes yes wip wip
x86 wip wip ??? ???
aarch64 yes yes ??? ???
armhf wip wip no no
armel wip wip no no
  • ? - I don't know, please help me find out

  • wip - work in progress

  • yes - available to download on release page

  • Linux glib - Linux distros that use glibc as mian c library like Debian, Fedora

  • Linux musl - Linux distros that use musl as main c library like Alpine

  • This will change in time dependent on issue with cross-compiling with dynamic linking. Devs, please help me create Dockerfiles

  • For other mobile platforms (Android, IOS, Salfish, UBports) use their native clients (like Ultrasonic (Android), Subsonic Aurial (UBporst)). There's no sense to port Sonically to the e.g. Android because of requirement to use native UI libs, you may experiment with QT / QML, but is it worth? Secondly they are more mature.

Docs

  • Wiki

Cosmetic

  • Logo

3. Installation and first configuration

As long as I don't have my linux repos this app can be placed in any system location (but needs libs).

For now:

  1. Install libs: Alpine: sudo apk add alsa-tools alsa-lib portaudio opus opus-tools opusfile gdk-pixbuf cairo libnotify libsamplerate glib gtk+3.0 Debian: sudo apt install libasound2 libgtk-3 libcairo2 libglib2.0 libgdk-pixbuf2.0 libsamplerate0 libopusfile0 libopus0 libnotify libportaudio2

I'm not sure what of them are required for running only (I use full set), some of them may be needed just for devs... Sorry for a mess, if you know, contact me please. For now just install one at time and check if it crashes. Or if it still doesn't work check build_environment with full dependencies set

  1. Download binary from release page into the dir you want (I recommend you to follow linux standards and choose $HOME/bin/sonically), (This ofc will be automated in the future) Create Sonically.desktop file in $HOME/.local/share/applications and fill with proper info to have icon in app drawer. Basic:
[Desktop Entry]
Type=Application
Name=Sonically
Exec=/path/to/sonically
Terminal=false

Note that if You want to debug please change terminal to true to have verbose output.

Run: chmod +x /path/to/sonically chmod +x $HOME/.local/share/applications/sonically.desktop

  1. Setup proper transcoding on your server:

My recommendation: opus for lossy and flac for losless (Use lossy ones when you are on cellular network driving car / bike to make file much (even > 7) smaller) (Only use lossless codecs if you know that you need them - example you use this app with home hifi stereo with stable cable connection or ac/ax 5GHz wifi)

Currently available: Lossy:

  • opus: ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -c:a libopus -f opus - (modern codec, succesor of .ogg)

Rest is not yet supported and provided only as an example

Lossy:

  • ogg: ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -c:a libvorbis -f ogg -
  • mp3: ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -

Lossless:

  • flac: ffmpeg -i %s -map 0:0 -v 0 -c:a flac -f flac - (flac is losless algorithm compression over pcm/wav, it's the best choice)
  • wav: ffmpeg -i %s -map 0:0 -c:a pcm_s16le -v 0 -f wav -
  • aiff ffmpeg -i %s -map 0:0 -c:a pcm_s16le -v 0 -f aiff -
  1. Open seahorse (Passwords and keys app) and create keyring called login
  2. Log in into app and set rest settings before you click save
  3. On Server side mark wanted trans-coding to Sonically player
  4. Enjoy!

4. Manual

TODO

5. Requests and collaboration

I'm open for collaboration and I accept merge requests. :) But please check licenses carefully if you want to include other libs than current ones.

Because I use gitea, there's no possibility to collaborate without account additionally I disabled registration so I'll have to register you, see FAQ on my website

6. Technical information

Why go?

Because it's fast, has Garbage collector and bindings for C libs like portaudio, furthermore micro-processors like that one in pinephone needs strong optimization to work reliable. Compare start-up time with e.g. sublime-music (python subsonic client)

Why GTK not QT?

I feel GTK is more ready for touchscreens out of the box, I haven't been digging into that topic for example if touch events are separated from mouse events. For now I haven't been implementing any touch specific event in signals, they just work!

Libs

This subsonic API library is used: https://github.com/delucks/go-subsonic (rest libs are listed in go.mod)

UI

This app is written in go with MVC logic and GTK and GLADE. I'll try not to use libhandy to make it in pure GTK.

Crosscompiling

Go compiles for other OSes and archs than listed above, If you need one, submit merge request with tested Dockerfile to build_environment folder (go 1.17)

Note that crosscompiling with go is not trivial when you need CGO and target alpine linux (that uses musl c library), because you are creating dynamically linked binaries .

Warning: If you want to complie for ARM musl distors like Alpine/postmarketOS you have to use (for now) some micro-computer with arch of your target platform (like >= raspberry pi 3). Then clone repo, use build_environment/arm64/musl-linux dockerfile (rename it to Dockerfile then into the dir type sudo docker build . -t "sonically-musl--arm64-compiler) and then go back to git root dir and use docker run -v "$PWD":/usr/src/myapp -w /usr/src/myapp sonically-musl--arm64-compiler:latest /bin/sh -c 'go build'

You may also read:

7. Benchmarks

Start time

  • bq aquaris x5: TODO
  • pinephone: TODO

8. Explanation

TODO

9. Disclaimer

I'm FOSS fan and I believe in balance between proprietary and FOSS software. This balance has been broken by mobile phone oligopoly that we know as two main companies producing short-term (2yr), tracking, ads-full, restricted for modifications, restricted for developers mobile OSes that are fully subordinated from vendor.

Now is time to have better alternative with better FOSS ad-free apps We don't need one more shitty closed platform.

That's why I'll pack this app for true most-known and usable FOSS distros like pmOS, Mobian, openSUSE Pragmatic & Proprietary distros like Arch, Manjaro, Salfish, have to do it by themselves or submit pull request with every config files they need. Less known distros are also pleased for doing it by their own but from different case - I have very less time and I can only actively maintain for what I use... So nothing personal ;)

This app is made without any warranty.