Thanks @poetaster, I should probably just add an application icon and maybe disable sailjail for now. Let’s see if @wdehoog is still around to accept small PRs, otherwise hutspot seems to be working fine even today;)
Thanks @NIS, you could test the OBS-built librespot from Index of /obs/home:/b100dian:/rust-packages/sailfish_latest_aarch64/aarch64) back up your /etc/default/librespot
and /etc/systemd/user/librespot.service
if the rpm install doesn’t already. See if you notice any problems - one thing that should be different is volume control for volume buttons (which is an env set in /etc/systemd…)
I’m thinking that some more cleanup is needed before publishing to chum, like moving the systemd definition to /usr/lib/systemd
and adding another configuration file that will have the defaults overridden by /etc/defaults
one…
Wow, volume control with the vuttons? I always wanted this feature!
But your link gives me a „Not found“ error unfortunately
WOW. I just had time to shortly test this (installed it and played a fee seconds of a song) and IT WORKS!
Even the volume buttons which is a big plus for me. Thank you very much
Heh, this is a moment to acknowledge @rubdos’ and @direc85’s work on bringing more up to date rust in SailfishOS with the help of the Jolla people of course. I’ll do my best to make this available in chum next.
I have now tested this more extensively and I must say it works really well and reliable!
I have one question though: where does Librespot get your Spotify-credentials from? Because for me, I already used librespot before with the same cache folder, so everything worked. But what would I need to do if I would deploy such a Hutspot+Librespot solution on a new device?
Good question. The key is the credentials.json
file in librespot’s cache which is now set as /home/defaultuser/.cache/librespot
.
Hutspot, if it has sailjail disabled, can use the “Register librespot credentials” option to (indirectly) write to it by issuing a librespot command you could also do yourself from commandline (source).
It seems that hutspot can also read that credentials.json file (source) but I am not sure this is working, or the webview credentials are used.
Ah okay. So on a new device, I basically would need to either disable SailJail sandboxing or issue a librespot command by hand, right?
Yes but there may be other hutspot actions not working with sailjail, TBD
I wasn’t able to authenticate because of this bug. Thanks @vlagged I installed librespot 0.5.0. With this version, password authentication is disabled. So I ran this command:
librespot --cache /home/defaultuser/.cache/librespot --name Sailfish --bitrate 320 --initial-volume 80 --device-type smartphone --backend pulseaudio -j
An URL is generated allowing to authenticating using OAuth. Once that done and credentials.json
is created with all data, I had to move to the right folder (/home/defaultuser/.cache/librespot
) and hutspot recognized correctly my device
Thanks @pherjung for foraying into testing the untested build .
The story is that new authentications cannot happen through password. The “bug” is Spotify removing that option, and the librespot folks worked hard to find a way around, I just build it and since I already had an auth token didn’t test it, but Patrick confirmed it works, so there, if anyone has this problem and this -j
works for them, do tell, as I think it would be about time I push librespot to chum…
I also manage to see the phone in Hutspot Devices but it says it is inactive and when I am trying to play something is says: “undefined:404:Device not found”. Did someone manage to solve this issue? Thanks!
Edit: I’ve solve it by setting the device as Current.
This is actually the normal behaviour of Hutspot. So as you figured out yourself, you are supposed to select the device as a current device. This is because you could have multiple devices in the list and then Hutspot wouldn’t know on which to play.
No, there was only Sailfish phone in the device list. I didn’t had multiple devices. I thought if only one device is in the list it becomes active implicitly. Thank you anyway for reply. Now I understand the behavior.