pi-apps icon indicating copy to clipboard operation
pi-apps copied to clipboard

Spotify

Open Pythonic456 opened this issue 3 years ago • 54 comments

Spotify Web Player on Chromium or Min has issues (even when using Widevine):

  • Skips songs after playing for 0 seconds
  • Repeats ^ until it hits an ad, which it plays
  • Repeat both of above until your frustration is too much and you defenestrate your Raspberry Pi

Jokes aside, this is very annoying. So maybe a way to run the Ubuntu version of Spotify, or some way of using wine?

Pythonic456 avatar Nov 03 '21 21:11 Pythonic456

It's possible with Exagear (#1051), but Exagear is not yet up on Pi Apps as of its legal issue. You can import Exagear via the import-app tool, and start Exagear, and you can install Spotify like how you do in i686 Linux machines.

If Exagear is merged to pi-apps, I think Spotify will be the first app based on Exagear to be added to pi-apps.

cycool29 avatar Nov 04 '21 02:11 cycool29

I use the linux Spotify desktop client every day, with the help of ExaGear. It works pretty well, unless your Pi is really being pushed (over 85-90% on all cores, Raspberry Pi 4 4G). It runs admirably well, for being a heavy music streamer/player on an emulated i686 (Intel 32-bit) system, on a Raspberry Pi 4 4G. That means that it's not very fast.. It works though:

!https://user-images.githubusercontent.com/91354257/140267369-5fcf5921-46b7-48d1-9586-22d186ccb078.mp4

When I say it works, it does, but the account menu doesn't work, as well as the Filter bar in playlists. If you are wondering, the yellow rectangle in covering my username.. :+1: If the install scripts aren't working for you, you can try this tutorial to install ExaGear. Once you have ExaGear installed, just follow the installation instructions for Linux on the Spotify website. Keep in mind that using ExaGear is ~~probably~~ illegal, since it was a paid software, and now it is owned by Huawei, and under their terms you can use it for free, but only on Huawei Kunpeng processors...

Crilum avatar Nov 04 '21 06:11 Crilum

ExaGear works with that tutorial, but how do I install Spotify in it? It seems to be using my host systems file system, and not a container? I would much appreciate any help on containerising this. Thanks!

Pythonic456 avatar Nov 04 '21 09:11 Pythonic456

Start Exagear, and execute these commands:

wget -O spotify.deb https://repository-origin.spotify.com/pool/non-free/s/spotify-client/spotify-client_1.0.72.117.g6bd7cc73-35_i386.deb
sudo apt install ./spotify.deb

cycool29 avatar Nov 04 '21 09:11 cycool29

I got Spotify running. I couldn't login with Facebook (which my primary account is on), so I had to use my email sign in, which is inconvenient. And the Spotify app fails when trying to use GPU acceleration. And when playing a song, no sound comes out of the speakers, and it doesn't initialize any kind of audio connection to pulse.

Pythonic456 avatar Nov 04 '21 09:11 Pythonic456

I got Spotify running. I couldn't login with Facebook (which my primary account is on), so I had to use my email sign in, which is inconvenient.

Can't test this since I use email as my primary login way.

And when playing a song, no sound comes out of the speakers, and it doesn't initialize any kind of audio connection to pulse.

Weird. I can play music on my pi with sound flawlessly.

cycool29 avatar Nov 04 '21 10:11 cycool29

And when playing a song, no sound comes out of the speakers, and it doesn't initialize any kind of audio connection to pulse.

I have no idea why yours doesn't output any sound. Mine did automatically, on multiple SD cards running RPiOS. What OS and audio output do you use? I have no idea if this will work, but ExaGear doesn't have pulseaudio installed, so you could try installing pulseaudio inside ExaGear.

I got Spotify running. I couldn't login with Facebook (which my primary account is on), so I had to use my email sign in, which is inconvenient.

ExaGear does not have a web browser installed in the guest image as far as I can tell, and Facebook login requires a browser to open the little Facebook login website window, right? Try installing a light but Facebook capable browser.

And the Spotify app fails when trying to use GPU acceleration.

Yes, it does fail to use GPU acceleration. Like I said, it's a Raspberry Pi running the Spotify desktop cilent though an emulated container. Give it some slack. :) ~~You also can't use multiple Spotify windows because of this (I think. It just hangs after GPU acceleration errors - What you were saying?).~~ NVM multiple windows work..

Crilum avatar Nov 04 '21 15:11 Crilum

I have no idea why yours doesn't output any sound. Mine did automatically, on multiple SD cards running RPiOS. What OS and audio output do you use?

Raspberry Pi 32-bit OS, BT audio.

I have no idea if this will work, but ExaGear doesn't have pulseaudio installed, so you could try installing pulseaudio inside ExaGear.

Will try this.

ExaGear does not have a web browser installed in the guest image as far as I can tell, and Facebook login requires a browser to open the little Facebook login website window, right? Try installing a light but Facebook capable browser.

I installed Chromium but nothing happens when I click "Login with FaceBook".

Yes, it does fail to use GPU acceleration. Like I said, it's a Raspberry Pi running the Spotify desktop cilent though an emulated container. Give it some slack. :) You also can't use multiple Spotify windows because of this (I think. It just hangs after GPU acceleration errors - What you were saying?).

Doesn't hang - it just fails to use GPU acceleration. It works, but slow because of this.

Pythonic456 avatar Nov 04 '21 20:11 Pythonic456

Doesn't hang - it just fails to use GPU acceleration. It works, but slow because of this.

Yeah, but for me, if you try to open two simultaneous Spotify windows, it just hangs after the GPU acceleration errors.

EDIT: Nevermind. It works just fine, if a little slower..

Crilum avatar Nov 05 '21 05:11 Crilum

I installed Pulseaudio and it works fine now. I'm trying to find a way to get GPU acceleration working.

Pythonic456 avatar Nov 05 '21 11:11 Pythonic456

There is a tutorial on how to enable hardware acceleration (I don't know if GPU acceleration is same with hardware acceleration) in /opt/exagear/share/doc/user-guide.pdf. You can try it out.

cycool29 avatar Nov 05 '21 12:11 cycool29

Cool, thanks. I'll try it!

Crilum avatar Nov 05 '21 15:11 Crilum

I think this is kind of weird...

no-full-kms

The ExaGear Hardware acceleration page in teh user guide says to use full kms, and to set it via raspi-config, but my raspi-config doesn't have an option for Full KMS. I have seen it before in raspi-config, so I don't know why it's not there now..

I tried to set it by just changing the config.txt file GL driver line to

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-kms-v3d
max_framebuffers=2

But everything appears to be the same...

Crilum avatar Nov 05 '21 18:11 Crilum

I can't see Full KMS inraspi-config too. After some googling I found the full KMS for Pi 4 is still beta, but for Pi 2 and 3 is already live, as see in this forum post.

Also, I found the user guide said:

On Raspberry Pi 2 and Raspberry Pi 3 ExaGear supports hardware graphics acceleration. This feature significantly increases performance of x86 applications that use OpenGL up to version 2.1.

So maybe that's only support Pi 2 and Pi 3...

cycool29 avatar Nov 06 '21 01:11 cycool29

Yeah, that makes sense.

@Pythonic456 @cycool29 Do either of you have a Pi 3 you could try it on? Mine is lacking a power supply at the moment.

Crilum avatar Nov 06 '21 07:11 Crilum

Yeah, that makes sense.

@Pythonic456 @cycool29 Do either of you have a Pi 3 you could try it on? Mine is lacking a power supply at the moment.

No, I don't have a Pi 3.

cycool29 avatar Nov 06 '21 07:11 cycool29

I have a 2B, although it is very slow compared to my 4.

Pythonic456 avatar Nov 06 '21 13:11 Pythonic456

@Pythonic456 Well, I think you could still try it.

Crilum avatar Nov 06 '21 14:11 Crilum

Open-source spotify clients are also an option...

I've been using this application called Spot for a while: https://github.com/xou816/spot

It has almost all the functions of Spotify, except for downloading songs

ryanfortner avatar Nov 07 '21 20:11 ryanfortner

I wish it had an armhf build...

Crilum avatar Nov 07 '21 20:11 Crilum

Open-source spotify clients are also an option...

I've been using this application called Spot for a while: https://github.com/xou816/spot

It has almost all the functions of Spotify, except for downloading songs

It only works with premium accounts.

cycool29 avatar Nov 07 '21 23:11 cycool29

Yeah, and I really use offline mode...

Crilum avatar Nov 07 '21 23:11 Crilum

https://github.com/dtcooper/raspotify What about using this?

Pythonic456 avatar Nov 08 '21 09:11 Pythonic456

https://github.com/dtcooper/raspotify What about using this?

That is Spotify Connect, not Spotify client.

cycool29 avatar Nov 08 '21 10:11 cycool29

I've used that, and it's good, as a Spotify Connect client. But, it's not a GUI, and you can't control it from your Raspberry.

Crilum avatar Nov 08 '21 17:11 Crilum

Pi-ware has a working spotify app, maybe adapt its script?

leha-code avatar Dec 05 '21 12:12 leha-code

I just looked at Pi-Ware's github repo, and couldn't find a Spotify/anything that might be a Spotify client. Could you please link to the install script you mean?

Pythonic456 avatar Dec 05 '21 16:12 Pythonic456

@leha-code I assume that this is the repository you mentioned: https://github.com/piware14/pi-ware So where is the "Spotify" app?

Pythonic456 avatar Dec 07 '21 09:12 Pythonic456

I have Pi-Ware installed, and I don't see any Spotify..

Crilum avatar Dec 07 '21 17:12 Crilum

Looks like they used to have Spotify? I searched the repository and found this commit deleting Spotify.

Botspot avatar Dec 07 '21 18:12 Botspot

Ah, thanks @Botspot. I guess it didn't work?

Crilum avatar Dec 07 '21 18:12 Crilum

For anyone interested: RPiOS Bullseye comes with Full KMS enabled, and Spotify with ExaGear has hardware acceleration. It's still not fast, but is really not awful. @Pythonic456 Try signing in with facebook again.. I think the hardware acceleration might fix that.. All the menus and search bars work now.

Crilum avatar Jan 21 '22 00:01 Crilum

I will have to flash a MicroSD with Bullseye and try this. :)

Pythonic456 avatar Jan 24 '22 08:01 Pythonic456

@Pythonic456 Just curious, have you tried it yet?

Crilum avatar Jan 28 '22 03:01 Crilum

@Crilum Not yet, will try to do it today and let you know how it goes.

Pythonic456 avatar Jan 28 '22 09:01 Pythonic456

I have flashed a SD card with rpios bullseye, and have installed exagear with debian 8. I encountered a annoying thing: You don't seem to be able to become root in the exagear image. Fortunately, if you are root when you run exagear, you are root in the exagear image. Spotify has installed, but when running, it has no hardware acceleration. Here is the output:

libGL error: MESA-LOADER: malformed or no PCI ID
libGL error: unable to load driver: vc4_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: vc4
libGL error: MESA-LOADER: malformed or no PCI ID
libGL error: unable to load driver: vc4_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: vc4
[0130/132218.238110:ERROR:sandbox_linux.cc(344)] InitializeSandbox() called with multiple threads in process gpu-process.
pi@raspberrypi:~ $

(Btw, it doesn't crash - I just closed it.) Seems to want vc4_dri, but I can't find anything in the APT repos or online on how to go about setting it up/installing it. Any help would be appreciated.

Pythonic456 avatar Jan 30 '22 13:01 Pythonic456

And you can't login with Facebook still. I installed Firefox in Exagear and can launch it, I then set it as the default browser. When I click "Login with Facebook" in Spotify, the firefox-esr process doesn't appear on the top list at all. Seems Spotify might fail somehow when trying to find a browser, am using strace to figure out what exactly is happening. I logged in with my email Spotify account, which works, and can play music just fine. Unfortunately, no graphics acceleration.

Pythonic456 avatar Jan 31 '22 09:01 Pythonic456

@Crilum any ideas?

Pythonic456 avatar Jan 31 '22 10:01 Pythonic456

For anyone interested: RPiOS Bullseye comes with Full KMS enabled, and Spotify with ExaGear has hardware acceleration. It's still not fast, but is really not awful. @Pythonic456 Try signing in with facebook again.. I think the hardware acceleration might fix that.. All the menus and search bars work now.

I have installed it on Bullseye however no hardware acceleration still.

Pythonic456 avatar Jan 31 '22 15:01 Pythonic456

@Crilum so did you manage to get hardware accel working?

Pythonic456 avatar Feb 09 '22 11:02 Pythonic456

No, I didn't.. :cry: But, Spotify is definitely faster and more usable on Bullseye...

Crilum avatar Feb 09 '22 21:02 Crilum

Anyone that's interested might take a look at @MCRaspRBX's Spotify Web app:

image

This might be a good app to put on Pi-Apps. It has all the functionality of the Desktop App (offline songs excluded, of course), but is much lighter than the full Desktop Client, the Web app appears to run at about 5% CPU load on my Pi 4, whereas the Desktop Client uses a full core when using the UI. It also appears to have hardware acceleration, since it's just chromium..

@Botspot what would you think about adding this if I made some scripts?

Crilum avatar Mar 10 '22 21:03 Crilum

Anyone that's interested might take a look at @MCRaspRBX's Spotify Web app

It looks like it's just a Chromium desktop shortcut that goes to open.spotify.com...

ryanfortner avatar Mar 10 '22 22:03 ryanfortner

Yeah, it is.. But it's slightly different, It doesn't have the Spotify logo in the corner, and it doesn't have a Download the App button..

I guess it really is just the web player, but it feels a lot better to have it on the desktop. I don't like using Spotify in a web browser, but this webapp makes it feel like I'm using the full Desktop Client, even though it's just the web player.

Crilum avatar Mar 10 '22 23:03 Crilum

But it's slightly different, It doesn't have the Spotify logo in the corner, and it doesn't have a Download the App button.

That could be due to the custom user-agent. --user-agent="Mozilla/5.0 (X11; CrOS armv7l 11895.95.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.125 Safari/537.36"

Botspot avatar Mar 11 '22 00:03 Botspot

I tried installing that repo, but unfortunately I still have the problem where I play a song, it skips after ~1 second, then continues to do that song after song until it manages to play the first ten seconds of a song, at which point the audio stops playing, then the whole Spotify UI becomes unresponsive. I tried uninstalling Chromium and Chromium Widevine, then reinstalling both from Pi-Apps, still doesn't work. Oh and by the way, when you click play for the first song since opening Spotify, it doesn't do anything for about 5 seconds.

https://user-images.githubusercontent.com/56113118/158015259-aebbf205-ba4f-4e7e-b671-7988b9cf3beb.mp4

Any ideas?

Pythonic456 avatar Mar 12 '22 10:03 Pythonic456

What RPiOS/Debian version are you running? I'm on Bullseye, that might have something to do with it...

Crilum avatar Mar 12 '22 19:03 Crilum

Buster 32bit userspace, 64bit kernel.

Pythonic456 avatar Mar 13 '22 11:03 Pythonic456

Yeah, in Buster, DRM is still broken I think, but it works in Bullseye!

Crilum avatar Mar 14 '22 18:03 Crilum

So I tried to make a qemu-powered x86 chroot, with this tutorial, and the chroot worked, and the Spotify window opened, but then it just seg-faulted...

$ spotify

(process:3337): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Gtk-Message: Failed to load module "canberra-gtk-module"
qemu: unknown option 'type=gpu-process'
qemu: unknown option 'type=gpu-process'
qemu: unknown option 'type=gpu-process'
qemu: unknown option 'type=gpu-process'
qemu: unknown option 'type=gpu-process'
qemu: unknown option 'type=gpu-process'
qemu: unknown option 'type=gpu-process'
qemu: unknown option 'type=gpu-process'
[0412/222343.730152:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[0412/222411.416909:ERROR:service_manager_context.cc(171)] Attempting to run unsupported native service: /usr/share/spotify/content_renderer.service
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault

Crilum avatar Apr 12 '22 22:04 Crilum

@Pythonic456 So, I just saw this, maybe it would work for you? https://community.spotify.com/t5/Accounts/Can-t-Login-via-Facebook-anymore/td-p/1210679

Crilum avatar Apr 29 '22 04:04 Crilum

It might be possible to use qemu-user with flatpak (only on 64 bit systems, though, cause the Spotify flatpak is x86_64 only).. https://www.reddit.com/r/linux/comments/n6x63p/til_that_flatpak_apps_can_emulate_nonnative_apps/

Crilum avatar May 31 '22 04:05 Crilum

well i am using spotify on my arm64 raspbain using chromium:arm32

Painadath avatar Jul 10 '22 15:07 Painadath

well i am using spotify on my arm64 raspbain using chromium:arm32

Yes, Spotify Web Player works with Chromium and Bullseye.. I assume you're using Bullseye?

Also, you shouldn't need to use chromium:armhf, the arm64 version should work fine..

Crilum avatar Jul 11 '22 04:07 Crilum