image_alt_text

8

Feb/10

MediaTomb DLNA To Playstation 3

Monday, February 8th, 2010

Overview

I found the Video plugin for MythTV 0.21 to be inadequate for streaming to the Sony Playstation 3. It didn’t update fast enough when you dropped a video into the UPnP directory and also there was no external way of telling it to refresh it’s list of files without starting up Myth Frontend.

MediaTomb

MediaTomb is a UPnP server which can run as a standalone or as a daemon. It uses an XML configuration file for it’s settings (pretty neat stuff) and is pretty small in size. The software comes with it’s own web server so you don’t have to install a full apache install to get to the control panel and it uses SQLite by default so no big database backend to be installed.

Install & Configure MediaTomb

Install MediaTomb and ffmeg thumbnailer
sudo apt-get install mediatomb ffmpegthumbnailer
That’s it for the install!

edit the file config file in /etc/mediatomb/config.xml and change the following settings:

Enable PS3 support change this:

<protocolInfo extend=”no”/><!– For PS3 support change to “yes” –>

to

<protocolInfo extend=”yes”/><!– For PS3 support change to “yes” –>

and also

<!– <map from=”avi” to=”video/divx”/> –>

to

<map from=”avi” to=”video/divx”/>

Add the line
<pc-directory upnp-hide="yes"/>
below
<webroot>/usr/share/mediatomb/web</webroot>
so that it looks like this
<webroot>/usr/share/mediatomb/web</webroot>
<pc-directory upnp-hide="yes"/>

This hides the full directory path from the Playstation so it can only view the directories added and not the full system.

Add the following to enable thumbnail previews. I have found this does not work 100% of the time.

Enable transcoding
<transcoding enabled="no">
to
<transcoding enabled="yes">

Add the following transcode mappings under <mimetype-profile-mappings> tag:

<transcode mimetype=”video/divx” using=”video-thumbnail”/>
<transcode mimetype=”video/mpeg” using=”video-thumbnail”/>
<transcode mimetype=”video/mp4″ using=”video-thumbnail”/>
<transcode mimetype=”video/x-ms-wmv” using=”video-thumbnail”/>

Add the following settings between the <profiles></profiles> elements. Not the parent is plural and each profile is singular.

<profile name=”video-thumbnail” enabled=”yes” type=”external”>
<mimetype>image/jpeg</mimetype>
<accept-url>yes</accept-url>
<thumbnail>yes</thumbnail>
<resolution>128×128</resolution>
<agent command=”/usr/bin/ffmpegthumbnailer” arguments=”-i %in -o %out -s 128″/>
<buffer size=”524288″ chunk-size=”512″ fill-size=”1024″/>
</profile>

Restart MediaTomb service sudo /etc/init.d/mediatomb restart If it fails to restart then double check the config file for errors.

Go to the machine in a web browser on port 49152 e.g http://localhost:49152

On this web page configures the directories available over UPnP. The Database section shows what directories are visible / registered to MediaTomb and Filesystem shows the computer directories that can be added for DLNA / UPnP visibility. When a directory is added MediaTomb scans the directory and register them so they show up on the Playstation. These can include music, videos and pictures.

In the top right hand corner there is a plus “+” with two arrows around it. Clicking on it loads a new page in the main window, replacing the file lists in the directory. This is the page for setting how often it scans for changes.

Go to the Playstation, turn it on and go to the relevant category e.g photo in the menu. There should be a MediaTomb server in the list. If it does not appear go towards the top and scan for more media servers to look for MediaTomb.

Summary

The software is pretty self contained but I would have liked the option to use Apache and MySQL because those are already installed on my system.

MediaTomb does the job for now and whilst I cannot get the thumbnails to work on all the media it still does a brillant job of streaming the media to the Playstation. Unfortunately it’s not integrated into MythTV so records will still have to be done via MythTV but this is not a problem because all recorded TV shows are registered in the database.

A problem I did encounter was that I added multiple directories but reguardless of where they reside on the computer, all videos appear in one directory on the Playstation. I’m not sure if this is a bug or how it’s suppose to work.

[HOWTO]:Stream DivX/XviD to a PS3 with firmware 2.10 using MediaTomb and Ubuntu 7

11

Jan/10

WordPress Incorrect Username / Password With VSFTP

Monday, January 11th, 2010

I was getting an error logging into my FTP/SFTP server via WordPress when I tried to upgrade a plugin or two. It was saying the username / password was incorrect yet I was able to log in using an FTP client.

I checked all my config settings for both VSFTP and Apache but ended up restarting both services which made it work. I did not see any errors in VSFTP logs and no relevant entries in Apache. One those strange occurrences I guess.

21

Sep/09

MythWeb Database Access Denied

Monday, September 21st, 2009

I recently had to re-install my Linux computer after a lot had screwed up (mainly my fault for experimenting with stuff).

Database Access Denied

When I check MythWeb I got the Message “MythWeb Database Access Denied” with some more text below. MythWeb is very important to me and the reason was the web config had the initial password which I changed for my install. Edit the file /etc/apache2/sites-enabled/mythweb.conf and find the line “setenv db_password” and change the text after to the correct password. Save and close the file and restart Apache sudo /etc/init.d/apache2 restart

8.04 – Mythweb database access denied Forum Post

22

Jul/09

Ubuntu Music Streaming Server – Ampache

Wednesday, July 22nd, 2009

Overview

I wanted a music server for personal use so that I can access my music collection remotely or locally. A web front end with the ability to stream to various players would be key. It had to run on my Ubuntu system.

I do not / this article does not condone the use for piracy in any way.

GNUMP3d

GNUMP3d is a GNU music server. It is in the Ubuntu 8.04 repository and includes it’s own light weight server (good and bad points to this method). It’s all self contained so it does not require Apache or a database installed to run it.

The web front end is very basic with only text on the web page but has the ability to record statistics. Being a basic music server it does not support album art but it does have a lot of themes built in. All settings are changed in the config file but cannot be changed using the web front end. This means starting up SSH to even change a small setting like your chosen theme.

It runs on any system which has perl installed. The problem I had with this set up was the lack of user authentication. It had a “weak” and basic method of using a .password file which can be placed in the root of the music directory but this support was removed in the new version because it was “weak”. I do not want my server to be publicly accessible (that’s just asking for trouble). I went ahead and removed it.

Ampache

Ampache has more weight to it than GNUMP3d. It requires a web server, PHP and MySQL (Not tried it with any other database). It supports tags and album art, There is also an option for lyrics but I have yet to see this in action.

The music server has many options including different playlist formats:

  • M3U
  • M3U Simple
  • PLS
  • ASX
  • RAM
  • XSPF
  • And also different streaming formats like shoutcast as well as different playback methods. The best part about Ampache is the built in flash player. Just like the BBC Radio player it opens a new window with the player and controls.

    The web front end allows you to create and modify playlists, upload, download, and find duplicate music files. Ampache has built in access control level (ACL) which is basic but it works.

    There are only 2 themes included and last.fm plugin. The non default theme is “pretty” but I find the font to be too small and there is no way of changing it. It has statistics and recently played songs which are bonus features.

    Pre-Requisite To Ampache

    Install Apache and MySQL if not already done so:
    sudo apt-get install apache mysql
    When prompted, enter the root password.

    Ensure Apache is up and running by typing http://localhost in a web browser. A message saying “It works!” should appear.

    Optional:
    Install MySQL Administrator to easily maintain the MySQL database:
    sudo apt-get install mysql-admin

    The following steps are beyond the scope of this how to:
    Connect to the database using your root account (using MySQL Admin).

    Create a username and password for Ampache as well as a schema. For remained of this post I will user the username=Ampache and password=password using the database schema Ampache.

    Ensure the Ampache database user has all privileges to the Ampache schema.

    Install Ampache

    Download the latest Ampache from Ampache.org/”>http://Ampache.org/ In my case it was 3.5.1
    wget http://Ampache.org/downloads/Ampache-3.5.1.tar.gz

    Extract the compressed files:
    tar -xzvf Ampache-3.5.1.tar.gz

    Move (and rename) the directory Ampache-3.5.1 to the web directory (by default in /var/www). Depending on where you want to access Ampache will depend on where you move the directory. Do ONE of the following:

    For Ampache to appear in the “root” directory e.g http://www.dannytsang.co.uk move all the files in Ampache-3.5.1 to /var/www:
    cd Ampache-3.5.1
    sudo mv * /var/www

    For Ampache to appear in the sub directory e.g http://www.dannytsang.co.uk/Ampache move all the files in Ampache-3.5.1 to /var/www:
    sudo mv Ampache-3.5.1 /var/www/Ampache

    Ensure you have got your Ampache files in the place you want to access them. I had to re-install it because I kept the directory as Ampache-3.5.1 which made it http://www.dannytsang.co.uk/Ampache-3.5.1/
    To re-install I have to remove the file /etc/apache/config.d/Ampache and go back to the beginning to copying the file.

    Next step is to ensure the file permissions are set correctly. For method one:
    sudo chmod -R 774 /var/www

    For method two:
    sudo chmod -R 774 /var/www/Ampache
    sudo chown -R root:www-data /var/www/Ampache

    Head over to http://localhost or http://www.localhost/Ampache and follow the on screen instructions to install Ampache.

    Post Install

    Everything else can be configured from the web interface with the exception of the music directory. Where ever you want to add music to Ampache, you have to make sure it has at least xx4 (read) file permission otherwise the Apache / Ampache will not be able to see the file. If you want to allow Ampache to manage files e.g upload new music files to your library you will need to give it write access too. The best way to deal with this is to add www-data to your username group. Either way I do not recommend allowing write access for security reasons.

    Review

    Ampache Login Page

    I intend on using the server whilst I’m not at home e.g abroad or at work. I can listen to all my collection without carrying it around with me and now my iPhone has more juice. I only use my iPhone to listen to music when I’m not in the office or listen to podcasts.

    The reason why I won’t use it for podcasts is because it doesn’t have speed playback and no bookmarking feature which allows you to resume from where you left off.

    Flash Player

    The Flash player was usable. It showed a dark grey buffering bar and a light grey bar for the currently playing track. A good visual of how much has been downloaded from the stream. All the tracks for the current play list is shown along with the album art cover (nice touch).

    WMP Player

    M3U streaming to Windows Media Player (WMP) worked very well. It too showed the album art and this method I could use the media keys on the computer.

    Both players had reasonably good quality but the flash player lacked settings to adjust the buffer rate. The problem with both methods was the buffering. Not only did it need to buffer for each track but it had to re-buffer if a song has already played – something common to streaming media except for QuickTime.

    WMP did lack the track titles until it got to the track itself. All it shows is index in the play list for the track if it hadn’t gotten to it yet.

    I suffered a lot of pauses from the flash player because it had to buffer a lot through random moments through the day. However, WMP also had it’s buffering problems too but I could set the buffer limits to cope. When this happens I had to turn to the player to see what was going on, distracting me from work.

    Ampache Track List

    Playlists can be a powerful tool but in this case it’s pretty simply use. There is a current playlist which you add you tracks to. You can save this list determinately as one playlist which adds a date time stamp and your username. You cannot rename it to something more useful. The current playlist can be formed of multiple store playlists as well as adhoc tracks.

    Ampache supports tags and track ratings. Ratings can be changed online too. It includes the usual filtering and sort of tracks by artists and albums as well as search.

    Adding libraries are fairly easy. You give it a directory path and it will index the given path. Libraries may exist locally or remotely. Options to update, clean, etc will automate management of songs.

    Ampache ACL

    Working with Ampache User Access Control Level (ACL) was easy but may be too simple for power users. It has a drop down of all available groups for a given feature. The bad part is it assumes that any group above the selected group also has access to that feature. I believe it does not allow you to add new groups either.

    Summary

    Ampache is a good but media server. As always the user interface could be tweaked and a lot more plugins and features can be added e.g HTML 5 player, uPNP but that’s like asking for the world. The set up was very easily to do and does all the basics I want.

    GNUMP3d Website

    Ampache Website

    26

    Dec/08

    VPS Hosting With CheapVPS

    Friday, December 26th, 2008

    Overview

    During the past couple of months I have noticed my site ( as well as other things) have been going down unexpectedly. The server running at home was getting on now (first purchased in 1997 as a desktop PC and changed to a headless server in 2002/2003) and it has held up very well in the past. The time has come to off load some of the services it provides.

    Decision For VPS

    I decided to move the LAMP stack (well the AMP part of it) to a VPS as an interim solution till I can fix or solve my availability issue with the server. The website was the most separate part of the server and does not need to be local with in the network (unlike CUPS which provides the network printer access). I went on the recommendation of Toby Weston and went with CheapVPS. They were fairly cheap and used various technology like HyperVM and OpenVZ which were mentioned in TLLTS podcast episode 278. Since the VPS was going to be a temporary solution till I got things sorted out I went with the cheapest option which gave me the following specs:

    • 128MB RAM burstable to 256MB
    • 2.4GHz processor
    • 10GB HDD space
    • 150GB bandwidth per month

    I thought the above specs would be fine because the server it was running on now wasn’t that much more than what they were offering with the exception of RAM which had 192MB (1×128MB + 1×64mb). There were a variety of Linux distributions on offer too.

    Ordering From CheapVPS

    I went ahead and filled out an order form for a VPS. I requested the lowest plan (as quoted above) and wanted Ubuntu 8.04 on it.

    After submitting the order I realised how manual the process was going to be. I got an automated mail saying my order was to be processed and have to wait for another email to confirm / pay for the VPS. Why couldn’t I pay for it with the order request? Not long after I submitted my order I had to wait for the VPS to be set up. This part took the longest. From the time I submitted the order till when I got the email to say it was set up took almost 24 hours. One thing I noticed was how the web interface to the virtual machine uses a different login user name to the account for paying off invoices.

    Set Up & Install

    HyperVM On CheapVPS

    HyperVM On CheapVPS

    I went ahead and set up some repositories (it only had one in the source file) and proceeded to install my LAMP stack. I was impressed with the minimalistic install they had installed. It barely took up 500mb let alone the 10GB quota I had. This did have it’s draw backs. It lacked almost everything but the bare essential software. It didn’t even have wget but it did have bash, vi and apt-get. The install was fairly easy with apt-get install. My first problem was Apache 2. Every time I started the service it would bomb out. A check at the logs showed it couldn’t create worker threads. A quick Google and help from Toby got this problem solved by installing a lightweight module using the command:
    apt-get install apache2-mpm-prefork
    MPM prefork replaced the multi threaded process management with a single thread style used in Apache 1.3.

    Once that was done I went on to install PHP 5 and it’s related Apache module. PHP did not give me any trouble. The last thing in the LAMP set up was MySQL. This proved to be a bit of challenge because after it had installed and started things started to get noticeably slower.

    CheapVPS uses HyperVM to manage your VPS. It showed that my RAM had shot way above what I was allocated. Even with MySQL service stopped, Apache still took over 124MB of RAM. This was not good. Another round of Googling ensued and found that MySQL provides different configuration files to reduce the memory usage.
    I made a backup of the normal my.cnf file and moved a copy of the cnf.small to /etc/mysql. After starting the service I kept an eye on the memory usage. It increased it over my 128MB but less than 256MB burstable. I did not want to run it in this state and have CheapVPS on my case that I was constantly using more than what I paid for so I requested to upgrade my plan to the next one up which allowed me to have 256MB and 512MB burst RAM. This revelation was shocking and makes me wonder how my old server handled it for all these years.

    The upgrade did not cause me to lose my current set up. It was painless but yet another manual process.

    Through my set up I did rebuild the VPS when I encountered the problem with Apache. The rebuild was very impressive. It had rebuilt my VM within less than a minute before it was up and running again.

    Speed & Bandwidth

    The VPS has fairly fast connections and is hosted in UK (with US as a selectable option as well). I have noticed slow downs in my VM and think I may need to keep watching it for when this happens. I did have everything set up before but it was not rendering the website very well and none of the pictures were loading. A reboot later and it was fine.

    Plan & Pricing

    I believe the plans offered are reasonable for their price. I’d like to be able to spec up my own VM like what you can do with building a custom computer with Dell and adjust the price of the plan accordingly. CheapVPS do offer discounts for purchasing longer term and the management of payment for the VMs is very easy to do with their web interface.

    CheapVPS Ticketing System

    For all communication to CheapVPS it is done via their ticketing system. This is a nice way of capturing all enquires because you can see previous messages and it was asynchronous. I did not like the way the order had to be processed through this system considering Amazon has an automated process for ordering their web services.

    Future Plan

    I am looking to make my set up a lot more lean. I am liking the speed and ease of a VPS and might even consider not replacing the server.

    CheapVPS website
    HyperVM home page