pdaddyo / soundbounce

Social listening for Spotify - music sounds better together.
MIT License
251 stars 28 forks source link

Official request for linux support #114

Open ikt opened 9 years ago

ikt commented 9 years ago

Didn't see any other requests for it so here I am! Would love a linux version since I use Ubuntu 99% of my day.

This project looks fantastic, can't wait to see it take off :)

Edit: for the bounty I'm looking for a 64bit Ubuntu 14.04 compatible .deb that installs everything nicely

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7238482-official-request-for-linux-support?utm_campaign=plugin&utm_content=tracker%2F9578624&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F9578624&utm_medium=issues&utm_source=github).
pdaddyo commented 9 years ago

In theory this should be reasonably simple, since note-webkit and node-spotify used on the OSX version are apparently compatible with linux already. If anyone wants to try and get this working on linux I can try and point you in right direction.

On Wed Dec 24 2014 at 12:38:34 ikt notifications@github.com wrote:

Didn't see any other requests for it so here I am! Would love a linux version since I use Ubuntu 99% of my day.

This project looks fantastic, can't wait to see it take off :)

— Reply to this email directly or view it on GitHub https://github.com/pdaddyo/soundbounce/issues/114.

saward commented 9 years ago

Do you have some OSX build instructions that I could try running on Linux?

pdaddyo commented 9 years ago

Our adjusted node-spotify library will need recompiling for linux node-webkit using nw-gyp, and then the existing app.nw file should load on linux using node-webkit. I don't know much more than that I'm afraid, good luck!

Beamboom commented 9 years ago

+1 for Linux support. I'm a 100% Linux user, former Soundrop user who are desperately looking for a replacement.

earthling commented 9 years ago

I think I've got everything built and running on Linux, but I need an 'app.key' - is each Soundbounce user supposed to get their own app key? or is it included in the soundbouce distribution? It seems to have been intentionally excluded from source control. Help?

earthling commented 9 years ago

I extracted the app.key from the osx distribution and it's working on Linux! I don't really know anything about nodejs et. al., so aplogies if this is hamfisted, but here's what I did:

    "link_settings" : { 
      "libraries": ["-lasound -lspotify"]
    },  
  $ nw-gyp configure --target=0.8.6
  $ nw-gyp build --target=0.8.6
  $ export NODE_PATH=<your-path>/soundbounce/src/client-node-webkit/node-spotify-master/build/Release

Hope that helps.

carnager commented 9 years ago

Just to make sure i did everything right. I installed node-webkit and nw-gyp via my package manager (the versions are correct)

and then it tells me that it cant find libspotify.

also: in the dmg file i cant find a "app.key" file

earthling commented 9 years ago

I don't think you need to npm install node-libspotify, the node-spotify-master is node-libspotify. And it needs to be built with nw-gyp. Make sure you have soundbounce/src/client-node-webkit/node-spotify-master/build/Release on the NODE_PATH. I found the 'app.key' file inside a zip in: Soundbounce-v0.9-beta-osx1/Soundbounce.app/Contents/Resources/app.nw . To be honest, I gave up trying to mount the dmg/img from the command line and just used nautilus to open (i.e., mount) the converted soundbounce.img file and again to open the 'app.nw' file (I've no idea what sort of compression that uses). The 'app.key' file is in 'app.nw'.

carnager commented 9 years ago

ok, got the app.key file. as you can see i did the export, but it doesnt work: https://fb.53280.de/laC2/

earthling commented 9 years ago

Did nw-gyp configure --target=0.8.6 and nw-gyp build --target=0.8.6 succeed in node-spotify-master? I also ran nw-gyp install at some point, but I think all that does is 'install' the nodejs headers it needs. I don't think it 'installs' any build artifacts.

carnager commented 9 years ago

make: Leaving directory '/home/carnager/soundbounce/src/client-node-webkit/node-spotify-master/build' gyp info ok

yes, worked fine.

earthling commented 9 years ago

Does your build directory look like this?

ls build/Release  
linker.lock  metadataUpdater.js  nodespotify.node  obj.target  spotify.js

Also, at one point I made a misguided effort to run the server and installed a bunch of packages with npm, maybe try this: sudo npm install spotify-web-api-node?

carnager commented 9 years ago

carnager@caprica ~/soundbounce/src/client-node-webkit/node-spotify-master > ls build/Release
obj.target/ linker.lock metadataUpdater.js nodespotify.node* spotify.js

and that command didnt do much :)

earthling commented 9 years ago

Sorry man, that's about all I got. If I unset NODE_PATH I get the popup warning about not being able to find libspotify, but I do not get any errors on the console about 'Uncaught TypeError'. I just see:

[8313:0106/164536:INFO:CONSOLE(343)] "Uncaught Error: Cannot find module 'spotify'", source: module.js (343)

Are you able to login despite the error? It could be the case that the spotify module is available - I wonder if there is some other error preventing it from loading? I don't really know, I'm reaching.

carnager commented 9 years ago

no... libspotify is indeed not loaded, so it complains about unimplemented functions.

[12680:0107/015315:INFO:CONSOLE(80)] "Uncaught TypeError: Cannot call method 'login' of undefined", source: http://app.soundbounce.org/login.html (80)

earthling commented 9 years ago

I'm on Ubuntu 14.10 - you? I also used the nw distributions from github, not the ubuntu packages.

carnager commented 9 years ago

arch linux

carnager commented 9 years ago

I suppose the most striking thing is the segfault i get, when running the compiled node-spotify binary directly...

zsh: segmentation fault (core dumped) nodespotify.node

pdaddyo commented 9 years ago

Hi guys, If you got this working please can you post a build or some instructions for getting it to work on Linux here? Would love to point people this way if they're on linux. Cheers

carnager commented 9 years ago

OK, it was relatively easy and mainly caused by a typo, that it didn't work. Here are the steps:

Install libspotify and nodejs and libasound headers via your distributions package manager. On ubuntu the latter is most likely called "libasound2-dev"

git clone https://github.com/pdaddyo/soundbounce.git
cd soundbounce/src/client-node-webkit/node-spotify-master/
sed 's/.*\"libraries\"\: \[\"\-framework OpenAL \-framework libspotify\"\]/        "libraries"\: \[\"\-lasound \-lspotify\"\]/g' binding.gyp
sudo npm install -g nw-gyp
npm install nodewebkit@0.8.6
nw-gyp configure --target=0.8.6 --python=python2
nw-gyp build --target=0.8.6 --python=python2
cd ../osx
cp /path/to/app.key .

then run it:

../node-spotify-master/node_modules/nodewebkit/nodewebkit/nw .

enjoy!

carnager commented 9 years ago

a hopefully working 64bit binary: https://dl.53280.de/soundbounce_linux.tar.bz2

extract it. cd to soundbounce/ run ./start.sh

on arch linux you need libudev.so.0 from aur

pdaddyo commented 9 years ago

Thanks for these instructions, appreciated.

carnager commented 9 years ago

Arch Linux Package in AUR:

https://aur.archlinux.org/packages/soundbounce-git/

ikt commented 9 years ago

./start.sh [23617:0111/183448:INFO:CONSOLE(359)] "Uncaught Error: libspotify.so.12: cannot open shared object file: No such file or directory", source: module.js (359)

Thanks for the work! Where does one find libspotify.so.12? Using Ubuntu 14.04


Nevermind: downloaded from here: https://developer.spotify.com/technologies/libspotify/

libbspotify 12.1.51 linux-libc6 x86_64 tar.gz

Extracted and installed using: make install prefix=/usr/local

Boom works!


Next problem: there's no sound

carnager commented 9 years ago

thanks, added libspotify to dependencies for the arch package. btw, mopidy provides deb packages of libspotify: https://github.com/mopidy/libspotify-deb

for the sound: known issue. restart the app. Here its enough to pause/play a few times.

when building yourself it is possible that you are missing the alsa header files. Install libasound2-dev then rebuild soundbounce

ikt commented 9 years ago

Quick question @pdaddyo is the v1 release expected to be the last release for a while? It looks like most of the work is happening on the server side of things, should I assume the v1 release will be around for a while? thanks

pdaddyo commented 9 years ago

I had hoped to get v1.1 out of the door by now, with items that need to be on the native client side (volume control, selecting temp files location etc), but unfortunately real life has got in the way. Realistically, it'll be at least another month until I'm able to even look at items. So we're looking at May at the earliest, and to be honest it'll probably be a windows-only update since I'm looking for help with the node-spotify / osx / linux bugs that users are encountering before adding features (these aren't my daily platforms). Thanks.

ikt commented 9 years ago

thanks for the info :)

pdaddyo commented 9 years ago

Does the Chrome Extension count as Linux support? :)

ikt commented 9 years ago

Very cool and I'm installing it, but def want ubuntu support, may be possible with the upcoming snap packages.

https://developer.ubuntu.com/en/snappy/tutorials/node-to-snap/