Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add page for Raspbian install documentation #10

Closed
issuemover631 opened this issue May 27, 2017 · 14 comments
Closed

Add page for Raspbian install documentation #10

issuemover631 opened this issue May 27, 2017 · 14 comments

Comments

@issuemover631
Copy link
Collaborator

Issue by jooola
Saturday May 27, 2017 at 04:23 GMT
Originally opened as https://github.com/Libresonic/documentation/issues/10


See https://github.com/Libresonic/libresonic/issues/281

@issuemover631
Copy link
Collaborator Author

Comment by disanvparean
Saturday May 27, 2017 at 12:25 GMT


Installing Libresonic on Raspberry Pi 3 (Raspbian lite but should be working with full Raspbian - other Raspberry Pi with Raspbian should work too)

$ sudo apt install oracle-java8-jdk tomcat8
$ wget https://libresonic.org/release/libresonic-v6.2.war
$ sudo mkdir /var/libresonic/
$ sudo chown -R tomcat8:tomcat8 /var/libresonic/
$ sudo systemctl stop tomcat8.service
$ sudo mv libresonic-v6.2.war /var/lib/tomcat8/webapps/libresonic.war
$ sudo systemctl start tomcat8.service

Be patient (several minutes at least on Raspberry pi 3), you can follow the deployment using :

$ sudo tail -f /var/log/tomcat8/catalina.out

When Libresonic ))) appears go to http://ip:8080/libresonic (default user/password admin/admin)

If you have a nginx reverse proxy, add to /etc/nginx/sites-available/default (or another config file if you're not using the default one) and add just before the last } :

location /libresonic/ {

proxy_pass http://localhost:8080;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP         $remote_addr;
proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host              $http_host;
proxy_max_temp_file_size           0;
proxy_redirect                     http:// https://;
}

Restart nginx :

$ sudo service nginx restart

And then go to :

https://yourdomain.com/libresonic


Thank you for your wonderful software :-)

@issuemover631
Copy link
Collaborator Author

Comment by jooola
Saturday May 27, 2017 at 12:27 GMT


Thanks! If you're up to submit a PR tell otherwise i'll do it !

@issuemover631
Copy link
Collaborator Author

Comment by disanvparean
Saturday May 27, 2017 at 12:35 GMT


Please do it, I'm not so familiar with git ;-)

@issuemover631
Copy link
Collaborator Author

Comment by disanvparean
Saturday May 27, 2017 at 12:44 GMT


If you want to enable transcoding :

Transcoding (adapted from Subsonic htpcguides.com) :

$ sudo apt install libav-tools xmp lame flac

In order to avoid permission problems :

$ sudo chmod ugo+x /usr/bin/avconv /usr/bin/flac /usr/bin/xmp /usr/bin/lame

Libresonic uses ffmpeg by default so we are tricking the symlink into using avconv. And then we are creating other symlinks.

$ sudo ln -s /usr/bin/avconv /var/libresonic/transcode/ffmpeg &&
sudo ln -s /usr/bin/flac /var/libresonic/transcode/flac &&
sudo ln -s /usr/bin/xmp /var/libresonic/transcode/xmp &&
sudo ln -s /usr/bin/lame /var/libresonic/transcode/lame

@issuemover631
Copy link
Collaborator Author

Comment by jooola
Saturday May 27, 2017 at 12:53 GMT


For trans coding it don't think this really necessary to add lame/flac/xmp. Currenlty Libresonic only use ffmpeg (avconv) for transcoding.

And i don't konw if it works for you but i already saw someone having an issue symlinking ffmpeg to avconv. I didn't tested it but the best way to do this should be to not change the names in the symlinks but change them in the transcoding rules in Libresonic.

Or simply download ffmpeg from jessie-backports (which should exist on raspbian )

@issuemover631
Copy link
Collaborator Author

Comment by disanvparean
Saturday May 27, 2017 at 13:04 GMT


I didn't know libresonic doesn't use lame/flac/xmp.
I did not change it in settings because as they are using the same syntax I thought it was better not to touch to settings. It seems to be working indeed according to logs : "2017-05-27 12:45:40.218 INFO --- o.l.p.io.TranscodeInputStream : Starting transcoder: [/var/libresonic/transcode/ffmpeg] [-i] [/xxx.mp3] [-map] [0:0] [-b:a] [192k] [-v] [0] [-f] [mp3] [-] ". And I tried with 32k and I can tell you it's working haha, my ears are still bleeding.
I didn't know neither about ffmpeg in jessie-backports. That's good news.
Some maybe tell people how to install ffmpeg from backports is sufficient. Is the symlink from /var/libresonic/transcode necessary ?
Thank you

@issuemover631
Copy link
Collaborator Author

Comment by jooola
Saturday May 27, 2017 at 13:12 GMT


Yeah libresonic needs the symlinks from /var/libresonic/transcode/ffmpeg to /path/to/ffmpeg.

Good to know ! I'm going to install my rapsberry pi too i think !!

@issuemover631
Copy link
Collaborator Author

Comment by disanvparean
Saturday May 27, 2017 at 13:22 GMT


Yeah, it's working well. Outside my home network (50ko/s max uploading) I need two seconds for transcoding and start playing the file (4 minutes mp3 320k to mp3 192k). And I only have 60 MB free on memory on my Pi because I'm using transmission+sickrage+libresonic.

I tried to transcode using ffmpeg package and it's working well. What I did :


Transcoding

Transcoding :

Edit /etc/apt/sources.list :

$ sudo nano /etc/apt/sources.list

Add at the end of file :

deb http://httpredir.debian.org/debian jessie-backports main non-free
deb-src http://httpredir.debian.org/debian jessie-backports main non-free

Run update and install ffmpeg :

$ sudo apt update && sudo apt -t jessie-backports install ffmpeg

Create the symlink :

$ sudo ln -s /usr/bin/ffmpeg /var/libresonic/transcode/ffmpeg

You're ready !

@issuemover631
Copy link
Collaborator Author

Comment by jooola
Saturday May 27, 2017 at 13:25 GMT


Ok thanks this is online in 5 minutes !

@issuemover631
Copy link
Collaborator Author

Comment by jooola
Saturday May 27, 2017 at 13:28 GMT


https://github.com/Libresonic/documentation/blob/stable/install/example/raspberrypi.md

I made some changes but this is done thanks !

@issuemover631
Copy link
Collaborator Author

Comment by disanvparean
Saturday May 27, 2017 at 13:45 GMT


Great, nice work :)

@issuemover631
Copy link
Collaborator Author

Comment by disanvparean
Saturday May 27, 2017 at 14:43 GMT


Ok I checked your documentation and it seems that /usr/bin/ffmpeg doesn't need to belong to the user running libresonic to work. I don't know why. Is tomcat using root account ? I don't think so it has his own account (tomcat8).

$ ls -allh /usr/bin | grep ffmpeg
-rwxr-xr-x  1 root root    194K Feb 27 16:22 ffmpeg

Moreover, we don't know where source.list is located as it's not mentioned in the documentation.

@issuemover631
Copy link
Collaborator Author

Comment by muff1nman
Saturday May 27, 2017 at 14:56 GMT


Correct, ffmpeg only needs to be executable by tomcat, not owned by tomcat

@issuemover631
Copy link
Collaborator Author

Comment by jooola
Saturday May 27, 2017 at 14:57 GMT


Yeah ok i'll fix the source list files path !

No about the transcode the binaries have to stay as is. Like most other binaries they are owned by root.
See ls -l /usr/bin/
The only thing thats need to change is the link owner.

Additionnally if you see the ffmpeg permissions (755) everyone can execute it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant