Ubuntu+squeezeserver+Squeezeplay - plea for an idiots guide

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Ubuntu+squeezeserver+Squeezeplay - plea for an idiots guide

Post by Jarv_77 »

All,
My aim is to have all my music on MP3s on an external harddrive, linked to the Joggler which is linked to my HiFi.

I currently have the standard OS running PnP Slim/Squeeze/Logitech server and Birdslikewires Squeezeplay with the external harddrive attached and a usb soundcard.

This all works fine until about every couple of days I select a tune in squeezeplay only for the software to be unable to 'find' the file - even though it had it on the menu screen. This usually results in a reboot and a rescan on the server software which takes hours for the 6000 odd mp3s to be scanned. This is a pain!

I am now thinking, maybe the Slim/Squeeze/Logitech server from PnP is the cause of the problems and is just a bit unhappy. Maybe I should go the Ubuntu route and install an up to date version of the Logitech server which has more chance of coping?

I have BuZz's page here http://joggler.exotica.org.uk/ubuntu/ for reference.

It looks like the Btrfs Ubuntu version would suit me best? I did a Stephen Ford [sp?] type install in the early days of owning my Joggler and was impressed that a) it worked! And b) it was usable. However to get the mp3s set up I went back to PnP.

Can anyone please give an idiots guide to setting up my Joggler with Ubuntu+Slim/Squeezeserver+Squeezeplay

I am aware that the answers might be in the forum somewhere but I’m just getting lost in the detail and need simple guidance.

To add to the above I have some other questions on the Ubuntu set up before I proceed.
- Would I use the external usb soundcard still?
- When running Ubuntu what does the screen do when not running squeezeplay, can I set up a clock as per the original OS or a blank screensaver as PnP option?
- How would I control the squeezeserver software – I assume the IP address:9000 is for PnP and Ubuntu will show it onscreen?

Thanks for all this if you can help with a simple guide.... :)
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by BuZz »

to just quickly go over the ubuntu questions:

External soundcard should work fine.
You can use the build in screensavers in squeezeplay or exit squeezeplay and use the gnome/xscreensaver. squeezeplay may well have a clock - someone else might need to confirm. there are not many decent fullscreen clock screensavers for xscreensaver though.
you control the squeezeserver software from a browser. it's pretty simple to install - you can just install the prepackaged debian package. and yeh port 9000 is the default.

if running ubuntu off an external drive, then use the ext4 version. btrfs does still have free space issues (possibly some new issues again related to free space introduced with 3.1.x kernels).

i wonder btw if your problem is related to somehow the external drive getting unmounted so the files are not found. or the server starting before the disk is mounted in some cases. you could probably make the squeezeserver start later, or get the usb disk mounted earlier. are you currently adding it to fstab, or relying on the joggler os to automount it ?
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by gegs »

BuZz wrote:... squeezeplay may well have a clock - someone else might need to confirm...
Squeezeplay does indeed have a selection of digital / analogue clock screen savers. The clock can also kick in if you switch off (but don't exit) Squeezeplay.
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by Jarv_77 »

BuZz wrote:i wonder btw if your problem is related to somehow the external drive getting unmounted so the files are not found. or the server starting before the disk is mounted in some cases. you could probably make the squeezeserver start later, or get the usb disk mounted earlier. are you currently adding it to fstab, or relying on the joggler os to automount it ?
BuZz, thanks for your responses.
In discussion a while back with spoyser on this forum I have used the script at the bottom of this post to delay the starting of squeezeserver until the harddrive is mounted. Perhaps this is still causing issues and could be refined or there is some other reason why the drive is getting 'un-mounted'? The ext drive does spin down on its own to save power and wear and tear, maybe if that happens too much then it unmounts?

Meanwhile I have been experimenting with Ubuntu in a virtual consol on my windows xp laptop just to get to know it. I managed to load logitechmediaserver via a debian method, and also squeezeplayer from Roobarbs site. I'm compliling a list of the guides and reference I am using so perhaps I can post my own idiots guide one day.

The instructions I followed to delay starting up of squeezeserver until the usb drive had mounted (with thanks to spoyser) were:

edit the squeezeboxserver startup script.

enter vi /etc/init.d/boot.d/S98squeezebox.server

Move the cursor to the line that starts /media/gforums/apps/blah blah

Press i followed by #
Move to the start of next line down (sleep7) and type #
Move to the start of next line down (echo rescan blah blah) and type #
Then press esc followed by : then x then enter (this exits and saves the file)

Now you need to edit the rcS file, so start by

vi /etc/init.d/rcS

Move the cursor to the end of the very last line ends ,/blctrl)& make sure the cursor is under the & press a then press enter twice, now type the folowing 4 lines, make sure you get it all absolutely correct,

cd
/media/gforums/apps/squeezeboxserver-7.6.0-31297/slimserver.pl --daemon
sleep7
echo rescan | /media/gforums/busybox nc -w1 localhost 9090


(you should notice these are the same as the lines you commented out of the original startup script)

now hit esc, followed by : followed by x

finally type reboot, your joggler should reboot and that should be it.
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by BuZz »

Jarv_77 wrote:The ext drive does spin down on its own to save power and wear and tear, maybe if that happens too much then it unmounts?
spinning the drive up and down causes wear and tear. Hoping it is not a desktop drive, as they will be able to do this much less than a laptop drive, but even laptop drives have limits (although may well be some hundreds of thousands, so not an issue if it is not spun up and down too much)
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by Jarv_77 »

BuZz wrote:spinning the drive up and down causes wear and tear. Hoping it is not a desktop drive, as they will be able to do this much less than a laptop drive, but even laptop drives have limits (although may well be some hundreds of thousands, so not an issue if it is not spun up and down too much)
BuZz, I might not have been clear, it is an external drive by Western Digital like this:
http://www.amazon.co.uk/gp/product/B002E7HEVU
with 'power saving features' so it can idle when not in use.

I suppose if it is the drive causing my problems then whether I use Ubuntu or stock OS, logitech/squeezeserver may struggle.

Thanks

David
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by BuZz »

Jarv_77 wrote: BuZz, I might not have been clear, it is an external drive by Western Digital like this:
http://www.amazon.co.uk/gp/product/B002E7HEVU
with 'power saving features' so it can idle when not in use.

I suppose if it is the drive causing my problems then whether I use Ubuntu or stock OS, logitech/squeezeserver may struggle.
i am aware of hds and power saving features. I'm just making you aware, that they have limits on the number of times they can spin up/down and doing it often isn't always a good thing (depends how often of course).

pastebin me output of "smartctl -a" on ubuntu and ill tell you how many times your drive is rated for.
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by BuZz »

to add smartctl might not work on that drive. depending on the controller (http://sourceforge.net/apps/trac/smartmontools/wiki/USB)
if you know the hd that is inside, we could look it up anyway.
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by Jarv_77 »

BuZz, if you will bear with me, I'm a newbie to this.

Using
# df -h
I determined that my external drive reference is: /dev/sdb1

I tried the smartctl -a /dev/sdb1 command but as smartctl 'wasn't found' I assume it needs to be downloaded first?

I looked it up but cannot see how to install it onto my Joggler, there seem to be versions for different architectures....?

If I do get the smartctl to work will the information help in any way determine why Squeezeserver seems to lose the drive? or will it simply help understand the number of cycles it can spin up and spin down in its lifetime.

Thanks for your patience...
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by BuZz »

it was just to peek at which hd you got that's all. not important. I guess you ran that on the native os anyway, not on one of my dists as that would have prompted it to be installed.

Don't worry about this anyway, but if you can delay the squeezeserver more, and disable the spining down, that might be useful.
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by Jarv_77 »

Going off topic here but then I started the thread......

I have been looking into this drive spinning down scenario and think it might be the cause of my squeezeserver woes. It would appear that a number of people have experienced external USB drives spinning down as part of their 'power saving' in-built software but then not waking up again when required and effectively dissappearing from mnt.

Now, whilst there are probably some clever and involved remedies for this, I have found a few people who have created code to copy a dummy file on the hard drive every minute or so to prevent it sleeping. Crude but apparently effective.

Following one of these people here: http://ask.metafilter.com/36580/Why-won ... isk-access

The chosen solution was a line of code in crontab:
OK, here's what seems to be working. At my brilliant wife's suggestion, I made a small text file called .stayalive (98 bytes) in the root directory of the HD. I then made a cron job that runs once a minute and touches, then copies this file to a new file called .stayinalive. That's it! Specifically, here's the line from /etc/crontab:

* * * * * root touch /mnt/media/.stayalive; cp /mnt/media/.stayalive /mnt/media/.stayinalive
So, I thought I would try this to pin point the problem.

Trouble for me is that when telnetting into my joggler I cannot seem to issue any commands that i need.
# crontab -e
returns "-sh: crontab: not found"

A bit more digging and....
# sudo apt-get install cron
returns "-sh: sudo: not found"

A bit more digging and.....
#apt-get sudo install
returns "-sh: apt-get: not found"

Help!
The /bin or /usr/bin foders do not contain these commands, how can I get them to try out this fix?

I'm running stock O2 Joggler.

Thanks.

David.
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by BuZz »

you can't. i mean you could do it without those commands, because there may well be some system cron jobs running etc, or you could do it via a daemon, but I can't really give you instructions for the built in OS, as I don't run it, and I think you should familiarise yourself more with linux as it will help.

if you boot into xubuntu on a usb stick, we could find out perhaps if the usb hd controller is spinning it down, or if it is the drive itself, that maybe could be disabled (although it might need to be connected directly to a pc to do that, not via usb). the instructions you are referring to would work on a full ubuntu install also.
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by Jarv_77 »

BuZz, you are right I do need to get more familiar with Linux.

I'm back to my original plan of sorting out Ubuntu+squeezeserver+Squeezeplay on the Joggler. I think this will be best for me and it will allow me to get involved in more Linux.

You recommended in a post above that I use the Ext4 version of your Ubuntu software for booting from a USB flash drive. Your web pagehttp://joggler.exotica.org.uk/ubuntu/ lists three different versions, Ubuntu 11.10 (Oneiric), Xubuntu 11.10 (Oneiric) and Ubuntu 11.04 (Natty). What are the differences and which is best for me?

Once I am up and running with Ubuntu then I will be keen to bottom out the hard disc problem, if it is a problem.

Thanks again.

Edit 1 - when booting from the USB (11.10 oneiric ext4) I get an error that I need to load the kernel 1st.???
Edit 2 - seems to be to do with having the usb stick on a hub. Will search the forums.....
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by Jarv_77 »

So... It seems that there may be two issues.

1 - I might need to try a different USB stick as some are a bit unhappy in the joggler (I used a kingston 4GB, previously a Sandisk 16GB has worked for me with Ubuntu so will try that.)

2 - I might need to change the grub.cfg file to ensure that the boot is from the USB with the Ubuntu image. This I believe is to prevent problems with my set up which has the Ubuntu image USBStick in a USB hub together with a USB soundcard and connection to the WD External Harddrive.
It has been mentioned that I would need to change hd0 to hd1 but maybe someone could explain why this might work. I assume hd0 would be the onboard memory? and hd1 an external drive?
Also I see that the grub file is set out with a fallback option which I assume is to guide the system to a second-choice of drive if the first boot fails?

For reference:
I tried my USB Ubuntu Image drive plugged directly into the Joggler and Ubuntu fired up apparently ok-but then I wouldn't have connection to my external harddrive....
I tried my USB Ubuntu Image drive plugged into the USB hub alone then to the Joggler. This booted but had limited functionality, I couldn't open terminal for example but could operate the top menu bar to shut down.

Thanks

David
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by Jarv_77 »

Still having issues.
Managed to get Ubuntu to boot from usb whilst also plugged into usb hub with harddrive.
Didn't change grub, just used different usb stick.

Have loaded logitechmedia server and squeezeplay, but now squeezeserver doesn't recognise the harddrive in /mnt to scan for tunes. Even though in the file explorer, it can be seen.

Any thoughts?
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by BuZz »

did you mount the drive? ubuntu won't mount the drive on /mnt automatically.
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by Jarv_77 »

BuZz,

I confess I got confused with the mounting aspect. I thought I would need to mount it but then read something on a guide that said disks would auto mount on Ubuntu.....

However checking my sources again now https://help.ubuntu.com/community/Mount/USB I see that it actually says disks will automount in /media and so I would need to mount them manually in /mnt I guess?

So, now I'm confused, do I need to do simply this:
(with reference https://help.ubuntu.com/community/Mount )

find my device - probably something like /dev/sdb1,

Code: Select all

sudo fdisk -l
then mount it:

Code: Select all

sudo mount /dev/sdb1 /mnt
OR this:
(with reference to https://help.ubuntu.com/community/Mount/USB )

find my device - probably something like /dev/sdb1,

Code: Select all

sudo fdisk -l
create a mount point:

Code: Select all

sudo mkdir /mnt/usbext
and mount the drive:

Code: Select all

sudo mount -t vfat /dev/sdb1 /media/external -o uid=1000,gid=1000,utf8,dmask=027,fmask=137
The second half of that line seems to have more information than I need as a single user on my Joggler?


Having done one of those it should be mounted in /mnt I assume?

but which one.... and why. Very basic knowledge I'm sure but difficult to find clarity on the web.

Thanks


Questions:
How do I make it mount there automatically at boot? SHould I fiddle with /apps/nautilus/preferences/media_automount.
as the above webpage suggests or will this purely prevent it automounting in /media.
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by BuZz »

how is the drive formatted? if it is fat32, the last line is good, as it means the joggler user will have the access. to mount boot, you could add it to /etc/fstab - have a look at that file and do man fstab for more information. basically you put the mount options there - im sure someone has a guide for that
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by Jarv_77 »

Thanks BuZz,

I need to check the disk formatting but I'm pretty sure it is Fat32. It is full of back ups and photos saved ther from my windows laptop. But more importantly it has a folder of MP3's which is what I want squeeze/logitechmedia server to find.

Looks like this will do it then?

Code: Select all

vi /etc/fstab 
add the following:

Code: Select all

/dev/usbext1 /mnt/usbext vfat rw,user,auto,sync 0 0
and save.

Thanks to this helpful explanation..... http://www.tuxfiles.org/linuxhelp/fstab.html

Setting myself up for a failure but......maybe Linux isn't so hard?? ;)

While I'm writing, going back to the issue of running Ubuntu from a usb flash drive in a usb hub - at the same time as having the usb hard-drive plugged into the same hub. It seems very inconsistent in being able to find the Ubuntu files and booting happily or freezing at an error screen regarding loading the kernel. Should I be modifying grub to smooth this out?

Thanks
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: Ubuntu+squeezeserver+Squeezeplay - plea for an idiots gu

Post by BuZz »

if you like vi, then sure. you might find nano easier (sudo nano)

for fstab you want

Code: Select all

/dev/sdX1 /mnt vfat uid=1000,gid=1000,utf8,dmask=027,fmask=137 0 0
where /dev/sdX1 is your usb drive partition. dont think you need sync, auto, user. man mount/man fstab to get info on those options. basically user allows user to mount. could be used with noauto, so you mount later. auto is the default anyway. rw means read/write but that's the default anyway afaik
Post Reply