installation of logitech mediaserver [SOLVED]

This looks like a good place for it

Re: Installed Debian Package - How to save in Foxyroxy?

Postby jbv » Wed Aug 29, 2012 10:08 am

Hi Steen,

Finally, I have a special install script for LMS.

I should make it quite clear that LMS itself does not need this and it actually highlighted a glitch in FoxyRoxy that slipped past me. Without mentioning any names (to protect both the innocent and the guilty), the glitch also exists in quite a lot of the other "Debian-Live" based distros that I have seen and learnt (bad stuff) from. Since spotting this, I decided to do some extra work and make sure that LMS would be a no-brainer in FoxyRoxy, as doing so helped me learn. I was also really impressed when I did run it and while I may not use it and I think there are some things that might work a little differently, I could also see the attraction as it is basically a very nice media server. Besides, I may run it one day :)

Therefore, the script I have created will download the LMS for you if you don't have it, but if you do, you can just tell it the name of the .deb file when you run it and it won't download it.

Right now, I'm in a bit of a quandary as to exactly what to do with this. The script works, but it has shown me a few things that need fixing in FoyxRoxy. In fact, I have already done them. I have also studied the startup process for LMS and have made some "tweaks" to that, so the whole LMS startup is improved under FoxyRoxy.

What is causing me the mental anguish, is that when I consider what we get with 99-snap and saving local changes easily and where I want to take things with being able to easily change (and save) the system services startup sequence, I really want to change some filenames and where things will load.

Combined with the playing I did to sort-out the NVIDIA drivers, I am thinking that it might be time to start preparing for DevRel_03 when I have got the services thing working nicely. I would also like to do something similar for XBMC as I have done for LMS. So, what do I do with the "fixes" I know I have now which includes the LMS builder and some miniDLNA stuff.

I would also like to work with you about where to put the "working" files for LMS and what (if anything) we save from LMS in our revised 99-snap

Right now, I'm thinking the best thing to do would be --- post the LMS-Builder script and ask you and anyone else that is interested to test it. I would also like to talk with you about config files and the like over the next few days. To do this, I will need to play a little more with LMS to make sure that I understand it and it's files.

Work on the XMBC cleanup and try to get someone (KazzaMozz ?) to help me get that sorted.

See if I can drag saintless into going back to the Audio driver thing with me again.

However, I would also like to get some of the other stuff to you all, lie the revised "95-create/refresh" scripts, a nicer miniDLNA startup script for /etc/init.d that won't error if you have LMS loading and a few other things.

Part of me says to just make a single .ZIP with all of this stuff in it and ask people to test what they can.
The real problem I have with going this way is that it will be impossible for me to support.

I will also need everyone to realize and understand that things will change when DevRel_03 is made and they would really need to download the entire DevRel_03 ISO when it is ready. Therefore, everyone will need to start again with DevRel_03, although I think if we all work together to sort this out, then DevRel_03 should be able to stay pretty much it as we progress.

I need to sleep on this one and would like some feedback from you all too.

For you to have a look at the LMS-Build script, download the attached a script below.
Drop it in /tmp
Then run /tmp/20-build-lms from a terminal/console session.
If you have already downloaded LMS, then put the full path/filename on the line you enter, otherwise it will download it. When it has finished, it will make /live/image/live/20-LogitechMediaServer.squashfs which will be loaded on the next reboot. Then you can open Firefox and enter localhost:9000 as the URL to do the configuration etc.

At this point, I wouldn't suggest getting to carried away with the config stuff. Just do enough basic setup so you can test it and confirm that it is working for you, because over the next few days, will play and tweak it. As part of our "tweaking" will may change where things live so that we can save configurations etc, so once again for now, just think of this as a "we have it working" thing.

I will value your feedback and the feedback of others over the next day or two before I make the final decision as to what way I will go with it all.

Cheers
Attachments
20-build-lms.sh
20-build-lms.sh
(5.32 KiB) Downloaded 338 times
jbv
 
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: Installed Debian Package - How to save in Foxyroxy?

Postby SBP » Wed Aug 29, 2012 5:16 pm

Hi Jvb

Your script is working fine. It installs LMS, and after a reboot it starts automatically and can be seen on the network.
After configuring LMS - pointing it towards my attached USB HDD, which FoxyRoxy mount automatically as well, I can connect my Logitech devices to the server and play all my local music files as well as net based radio stations. So everything is working fine.

The next issue is as you indicate is to determine where to save and what we want to save.

1. I would like to save my configuration and the changes which I have made. I think it is saved in /var/lib/squeezeboxserver/prefs/server.prefs

2. Regarding music database, this file contains the database with info on artist, album title, cover etc. It can be build at stat-up everytime, but depending on your hardware it could take from few minutes up to 30 min. Even though I plan on having the server on 24 hour I think that I would like to keep this file after a reboot as well.

As I'm not completely sure on how FoxyRoxy works I don't have a plan for that. But could you tell me where is the configuration file and the database file actually located now. I mean I can see it using XFexplorer, but as I understand FoxyRoxy is a read-only linux, so these files which looks like they are present on the Pendrive, are they actually in RAM?

Before trying FoxyRoxy I have been using Voyage linux (I don't know if you are familiar with this) but it is also read-only. In Voyage you use a file called etc/default/vopyage-util.
In this file you write which files need to be copied from RAM to the corresponding directory at shutdown - maybe we could have a similar file, where we add the directories we want to be saved at shutdown.
So in theory FosyRoxy could hold the database and the configuration files (or minidnla or Sambe config files or..) in RAM until powerdown - at which time the content should be written to the disk or injected if that is the correct terminology.

Is this possible??
Steen
SBP
 
Posts: 74
Joined: Thu Aug 16, 2012 5:27 am
Location: Denmark

Re: Installed Debian Package - How to save in Foxyroxy?

Postby saintless » Thu Aug 30, 2012 2:55 am

Hi, JBV,
I can also confirm 20-build-lms installs LMS. Unfortunately I don't have a device to connect with and test it properly further.
User avatar
saintless
 
Posts: 246
Joined: Sat Jul 14, 2012 7:01 am
Location: Bulgaria

Re: Installed Debian Package - How to save in Foxyroxy?

Postby jbv » Thu Aug 30, 2012 3:53 am

Hi saintless,

Thanks for that.
There is a Windows player (client) that SBP provided a link to <click me> earlier in the thread.

I just found a .deb Linux player (client) on the download site ... <click me>

You could download that and just install it with dpkg -i squeezeplay_7.7.2~9599_all.deb (although I would rename it to be something like splayer_772.deb after downloading it)
Hang-on a sec. I'm gonna try something ... back soon.

Cheers
jbv
 
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: Installed Debian Package - How to save in Foxyroxy?

Postby jbv » Thu Aug 30, 2012 4:20 am

Drats, it didn't work. I tried downloading and installing on my FoxyRoxy machine (the same one I was running the SqueezeBoxServer on).

The app didn't run properly. Something messed up the graphic library they are using. As the whole Linux Player looks very much like a real "beta", I'm not going to waste any time trying to work out why it didn't run.
jbv
 
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: Installed Debian Package - How to save in Foxyroxy?

Postby jbv » Thu Aug 30, 2012 6:09 am

Hi Steen,

I'll try to explain the "lives in RAM" and "Container File" thing again.

When FoxyRoxy starts, it reads the 0x-filename.squashfs files in the /live directory.
These are processed in the order that Linux sees them when reading the directory.
This is why FoxyRoxy uses numbers in the front of each .squashfs file, it is to control the order/sequence.

All of the files actually live inside the .squashfs file which is mounted as a read-only device by the squash-filesystem. When you use XFexplorer and look at the various directories and files, you are actually reading the contents from the .squashfs file on the USB stick. This requires parts of the .squashfs file to be read into memory as the .squashfs file itself is a heavily compressed "container file" While it is doing this, some parts are cached. This is the part of FoxyRoxy that lives in RAM. They dynamically loaded part and the parts that are always being used end up being cached in RAM. Parts that are not read or used won't be touched and if you do something that needs to read from that file, then it will be read from the USB stick. I think at a minimum, the squashfs-filesystem will read every directory tree and keep this structure in memory. It may not read all of the filenames as it probably doesn't need to untill a file is accessed or something occurs that would require it to read the entire structure. It might, I just don't know and it doesn't matter to me (us). We just need to have a little faith that the guy who developed this didn't do so by accident, and he knows what he's doing, as is evident by the fact that it works.

As we have put all of the LMS stuff into 20-logitechmediaserver.squashfs all of the files including configuration, database, everything (except media) actually live inside this file which physically resides on the USB stick. It is read and cached as and when needed. If we make a change to a file that is inside the .squashfs, then the "copy-on-write" ("cow") tracks those changes and creates a working "live" version of that file in RAM. It does not actually touch the USB stick and the original file inside the .squashfs remains untouched. However, what happens is that when we try to open or change that file again, "cow" redirects the file input/ouput commands so that it no longer reads the contents from the USB stick and instead reads the file from RAM (which is the new/modified file), which is what we want. This information is lost at power-off so that after a power-cycle or system restart, the original file from the .squashfs that lives on the USB stick is now the file that is used. I hope you're with me so far. If not, please try to re-read this again.

The only way to change the physical files inside of a .squashfs file is to decompress the .squashfs to a hard-disk (or to a RAM-drive such as /tmp), modify the files you want to change and then re-compress the files back into a new .squashfs This is what the various xx-load / xx-save scripts do. There are a few "traps for young players" here though. The first one I ran into is that a FAT32 filesystem can not store or retain file ownership permissions. This means that if you drop a file onto a USB stick or hard drive that is formatted as FAT32, Linux can no longer know the permissions for the file because FAT32 doesn't know of such things. This is why I always create the .squashfs in [/b]/tmp[/b]

If you don't have enough memory to decompress the .squashfs and rebuild it in /tmp, then the only safe thing to do would be to create a second partition on your USB stick or HDD and make sure that the second partition is a native linux filesystem such as ext2/ext3 or similar. If you do this, then you could decompress the .squashfs and rebuild it on the second partition and not loose file permissions. The scripts all make use of environment variables to know where to read, create, and write stuff from. This is what the 99-setdirs script does. It "patches" 01-FoxyRoxy.squashfs so that you can change the defaults to use other partitions.

However, if you are doing this often, you still would not want this to be a flash based disk.


I'll address the LMS databases in a moment, but for now, I hope this explains the files and what is in RAM and how stuff sort of works.

I have not used or looked at Voyage Linux. No offense, but I don't intend to look at any other distros now.
I'm happy with where I am headed with FoxyRoxy, and looking at anything else will just be a distraction.

While at first, it might seem like a good idea to have some files automatically backed up every time you shutdown, if you think about this for a moment, I hope you will agree that it really isn't such a good idea. For me, right off the bat, it breaks one of my Golden Rules - FoxyRoxy will only EVER write to the USB stick when you tell it to. This has turned out to a bit of a Godsend during development. While it can make some things a little messier, I feel it is worth the slight pain. I know that no matter what I do while I'm poking and prodding, I can never trash my system or damage the USB stick. As mentioned, sometimes it can make things take longer to test, but in the end it has saved me more often that it has created grief. For example, I reckon I must have restarted FoxyRoxy over a hundred times while messing around with LMS and another hundred times while making and testing the LMS-build script. The same goes for the NVIDIA driver, but I did not loose anything and it really didn't take long. As all of the xx-save scripts create a backup, winding back is really easy and stopping something from loading for one or two power-cycles is really easy too - I just change the extension to be filename.squashfs.noload and it won't load at system start. Then if I want to look inside the .noload, I just edit one of the existing scripts and play with the names, save the script and run it. It is really very Easy.

Now, back to the LMS server and it's database, configuration file, and startup script.

To begin with, I think the start-up script can be better.
I have already made some changes to this and should be finished iwth my testing tonight or tomorrow.
This is the script that lives in /etc/init.d

You are correct in that /var/lib/squeezeboxserver/profs/server.prefs is the main configuration file, but it does not need to live in /var/lib. With my "tweaked" /etc/init.d service start script, we can put it anywhere and I am goign to suggest we put it in /root/.config and that we "tweak" 99-snap so that this gets saved with any other local desktop or system changes when we run 99-snap .... 99--snap may end up creating a physical file called 05-FoxyConfig.squashfs instead of99-snap-squashfs although that is not relevant to where we are heading with this.

So, we now have a single (small) file that contains all of your LMS configuration stuff. While you may change and tweak this, I don't imagine it is something that you will change often once you've set it up, so this makes it ideal to be saved when we tell FoxyRoxy to snapshot our current changes/configuration. So, this then leaves the database files, your add-ons and other "dynamically' changing stuff. Well, these aren't the sort of thing you really want in a .squashfs file or on a Flash based media anyway, so I am going to suggest that these be placed on your USB HDD. We can leave a "blank and un-initialised" set of these files inside the .squashfs file as they won't really take any space on the FLASH drive and as they won't ever be loaded, they won't consume any RAM. The only caveat here is that the USB HDD will need to either be formatted with a native lInux filesystem, or you will need to create another partition on the USB HDD that is a native ext2 or ext3 filesystem. By doing this, the dynamic stuff can change whenever it needs to and it won't affect anything. If you damage the HDD, then just reload the media files again from your original source material and rebuild the database. Easy. If it all goes pear-shaped, you can just copy the "blank" database from /var/whatever_it_is into the new place that the LMS.config file points to and then tell it to rebuild itself.

This is what I am intending to do with miniDLNA. The reason for holding off on putting miniDLNA into FoxyRoxy initially was because I didn't want to have the miniDLNA database in the .sqf, nor did I want to waste space with media files. Then I found a sneaky way to have a tiny database without really adding any files to the .squashfs, so I included it as an example. Before really using it, I would put the database on a real HDD and change the configuration file to use the db on the HDD.

If you're with me so far, then I hope you find this acceptable, because it is what I am doing. I should have a proper system start script for LMS in a day or two and I hope this will work for you.

Cheers
jbv
 
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: Installed Debian Package - How to save in Foxyroxy?

Postby jbv » Thu Aug 30, 2012 12:17 pm

Hi Steen,

I think I finally understand the attraction of LMS.

Previously, to quickly test stuff, I had been trying to play media on the server which it really can't or does not do. While I had messed with LMS on my DLNA TV and a WDLive-TV and also from a Windows client, without a SqueezeBox device, there was no attraction for me and I obviously wasn't using it properly. The fact that I couldn't play anything on the server just added to my frustration.

However, while working out what to do with the LMS config files, cache, add-ons, etc ... I needed to test a bit and used my Windows client as the primary device to test this. What I learnt by playing with the add-ons is that LMS allows you to stream the exact same stream to multiple clients and they are in sync, so if you had multiple devices throughout your house, they will all be in sync as you move through rooms. Stunning stuff - really. It also allows you to drive the clients from the server, so from the server you can change what all or any of the clients are doing. As an added bonus, if you are listening to a radio station (from anywhere in the world) you only have one incoming stream that is fed to all of the clients, which means lower inbound traffic.
It is really quite a neat idea and brilliant little product. It's just a shame that it's a pain in the backside to setup properly :lol:

During my playing, I also created a USB stick with 2 partitions.
The primary partition is FAT32 and this is the one that FoxyRoxy boots from.
The secondary partition (not an extended partition) is best being an EXT4 filesystem.
- Note, you cant use NTFS for a variety of reasons. The secondary partition must be a native Linux partition.

After a bit of putzing around, I worked out that the best way to do this is to put the following on the secondary partition, which in your situation will be a real USB HDD and not a Flash based device.

1) Name the partition FOXYROXY_EXT4
2) Create a squeezeboxserver directory
3) Copy the contents of /var/lib/squeezeboxserver to /media/FOXYROXY_EXT4/squeezeboxserver
4) Create the following directories on the HDD
4a) /squeezeboxdata
4b) /squeezeboxdata/moviesfiles
4c) /squeezeboxdata/soundfiles
4b) /squeezeboxdata/playlists

Now we need to start playing with things like the "conf" file and the /etc/init.d startup script.
I have put all of these into a single .tar.gz file that you will find below.
squeezebox-tools

Drop the .tar.gz file into /tmp then with XFexplorer, right click and unpack it into /tmp/squeezebox-tools
Browse each directory and if you have a different partition name or structure you will need to change a few things (sorry, I can't see them now)
When you've done that ...
Navigate to /tmp/squeezebox-tools/scripts and open a "terminal/console" screen from within XFE.
Then run ./20-load which will load the SqueezeboxServer .sqf into /tmp/sqf/lms

Copy all of the stuff from /tmp/squeezebox-tools/scripts into the appropriate place in /tmp/sqf/lms
Be careful with permissions.
Then run ./20-save which will update the SqueezeboxServer .sqf in [b]/live/image/live/b]

Kick it in the guts and you should be right.

Take backup before you do anything.

I would really like to leave LMS with you now. Please take a while to play with what I have given you. Look at the scripts, be careful of permissions and I think you will be right. If you want to make notes back here, please do so. When you've got it sussed, perhaps you can let us know what the ulitmate setup is and how we get it.

Quick word of warning. I couldn't get LMS to actually read any (video or audio) data files from the EXT4 filesystem. I don't know if it is/was a permissions thing or a glitch in LMS. I hope you can work that out and let me/us know.

Cheers
Attachments
squeezebox-tools.tar.gz
squeezeboxtools.tar.gz
(5.7 KiB) Downloaded 228 times
jbv
 
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: Installed Debian Package - How to save in Foxyroxy?

Postby SBP » Thu Aug 30, 2012 1:30 pm

Hi jvb.

Thank you for your comprehensive explanation - I now have a better understanding of how it all works.

It is fine with me to save the database on the USB-HDD. The only issue is the need for a ext2 or ext3 formatted HDD. This is something I think a could make some people think twice about the use of FoxyRoxy. Most USB HDD's is formatted by a windows OS.

Is it possible in anyway to make a script that let FoxyRoxy make a small partition on the HDD that is ext2 formatted, and possible leave any content on the HDD intact?


Regarding the LMS and its use.
I see a use for LMS on a FoxyRoxy computer to serve music to Logitech clients.
But it is also possible to have a small headless linux computer with a client installed. This little client computer could be a low-power consuming Dockstar, a ShevaPlug or a small Raspberry Pi computer http://forums.slimdevices.com/showthrea ... y-Pi/page2 . Most often the player used for this is not the Softplayer I gave you a link for, instead it uses SqueezeSlave which is a very small client without any GUI it is CLI only http://forums.slimdevices.com/showthrea ... 2-released .

Then you connect this little client to your HiFi and then play your local music files (FLAC, MP3 etc) net based radio, spotify or WIMP etc. This little client can be hidden anywhere as you don't have to physically interact with it.
You probably would like to control what is playing by the use of a smartphone based controller app (both Android as well as IPhone apps are available), some are free other costs a little. http://code.google.com/p/android-squeezer/ or the official App http://www.androidzoom.com/android_appl ... _vmgm.html . It is also possible to control the client from the LMS if you don't want to use a smartphone.


By going this route you have a hardware which will play your music with very high quality, and you even don't have to purchase any Logitech equipment at all - so it can be done really cheap. If you have more of these small clients either connected to your HiFi or using powered loudspeakers or a small amplifier you can choose to listen to the same music at every place (in sync) or different tracks - all controlled by either your smartphone or a computer through the LMS web-page

Regards
Steen
SBP
 
Posts: 74
Joined: Thu Aug 16, 2012 5:27 am
Location: Denmark

Re: Installed Debian Package - How to save in Foxyroxy?

Postby jbv » Thu Aug 30, 2012 10:05 pm

Hi Steen,

It is important that you understand the reason for requiring an EXT type partition is not a limitation of FoxyRoxy, it is more to do with the way that LMS requires special permissions and the simple fact that a Windows FAT filesystem can not store permission information. It would be possible to fix this within LMS, although it is not something I have the time or inclination to do. Especially when there is an easy solution.

Yes it certainly is possible to have two partitions on the one USB HDD, and this is exactly what I did with a USB Flash stick to test/prove that it was working.

I would not script the creation of a EXT type partition for a number of reasons. The best way to do this would be to use GParted which can be found in the [TaskBar Menu] --> [Administration] Of course, you would need to make sure that the disk was empty or that the files were backed up elsewhere before touching this, as any data on the disk will be lost/erased/wiped/deleted during the partitioning process.
Warning: The disk will be empty after you use GParted so make sure you have copies of all of your files.

I would create a big FAT32 partition as the first partition.
This is where the audio and video files would live.
You could easily copy files to and from this partition with any computer using either Windows or Linux.

I would create smaller EXT partition as the second partition.
This is where the LMS configuration and database would live
Basically, this will become the replacement for /var/lib/squeezeboxserver
I don't know how big this partition would possibly need to be. I guess it would largely depend on how much data you end up with.
If the HDD was a decent size, I might start with say 100-200Mb - To be safe, perhaps even as much as 500Mb - I really don't know.

In my testing, I gave the Partition a Label of FOXYROXY_EXT4
I then copied all of the files from /var/lib/squeezeboxserver to the new partition.
This then gave me a full set of files in /media/FOXYROXY_EXT4/squeezeboxserver
I then edited the copied file "server.prefs" and changed all paths in "server.prefs" from /var/lib/squeezeboxserver to be /media/FOXYROXY_EXT4/squeezeboxserver. I also made sure that the new squeezeboxserver directory had the right ownership permissions.
I then changed the paths for PREFSDIR and CACHEDIR in the /etc/init.d/logitechmediaserver file to point to the new FOXYROXY_EXT4 location.

I also created squeezebox_data directory in the EXT partition, to hold playlist data.
I then put all of the actual audio and video files on the FAT partition
Doing it this way, there are no problems reading/writing/copying the audio or video files from either Windows or Linux and the Windows machine would not even see the EXT partition. Of course, you could also share the data directories in that partition using samba and you could then use your Windows machines to read/write/copy data files to/from the LMS server while the LMS was running. That is how I got the files onto the stick.

If I was doing it again and for real, the only thing I would do differently would be to use a different label for the EXT partition.
I would probably use something like LMSdata for the partition label.

Anyway, please keep us updated as you play and progress with LMS.

Cheers
jbv
 
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: Logitech Media Server

Postby SBP » Sun Sep 02, 2012 8:49 am

Hi jvb

Thank you once again for your enormous help on this topic, I followed your instruction step by step and I now have a working LMS - FoxyRoxy computer.
The only problem I had, was with the data directories on the ext3-formatted USB stick, which I plan to use for this purpose only. After a reboot the LMS server was not running. I checked the log files, and there was something about being unable to write to the directories, then I checked the permissions, and remembered that I needed to change these to "squeezeboxserver" and "nogroup" - after a reboot it is working fine, and it can even be controlled by my smartphone. So all-in-all it is working better than what I had before (it feels more responsive).

During the set-up of this system, I really understand and appreciate the time and dedication you have invested in this - so thank you.

Steen
SBP
 
Posts: 74
Joined: Thu Aug 16, 2012 5:27 am
Location: Denmark

PreviousNext

Return to Other Stuff



Who is online

Users browsing this forum: No registered users and 1 guest

cron