# Spotify



## buenyamin (Nov 12, 2017)

Is there any way to use Spotify on FreeBSD 11.1?
I tried using the webplayer with firefox, but couldn't get it to work.
I was able to install Clementine player and its spotify plugin, but the plugin does not successfully login to my spotify premium account.

Tried Wine as well with the current windows Spotify installer but was not able to get it to work.

Is there any way to use Spotify on FreeBSD?


----------



## rigoletto@ (Nov 12, 2017)

No, Spotify does need some DRM bs what does not compile in FreeBSD (same for Netflix). However, *maybe*, you can make it run using the Linuxolator, but I do not know indeed as I do not use Spotify... or run it in a VM on top of Linux/Windows etc...

Alternatively, you can use a superior music streaming service like Qobuz what does not need any DRM bs.

Cheers!


----------



## Sensucht94 (Nov 12, 2017)

xforce said:
			
		

> is there any way to use Spotify on FreeBSD 11.1?



yes as lebarondemerde pointed out, the only current solution for Spotify Streaming on FreeBSD is running Linux as VM, which can be comfortable enough, especially provided you already did it for other purpose, like Netflix.


			
				lebarondemerde said:
			
		

> ... or run it in a VM on top of Linux/Windows etc...


 Sure, I use OpenSuSE Leap on QEMU with Google-Chrome-Stable, for both Spotify and Netflix, and it never gives problems

Until recently emulators/playonbsd's pre-packaged wine port  for Firefox was a good way of streaming Spotify.
Unfortunately the Firefox version PlayonBSD  used for its port is no longer able to display spotify.com, due to incompatibility of latest Adobe Flash Player version with legacy Firefox.
 On the other hand I do not know of anyone who reportedly ran a recent version of Firefox on wine.

There are however several worth ways of streaming music on FreeBSD:
- multimedia/minitube
- audio/mps
- multimedia/livestreamer (I love this one)
- www/get_flash_videos,
- multimedia/mps-youtube (love this one too)
- multimedia/mplayer.

There are also some other good lightweight streaming utilities, available on github, which compile without problem on FreeBSD:

*1) streamlink* also officially available on OpenBSD repositories, as ported by Ibara

*2) **pyradio*, just build it with devel/py3-pip


*3) **pms (Poor Man's Spotify)*, yes you heard right, it's an amazing streamer. You can easily build this as well with pip

*4) *Finally, I have never tried this, even on Linux (as there wasn't an official Slack package), but there's been a lot of rumor around *Tizonia*. I've grown curious about compiling it since *it officially supports Spotify streaming,  *and was thinking of giving it a try, just a couple of days ago, like the silly music addict I am


----------



## tommiie (Jun 19, 2019)

Sorry for resurrecting anold thread but has anyone tried `ncspot`? It's written in Rust and supposedly works on the BSDs.


----------



## trasz@ (Dec 23, 2020)

FWIW, I've just tested the official Spotify client (https://www.spotify.com/uk/download/linux/, the non-Snap one) in Ubuntu 18 chroot under 13-CURRENT, and it seems to work just fine.


----------



## Alexander88207 (Dec 23, 2020)

There is also audio/spotify-qt


----------



## micski (Jan 19, 2022)

I can confirm, that Spotify runs "right out of the box", when installed in FreeBSD 13's built-in Linux Binary Compatibility. I wrote each command line instruction on how to do it on https://www.micski.dk/2022/01/19/how-to-install-spotify-on-freebsd/.


----------



## jbo (Jan 19, 2022)

micski does this also run under the centos distribution/compatibility or is loading ubuntu necessary here?


----------



## micski (Jan 21, 2022)

jbodenmann said:


> micski does this also run under the centos distribution/compatibility or is loading ubuntu necessary here?


I have not tested CentOS as the Linux Binary Compatibility base system, but given, that Spotify for Linux is available as a Debian package, I would assume so. Spotify targets their Linux version for Ubuntu though. See their Spotify for Linux page.


----------



## facedebouc (Jan 22, 2022)

I am currently listening Deezer with native Firefox 91.5.0esr OSS audio backend on FreeBSD 13.0-RELEASE


----------



## t4mb0w$ (Feb 17, 2022)

micski said:


> I can confirm, that Spotify runs "right out of the box", when installed in FreeBSD 13's built-in Linux Binary Compatibility. I wrote each command line instruction on how to do it on https://www.micski.dk/2022/01/19/how-to-install-spotify-on-freebsd/.


Hi there,

Firstly, I appreciate this blog post, did not know about FreeBSDs Linux Binary Compatibility!

I am able to install, and get going just fine. However, when I try to play (any) music I receive the following error:

"Spotify can't play this right now. If you have the file on your computer you can import it"

Terminal output:



> spotify:81484): GLib-GIO-CRITICAL **: 14:47:17.603: g_dbus_connection_send_message: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
> 
> ALSA lib confmisc.c:767parse_card) cannot find card '0'
> 
> ...



I do not know much/at all about Ubuntu (especially not with how FreeBSD deals with this). Any thoughts? Much appreciated.


----------



## elgrande (Jul 7, 2022)

t4mb0w$ said:


> Hi there,
> 
> Firstly, I appreciate this blog post, did not know about FreeBSDs Linux Binary Compatibility!
> 
> ...


Did you find any way to solve this?
Currently I experience the same issue when running Ubuntu Jammy. No problems with Ubuntu Focal though.


----------



## ziomario (Jul 7, 2022)

t4mb0w$ said:


> Hi there,
> 
> Firstly, I appreciate this blog post, did not know about FreeBSDs Linux Binary Compatibility!
> 
> ...



it works.


----------



## elgrande (Jul 8, 2022)

Ok, for those not having sound, this fixed it for me (using spotify binary instead of chrome), post #43:








						[Linuxulator] How to run Google Chrome (linux-binary) on FreeBSD
					

In case it's of any use, I also installed mpv. If I play a video straight from mpv, as opposed to going through the web browser, sound is fine.  I wonder if this has something to do with what we use for window manager. Maybe some of the desktop environments have something extra that we don't...




					forums.FreeBSD.org


----------



## hardworkingnewbie (Jul 8, 2022)

If you want a headless Spotify player, then also raspotify or spotifyd might be worth a look. 









						GitHub - dtcooper/raspotify: A Spotify Connect client that mostly Just Works™
					

A Spotify Connect client that mostly Just Works™. Contribute to dtcooper/raspotify development by creating an account on GitHub.




					github.com
				











						GitHub - Spotifyd/spotifyd: A spotify daemon
					

A spotify daemon. Contribute to Spotifyd/spotifyd development by creating an account on GitHub.




					github.com
				




These are daemons based on Libspotify, and then connecting to it and playing back music. You can steer this in the Spotify app of your choice, e.g. smartphone. 

Or you could use web based frontends like Mopidy to steer it. https://mopidy.com/


----------



## ziomario (Jul 9, 2022)

what's the utility to use spotify on the PC ? can't you use Youtube ?


----------



## csgordon (Jul 14, 2022)

I followed micski 's tutorial (used focal), and everything worked great for a couple days. Now today Spotify loads, but I get lots of "Couldn't find that page" and it can no longer play music that wasn't already locally cached from previous play. My terminal is filled with `ERR: getaddrinfo failed: -3` messages from Spotify. Has anyone encountered this, or does anyone have any idea what might have triggered this? I haven't mucked with settings from the tutorial beyond installing a few additional packages in `/compat/ubuntu` (prior to the last time playback worked).


----------



## micski (Jul 14, 2022)

Could it be related to DNS or internet connection from the chroot via host computer? I just tested and it still works with Spotify 1:1.1.84. You can confirm latest version in chroot with `apt show spotify-client`.


----------



## jbo (Jul 14, 2022)

csgordon said:


> My terminal is filled with `ERR: getaddrinfo failed: -3` messages from Spotify


I know nothing about this Spotify stuff but the above error message sounds like address resolution failed.
This can have many reasons including:

Spotify having changed some of the "URLs" of their server(s) and the utility you're using has them hardcoded somewhere.
DNS is (temporarily) unavailable.
Changes in the network prevent you from resolving the address.
Just a general bug in the software/utility you're using.
Or it is something completely different - again: No idea about this particular case.


----------



## csgordon (Jul 14, 2022)

Apparently the issue is must simpler and independent of spotify; it seems I can't access the internet at all from within the Ubuntu jail, pinging anything fails and I can't even run `apt update`. Thanks for the comments, I'll dig into this deeper issue.


----------



## csgordon (Jul 14, 2022)

jbodenmann was spot-on. After some digging I figured out that the issue is a combination of:

I'm on a laptop using wifi
I set up the Ubuntu /compat at work
I'm currently at home
The two have very different DNS setups (in particular, my employer's DNS servers are naturally not available from my house)
Connecting to wifi at home updated /etc/resolv.conf for my BSD host, but not in the jail.
I verified that this was the problem by manually copying the BSD conf into the /compat/ubuntu directory, which I guess has been standard practice for a while (https://forums.freebsd.org/threads/...on-a-freebsd-jail-with-zfs.41470/#post-241453).


----------



## t4mb0w$ (Jul 30, 2022)

elgrande said:


> Did you find any way to solve this?
> Currently I experience the same issue when running Ubuntu Jammy. No problems with Ubuntu Focal though.


Hi,

A long reply, my apologies.

I never did get this working, ended up installing an Ubunu VM and running it through this.


----------



## elgrande (Jul 30, 2022)

t4mb0w$ said:


> Hi,
> 
> A long reply, my apologies.
> 
> I never did get this working, ended up installing an Ubunu VM and running it through this.


I got it running though by installing pulseaudio in host and ubuntu jail and using the script linked in post #14.


----------



## paulfrottawa (Dec 3, 2022)

My expeirence it worked the first time but not always. Then it starts working on its own months after the install.


----------



## elgrande (Dec 3, 2022)

paulfrottawa said:


> My expeirence it worked the first time but not always. Then it starts working on its own months after the install.


Should probably be possible to rule the problems out.
Works absolutely stable for me at least.
Only thing: After closing, I have to manually kill all "ghost" Spotify processes before opening again. I use `kill -9 `ps -Af | grep spotify | grep compat | awk '{ print $1 }'`` for this.


----------



## macbias (Dec 5, 2022)

For the record, you can just use the web player in linux browsers (binary,/compat/ubuntu). If you already installed that for netflix, spotify webplayer is pretty much hassle free if that's working.


----------



## paulfrottawa (Saturday at 7:25 PM)

Got it working today after a fresh install.   I didn't change FreeBSD hosts file and waited till it was a problem in chroot env then edit it with network ip and hostname in ubuntu base system.

also I put this in /etc/fstab

```
devfs      /compat/linux/dev      devfs      rw,late                    0  0
tmpfs      /compat/linux/dev/shm  tmpfs      rw,late,size=1g,mode=1777  0  0
fdescfs    /compat/linux/dev/fd   fdescfs    rw,late,linrdlnk           0  0
linprocfs  /compat/linux/proc     linprocfs  rw,late                    0  0
linsysfs   /compat/linux/sys      linsysfs   rw,late                    0  0
```

Also before I install spotify client it did this
`apt update
apt install -y apt-transport-https curl fonts-symbola gnupg pulseaudio wget`

____________________________________________________________-
Did it to a second machine but Linux didn't install like the first one so entering that into /etc/fstab stop me from booting. I had to single user mode. `mount -u /`
and take out the stuff I put into /etc/fstab.

__________________________________________________________
Problem with debootstrap package. I had to make
/usr/local/sbin/debootstrap executable


----------



## paulfrottawa (Saturday at 10:38 PM)

So I got both my machines using spotify and my speakers only hook up to one computer. If I play a song on either machine on spotify and it plays the speaker. So somehow this is happening and I like it.
_________________________________________________
Also the company I had while installing it ask for my FreeBSD installation thumb drive. So I converted him to FreeBSD


----------



## ziomario (Sunday at 1:45 PM)

I've realized that with the new versions of the linuxulator this line does not work anymore in the fstab file :

*tmpfs      /compat/linux/dev/shm  tmpfs      rw,late,size=1g,mode=1777  0  0*


----------

