I've posted earlier about an attempt to create a media server using an old Asus EEE 701 netbook. Since then a second laptop from the growing family computer collection (don't ask!) has become available for recycling - an IBM Thinkpad T40, which is obviously a considerably more powerful machine.
This led to the plan of setting up the T40 downstairs, connected to the TV and with the whole music collection moved onto its 80G drive. Because the T40 has an S-Video output, it can be directly connected to one of the TV inputs and this now allows us to watch stuff on iPlayer that we forgot to record on the PVR (which, of course, now only has Now/Next functionality, see earlier post).
[what a marvellous invention iPlayer is. I am reminded of the wonderful passage in one of Douglas Adams books where the protagonist invents a time machine so he can go back and watch all the TV programs he forgot to record - now we have exactly that, thanks BBC....]
The home theatre 5:1 system only had a spare digital audio input free, but that's easily fixed with one of Maplins low-cost (about 20 quid) USB audio devices, which has both 3.5mm stereo outputs and a standard optical out, and requires no drivers (it also works just fine on Linux, by the way).
So that was the easy bit, but then, what to do with the EEE. Well, the bedroom stereo would really benefit from being able to access the downstairs music collection, so obviously turning the EEE into a little satellite would be ideal. This turned out to be a little more complex than I had anticipated.
The first step was to blow away the standard - and now very old - Linux distribution that the machine runs out of the box and put a copy of Ubuntu 10.10 on there. This was quite simple; instructions are widely available on the net but basically it's a case of grabbing a 1G (or larger) USB key, and formatting and copying down the ISO using a free utility. Then boot the EEE off the USB key and install Ubuntu.
Note that you won't see the USB key as a bootable option unless you plug the key in, start the machine, go into the BIOS and fiddle with the boot settings. This caused some confusion because there is a 'removable device' option in the boot order that initially looked like it would be the USB key. Anyway, once that's sorted, Ubuntu installation is reasonably painless, except that the dialogues don't all fit on the EEE's screen. This is only a minor inconvenience; to get at the buttons to continue during installation use the left mouse key and ALT to allow windows to be dragged around the screen to expose the clipped bits.
Ubuntu flawlessly recognised the wireless interface and audio, and at this point it was a simple matter to decide which media centre software to use.
The plan was to access the downstairs box via an SMB/CIFS share. To do this, you need to install SMBFS using APT-GET or the Synaptic program manager GUI, and then you need to set up an entry in /etc/fstab to get the share mounted at boot time. This is fairly well documented on the net, so I won't bother repeating all the steps here.
I would note that setting everything up as a static IP address seems to be simplest. I found that otherwise, my Windows boxes could ping each other by host name but both the EEE and my Android phone couldn't resolve the IP addresses, even though the local Dlink router is supposed to be providing DNS services to the local subnet. The Windows boxes presumably resolve names using Netbios over TCP and there is an optional component for Ubuntu - Winbind - that supposedly provides the same functionality.
I did experiment with it but found that strangely, ping would now resolve the IP address from the hostname, and display it, but then the ping would fail.
In uninstalling both XBMC and Winbind using Synaptic, somehow, Ubuntu got completely screwed up and would only boot to a text command prompt, so at that stage I cut my losses and reinstalled from scratch and settled for fixed local IP addresses. This also simplifies the Android phone connectivity.
Once this was done, I had a directory under my home directory called 'music' which gave me access to the SMB share on the IBM T40. Next, I installed media player software. Since I wanted to remote control the player from my Android phone, this limited my choices somewhat.
Initially I went with XBMC, but there are two significant problems with it. Firstly, it's quite resource hungry and audio glitches were common. At first I went looking for all sorts of other causes, as the CPU, while high, wasn't at 100%, but ultimately it became apparent that XBMC is just too much for a low-end box like the EEE. The second XBMC annoyance is that if you want to use VNC to remotely connect to the EEE from another machine, the XBMC interface is incredibly slow due to all the gratuitous animation and stuff, that AFAIK can't be disabled.
It was a pity because the XBMC remote software which I installed on my Android phone worked very well. On a more powerful box I'm sure XBMC would have worked well.
So I switched to VLC. This uses a lot less CPU and played audio perfectly. And the VLC remote application for Android works very well - it also has a volume control, something that the XBMC remote did not have.
Setting this up involves going into preferences and specifying VLC as a startup program with the command line
/usr/bin/vlc -I http
This enables the HTTP interface. Note that the default directory that it always starts at is the users home directory, so mounting the SMB share directly underneath it (or symbolically linking to it) will ensure that the music folder is immediately accessible.
All was well.... or was it.
It became clear pretty quickly that if the VLC remote volume setting was any greater than about 25%, serious distortion was evident in the audio. This led me on a wild goose chase for a while, and unfortunately exposes a weakness of Open Source solutions - the lack of decent documentation. As a consequence all sorts of contradictory advice float around the net. I discovered that if I installed alsa-mixer I could see an additional slider for 'PCM' which also controlled overall volume, and supposedly, setting this to less than 100% would solve the problem. It did not. During the investigation I also found that the slider settings aren't saved and restored during a reboot, although there's a way round this. But, as I said, this turned out to be a dead end.
I also tried an external USB audio interface (I have two of the Maplin units) but this didn't help.
Then - suddenly, for no obvious reason - audio stopped working. Although, oddly, the 'test speaker' option in Ubuntu still worked. Eventually I managed to fix it by shutting down VLC completely, rebooting without it set in startup, running Rhythmbox and playing something - this seemed to fix the problem, but I have no idea what went wrong.... sigh!.
The solution to the distortion problem - it turns out - is to enable VLC's graphic equaliser. This is also not entirely obvious, but the trick is to stop the HTTP-enabled copy (which, remember, was started at boot time) and start up a normal copy of VLC with the UI visible. Then go into preferences, enable the advanced option, go into audio filters and select the graphic equaliser and set the gain to 0 (it is otherwise +12dB). Then type in ten 0s separated by spaces for the fader gains i.e
0 0 0 0 0 0 0 0 0 0
then save this and go back to the main VLC UI and enable the graphic equaliser. Turn it on. Now shut down VLC and restart it and go back into the equaliser and verify it is enabled.
Finally restart the HTTP-enabled VLC and confirm that the problem is now resolved. Why VLC does this in the first place, I have no idea.
At this point another problem raised its head. The VLC remote doesn't seem to cope well with two scenarios that the XBMC remote software has no issue with. This is, to be honest, most likely a problem at the HTTP server end rather than with the remote software itself.
The problem is that you will get a fatal XML error in the remote application if either:-
(a) you have a lot of albums in your music folder. A few hundred seems to be the limit. I had more than this, so the easy solution was to break them up into subfolders labelled A-F,G-K and so on, which also makes looking for something quicker.
(b) The filenames contain certain non-standard characters such as international accented characters etc. The solution is to rename troublesome files. Quotes are also a problem. Still, while tedious, this only has to be done once.
And that's it. Now I can access my entire CD collection from any computer in the house, plus two of the three stereo systems (lounge, bedroom) the other being in the kitchen. I need to pick up another EEE second-hand for that. They seem to sell for around 50 quid on eBay which makes them excellent value - this, after all, gives you a complete wireless media server and is far cheaper than the dedicated, very expensive solutions you can purchase from places like Richer Sounds. And your mobile phone acts as the remote. Sweet!. Now, if I could only find a mobile-friendly interface for iPlayer. Currently my only option is to use Android VNC, which is extremely awkward when controlling the full screen of the T40. I'm sure there's a better way, just haven't found it yet. (i.e, some kind of mobile-optimised interface which would show a list of programs with a simple search and then let me start it playing on the T40 in fullscreen mode, with some transport controls.
EDIT: I found that I still had the occasional dropout, for which the cure appears to be to specify a reasonably large cache buffer time using the --file-caching command line variable, and in this case I specified a 5 second cache, which seems to be working fine i.e the command line to run at startup becomes
/usr/bin/vlc -I http --file-caching 5000
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment