Friday, 29 April 2011

Ubuntu 11.0.4 (Natty Narwhal) The Good, The Bad and The Unity




















So, Ubuntu 11.0.4 is out, so I decided to upgrade one of my laptops that was running 10.10. The laptop in question is an HP nc4400, Core2Duo 2Ghz, 2.5GB RAM, and a 120GB hard drive. Ubuntu 10.10 notified me of the new release and asked me whether I'd like to upgrade. However I thought I'd check if there was any updates for 10.10 which is advisable before upgrading. lo and behold for there was a large batch of updates ready, surprising really since I only did updates a few days ago. Clicking on Upgrade now then starts the usual upgrade process. It would be nice if they made that prettier since it uses the Root user's theme which is quite ugly. Since I was upgrading over wifi, the downloads took awhile. Ideally I would have used ethernet but then I couldn't sit in a comfortable sofa!


upgrading to Natty:



















Eventually it finished upgrading and I rebooted to the login screen. I thought I'd give the now default Unity desktop a chance so I logged straight in and was greeted with what looks OK at first glance but doesn't seem to work as smoothly as it should.


Unity:



















All the application icons that I previously had on my desktop's lower panel have been crammed into the Unity dock, along with quite a few that I don't use that often so I had to remove a lot. One by one. Next I opened my usual set of apps, Pidgin and Hotot, Firefox and a single nautilus window. Nautilus goes full screen, blocking everything else out of view. If feels like a phone or a tablet, how am i supposed to multi-task with every window trying to go fullscreen? I dread to think how I'd use it on a dual monitor setup. And with window previews enabled the Unity dock reminds me of the Windows 7 taskbar, but even more confusing. None of this is helped by various graphical glitches that kept occurring (top left):


Unity graphical glitches:




















After around 30 minutes or so with Unity, I'd just about had enough, so I thought I'd try 'Gnome Classic'. Only one problem though, presumably due to bugs, I could not find the logout button or any other way to log out and I did not want to force a shutdown, so i had to kill Xorg. Not good. So I logged into Gnome Classic (which you can select at the GDM login screen) and that's what I using now. It's more familiar and usable and I think they should make it the default rather than Unity, which as far as I'm concerned should be reserved for tablets, and isn't ready for prime time. Not sure on the 'good' side of things with this release, other than unity it's pretty much like 10.10, at least in the time I've used it so far. it does have Firefox 4 and LibreOffice by default and which is a good thing, though I already had both installed. Also the Software Center has been tweaked a little with app reviews. Disappointingly, Canonical have done a KDE4 with this release, change for change sake. If they drop Gnome2 in the coming releases, I think I'll install the Xubuntu desktop (sudo apt-get install xubuntu-desktop) and if that runs OK I'll use that, if not I'll go back to 10.0.4 LTS on this laptop and recommend that for new users too. Perhaps by the time the LTS stops being supported they'll be other options or Unity will get more stable or be abandoned. I may also try Gnome 3 and the latest KDE4 and see how well they work.

Gnome Classic:


















Update 29/04/11 Fresh install on a Toshiba M200

Since there were some graphical glitches with Unity I thought I'd try a fresh install on a different laptop, my Toshiba M200. Everything went fine during install, took around 10 minutes, all was well until i rebooted. Firstly it seems to have a weird bug. When i reboot all I get is pretty colours and no proper boot screen and cannot see the login, just weird patterns. If I shutdown then do a fresh boot it boots an reaches the login just fine. However even after I installed the proprietary Nvidia drivers, it still won't login to Unity desktop, it just hangs. Also if i try to CTRL+ALT+F key into another screen it goes white or just weird colours. That just will not do. Unity-2D works (sudo apt-get install unity-2d) but it's not exactly much consolation.

gggg

Tuesday, 5 April 2011

How To Setup Music Player Daemon With PulseAudio On Ubuntu 10.0.4





















I've been wanting to get Music Player Daemon aka MPD working in Linux for a long time but never got round to it, but today I got it working properly with PulseAudio! The main reason I like MPD is it's actually gapless unlike most other Linux media players (I'm looking at you Rhythmbox, Banshee, and other Gstreamer based players). Also you can fully control MPD from over a LAN via other MPD clients, even from a mobile phone.

Setting Up MPD

With a lot of Googling, I've found a lot of different tutorials on getting MPD to work in Ubuntu. It seems on a desktop PC it's easier to setup MPD as a user service rather than a system service. i could not get it working at all as a system service. I based my setup mainly on this tutorial and updated it for 10.0.4 / Lucid and modified it to fix problems with PulseAudio. This should also work in 10.10 and higher too. Although you can do some things with graphical installers, apps etc, it is far easier to write down commands to copy and paste into a terminal.


First install MPD:

sudo apt-get install mpd


Disable MPD from starting as a system service:

sudo /etc/init.d/mpd stop

sudo update-rc.d mpd disable


Extract and copy the default config file:

gunzip -c /usr/share/doc/mpd/examples/mpd.conf.gz > ~/.mpdconf


Edit the config file:

gedit ~/.mpdconf

Change all paths to point to: ~/.mpd. You need to change the following entries:

music_directory
playlist_directory
db_file
log_file
error_file
pid_file
state_file


Audio setup

At this point I needed to adjust the audio config and modify it slightly from that tutorial to make it work with PulseAudio, (I found the right config for Pulse output here). Find the audio_output section and comment out the alsa section (which is first up in that section) then add:


audio_output {
type "pulse"
name "My Pulse Output"
#server "localhost" # optional
#sink "alsa_output" # optional
}


Make MPD start at login:

In a terminal do:

sudo nano ~/.config/autostart/mpd.desktop
and paste this into it:

[Desktop Entry]

Encoding=UTF-8

Version=0.9.4

Type=Application

Name=Music Player Daemon

Comment=

Exec=mpd

StartupNotify=false

Terminal=false

Hidden=false

Then Ctrl+O to save it and Ctrl+X to exit. Now it should start upon login


Modifications:

I also changed 'user' to my Ubuntu username and I've also enabled (uncomment the relevant lines) zeroconf, replaygain and volume normalization. And also it wouldn't bind to localhost so I changed bind_to_address "any".

And here is my resultant MPD config file (gzipped for convenience). now run MPD by typing 'mpd' into a terminal. If it shows no errors and then disappears (it runs in the background) then all is well.


Finding and playing music:

Next you need to add your music directory, I found it was best to create a link (right click your music folder, select 'create link') and move the link into /home/username/.mpd/music

Now we need an MPD client, Ario and Gnome Music Player Client both run fine in Gnome but there are plenty of choices. Next we need to update the database, in Ario do File, Update Database and we're done. Most of the players I've found so far use an Artist / Album / Title setup which is handy for playing single albums, but I am searching for an easy way of just dumping the entire collection into one playlist and whacking it on random. I've tried using the file system browser in Ario but when I try to dump all the tracks into the playlist it only seems to find less than half my collection. Update: I've discovered that MPD is quite picky about tags so it's apparently best to use EasyTag on your collection which automatically corrects broken tags. Since I have quite a it of music, this may take awhile! Next thing I want to get working is streaming music over the network!


NOTE

Confusingly the MPD wiki states:

"mpd.conf
is the configuration file for mpd(1). If not specified on the command line, MPD first searches for it at ~/.mpdconf then at ~/.mpd/mpd.conf and then in /etc/mpd.conf."


Update: you may need to do "chmod g+X /path-to-music" on your music collection to give it the right permissions.

Update2:  I'm still having trouble with MPD seeing only part of my collection