[How To] Install Subsonic 4.8 on FreeNAS 9.1.1

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
"pkg install xtrans xproto xextproto javavmwrapper lame flac openjdk-7.25.15"
Note you will need to do a pkg search for what version of openjdk is currently in the repo otherwise you will get a not found error.
Now we need to compile and install ffmpeg to get it to transcode files to mp3 on the fly with lame. This will take a while get a coffee and relax.
Command "portsnap fetch extract"
Then "cd /usr/ports/multimedia/ffmpeg1" (yes we really want ffmpeg1)
Then "make" ---- Important ---- At this point you will be presented a list of options, make sure you an X in the LAME section. I also turn on AAC support (top).
Then "make install clean"

So, during this build process I checked off "blu ray support". Apparently it's marked as broken in Java... so the build failed with error code 1. Now when I try to make ffmpeg again, it says it depends on libbluray.so and it just fails the same way again since it's broken. How do I get back to that first prompt where you select the different options (AAC, LAME, etc)?
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
So, during this build process I checked off "blu ray support". Apparently it's marked as broken in Java... so the build failed with error code 1. Now when I try to make ffmpeg again, it says it depends on libbluray.so and it just fails the same way again since it's broken. How do I get back to that first prompt where you select the different options (AAC, LAME, etc)?

Try "make config" and see if it presents you with the options again. Otherwise you will have to poke around in the maintainers readme or make file or google to get it reset. I do not know offhand.
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
Try "make config" and see if it presents you with the options again. Otherwise you will have to poke around in the maintainers readme or make file or google to get it reset. I do not know offhand.

Gah, thanks... I literally just figured that out and started making again when you responded.
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
Well I ran into a few hiccups (wget to download subsonic didn't work, for instance), but ultimately I got this working. Can't thank you enough for this. Now I can finally turn off my gaming desktop when I'm not home :tongue:
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
Well I ran into a few hiccups (wget to download subsonic didn't work, for instance), but ultimately I got this working. Can't thank you enough for this. Now I can finally turn off my gaming desktop when I'm not home :p

Glad you got it working :-D Was the link for wget still good or does it need updating?
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
Glad you got it working :-D Was the link for wget still good or does it need updating?
I guess it needs updating, but I couldn't see what would have been wrong with it. Tried other variants and still didn't work. I had to download on my windows box and move it to the dataset being mounted by the jail.

Sent from my Galaxy Nexus using Tapatalk 2
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
Weird... so I deleted sonic... re-added sonic... same problem.

However, then I created another user "test" with mostly the same settings (maybe different shell?). Now, the "users" command still returns nothing, but if I "su sonic" it actually shows the "sonic@subsonic" prompt. Weird, right?

Hmm, maybe this needs to be looked at as possible bug or maybe someone reading this will offer a possible explanation.
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
Hmm, maybe this needs to be looked at as possible bug or maybe someone reading this will offer a possible explanation.
Yeah, I think it might be a bug. I mean, those kind of shell commands should be pretty deterministic. On one hand it might be hard to reproduce since it doesn't happen with everyone... On the other hand, it's not just me.

Sent from my Galaxy Nexus using Tapatalk 2
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
Glad you got it working :-D Was the link for wget still good or does it need updating?
Actually... crap... I had this same issue with Madsonic. I don't know what happened because I tested video, flac, everything and it worked at first... now it doesn't work anymore.

Only mp3s will stream (probably because it doesn't need transcoding, just streaming). Trying to transcode flac doesn't work (no error... just no playing or buffering) and videos say "video not found or access denied". I saw a post somewhere saying something about it having to do with the permissions on ffmpeg or something...

Any ideas? Could it be my jail dataset permissions?
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
Actually crap

Any ideas? Could it be my jail dataset permissions?

When you say "no errors" are you referring to the subsonic log? What group permissions are you using on your media dataset and does the sonic user also belong to the group? I have not had any permission problems yet with my setup. I do remember having the no playing thing when I tried to use ffmpeg version .7 instead of 1.x.
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
When you say "no errors" are you referring to the subsonic log? What group permissions are you using on your media dataset and does the sonic user also belong to the group? I have not had any permission problems yet with my setup. I do remember having the no playing thing when I tried to use ffmpeg version .7 instead of 1.x.
Yeah, that's right... the subsonic log.
So, since I've linked to the storage where the media is (outside the jail, technically), I can't add sonic to the other groups I've made in FreeNAS. Sonic doesn't show up as a user at all in the web UI, presumably because it was created within the jail... for instance, I couldn't add Sonic to the group that I made in the FreeNAS web ui when i was creating that user in the jail.
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
Is your sonic user iin the wheel group? It will be a couple of days till I get back to my machine so I can't help verify much at the moment. I think I made my media dataset rw by wheel group which is available system wide.
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
Is your sonic user iin the wheel group? It will be a couple of days till I get back to my machine so I can't help verify much at the moment. I think I made my media dataset rw by wheel group which is available system wide.
Sonic IS part of wheel... I haven't changed my Media permissions, so I don't know why it would suddenly not work, but I'll go try that. Thing is, MP3s still stream, so subsonic can certainly read from there at least... it's something to do with ffmpeg accessing the files, and wasn't ffmpeg installed and created by root?

I think I'm just going to completely scrap my jails directory, and redo this whole thing from scratch. I think I can probably just substitute Madsonic in for subsonic in your how-to and it should work the same (right? correct me if I'm wrong about that...). Since it was working once, then I messed with jail permissions... I probably only have myself to blame. Now that I've done it once it should be faster the second time around. I'll let you know what happens.
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
Sonic IS part of wheel... I haven't changed my Media permissions, so I don't know why it would suddenly not work, but I'll go try that. Thing is, MP3s still stream, so subsonic can certainly read from there at least... it's something to do with ffmpeg accessing the files, and wasn't ffmpeg installed and created by root?

I think I'm just going to completely scrap my jails directory, and redo this whole thing from scratch. I think I can probably just substitute Madsonic in for subsonic in your how-to and it should work the same (right? correct me if I'm wrong about that...). Since it was working once, then I messed with jail permissions... I probably only have myself to blame. Now that I've done it once it should be faster the second time around. I'll let you know what happens.

I am not sure how compatible the installs would be, I think he has madsonic (certianly the newest builds) traveling in new/different direction. I am sure your current jail can be fixed easy though.
Thanks for keeping me informed.
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
I am not sure how compatible the installs would be, I think he has madsonic (certianly the newest builds) traveling in new/different direction. I am sure your current jail can be fixed easy though.
Thanks for keeping me informed.

Well, I redid everything from scratch... deleted jails dataset altogether... had to redownload a template and whatnot.
I ran into the same bug with the users not showing up, though I had to fiddle more before sonic@subsonic~# showed up in the console... created sonic, created test, deleted sonic, created sonic again... then I once I su'd to test, I couldn't su back to root (message said "Sorry")... however sonic@subsonic~# finally showed up. This must be a glitch in FreeNAS... it's clearly not deterministic.

Fun way to avoid having to edit subsonic.sh in terminal... edit it and repackage it in the .tar.gz so it unpacks the way you want.

Anyway, seems to be working now... transcoding 2 simultaneous HD streams without breaking a sweat.
 

Mathewr

Cadet
Joined
Sep 29, 2013
Messages
7
Well, I redid everything from scratch... deleted jails dataset altogether... had to redownload a template and whatnot.
I ran into the same bug with the users not showing up, though I had to fiddle more before sonic@subsonic~# showed up in the console... created sonic, created test, deleted sonic, created sonic again... then I once I su'd to test, I couldn't su back to root (message said "Sorry")... however sonic@subsonic~# finally showed up. This must be a glitch in FreeNAS... it's clearly not deterministic.

Fun way to avoid having to edit subsonic.sh in terminal... edit it and repackage it in the .tar.gz so it unpacks the way you want.

Anyway, seems to be working now... transcoding 2 simultaneous HD streams without breaking a sweat.


Hi the_tox, can you outline what you did to get the sonic user working correctly? I have tried on and off and always get the same result: no sonic user, but the $ symbol.

Thanks
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
Hi the_tox, can you outline what you did to get the sonic user working correctly? I have tried on and off and always get the same result: no sonic user, but the $ symbol.

Thanks
The first and second time I did it... each was slightly different. I don't think there's any other way than just screwing around with users until it works, but here's what I did from what I remember.

Attempt 1:
Created sonic, created test, then it worked.

Attempt 2:
Created sonic, created test, deleted sonic, created sonic, then it worked. In between this I tried logging into test and sonic and blah blah... so some other "steps" but it was just fiddling.

Can't hurt to reboot either. I wish I had a better answer... I even completely redid my jails from scratch before attempt 2. Just fiddle around and try logging into sonic between steps (when it exists) and hopefully it'll eventually work. Then don't mess up your permissions like I did so you don't have to redo it.

By the way, ffmpeg is insane on FreeNAS since the OS doesn't get in the way. It fully utilizes my i3 (seeing 340% or so in 'top') and can spit out transcoded 1080p at 20 Mbps.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Hi the_tox, can you outline what you did to get the sonic user working correctly? I have tried on and off and always get the same result: no sonic user, but the $ symbol.
It actually does not matter if you see the $ symbol, or the sonic user in the command prompt.
This misunderstanding already spawned a separate thread (http://forums.freenas.org/threads/creating-users-within-jails-in-shell-buggy.15830/) and an (already closed) bug report (https://bugs.freenas.org/issues/3343), so let me explain the "mystery" :).
The string you see at the begging of the command line depends on the shell you use and is also fully customizable. If you selected the sh shell when creating the user (adduser asks you this question: "Shell (sh csh tcsh nologin) [sh]:") you will only get the $ prompt. If you selected the csh shell you will get the "nicer" prompt. You see the prompts because those are the defaults for the respective shells. However, both shells allow you to customize the prompt. The sh shell by changing the PS1 environmental variable. Let me quote from the sh manual (http://www.freebsd.org/cgi/man.cgi?manpath=freebsd-release-ports&query=sh):
[PANEL]PS1 The primary prompt string, which defaults to ``$ '', unless you
are the superuser, in which case it defaults to ``# ''.[/PANEL]
In csh it's the prompt environmental variable (www.freebsd.org/cgi/man.cgi?manpath=freebsd-release-ports&query=csh):
[PANEL] prompt The string which is printed before reading each command from
the terminal. prompt may include any of the following format-
ting sequences (+), which are replaced by the given informa-
tion:<snip>[/PANEL]
The default for csh is "%n@%m:%/ %#" (you can check the documentation for explanation of all the special codes, but %n is automatically replaced by the username and %m by the hostname).

So, it really does not matter what prompt you see. To find out which user credentials you are using run this command:
[PANEL]whoami[/PANEL]
The whoami (Who am I?) command will print the current user name (http://www.freebsd.org/cgi/man.cgi?manpath=freebsd-release-ports&query=whoami) and I'm pretty sure that it will display sonic even if you see the $ prompt.

PS: You can see this shell difference already when you jexec into the jail. If you run jexec 1 /bin/sh you will only get # (it's # and not $, because you are root), if you run jexec 1 /bin/csh you will see root@[hostname]:/ #.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
The first and second time I did it... each was slightly different. I don't think there's any other way than just screwing around with users until it works, but here's what I did from what I remember
May I suggest reading the documentation instead of trying random actions next time ;) ? William actually pointed you toward the topics to study in the bug report (shells, PS1).
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
May I suggest reading the documentation instead of trying random actions next time ;) ? William actually pointed you toward the topics to study in the bug report (shells, PS1).
Point taken, but I had already done this before the bug report or any idea of what direction to go. But I've learned something new, so thank you for clearing that up for us noobs

Sent from my Galaxy Nexus using Tapatalk 2
 
Top