Archives for the month of: May, 2008

Long time since last post – thought I’d welcome FF3rc1. They are getting there!

Installing Firefox in Debian is not as straight forward as in Ubuntu due to Iceweasel and something about copyrighted (not GNU) firefox logo (or whatever). I downloaded the source from mozilla.com and run Firefox in the directory. So it’s not really installed per se.

Still, Firefox 3rc1 is not half bad! It runs quite smoothly. It also seems to be a little faster than the previous versions.

Advertisements

Jeez – how annoying that system beep is!

As root, do the following:

echo “blacklist pcspkr” >> /etc/modprobe.d/blacklist

rmmod pcspkr

update-rc.d is a command to set and edit the scripts within the different runtimes. For instance – when you make a script which you need to run each time you start runlevel 2 ( default in debian based systems ), you run the command:

sudo update-rc.d script defaults

I have had some trouble with mpd not being able to startup correctly. I therefor removed the startup scripts in the different runlevels with:

sudo update-rc.d -f mpd remove

I now start mpd manually at startup. More on the subject here: http://www.debian-administration.org/articles/28

I thought maybe I would be satisfied with Decibel, and I am quite satisfied. But you got to love the idea of MPD! Along side the required MPC, the command line player, you have everything you would ever need from a simple audio-player.

Setting it up was not straight forward. It is not enough to install the .debs and expect everything to work. You need to edit text-files – configuration files. There is a good Getting Started page on their community wiki. I went for the global option; you may choose to edit and start the daemon as the logged in user or globally. This meant that I edited the /etc/mpd.conf.

How it works

MPD is a daemon, and is a server running on your computer. It runs in the background and does whatever you tell it to. To control it, you’ll need a clientmpd-clients. The simplest one, and really all you’ll ever need, is MPC. You should, however, be familiar with the command-line if you plan to rely on it.

For a GUI-client, I got a tip from Vincent about Sonata. It is lightweight, shows album-artwork, and let’s you easily change the current playlist etc. This might be preferred so that you get visual feedback of what is going on with the music player daemon. It’s your choice.

Of course, you can easily connect to a MPD on a different computer anywhere in the world – maybe I’ll look into that option later.

The first thing you do is define the root of your library – where your music is located. This will be the “/” of your library. Then you create your database – and you’re up!

MPC

CLI MPD-client – Command-line Music Player Daemon-client. All you need! Here are the most common commands:

Add your library to the playlist

$ mpd add /

General operations

$ mpc play|stop|pause|next|prev|volume <0-100>/+/-

Clear the current playlist

$ mpc clear

List your directories – this means artists in my case

$ mpc ls

Now, to list different albums from one artist

$ mpc ls Coldplay

Note: Here you have “tab”-autocompletion, which is very useful! Start writing $ mpc ls Cold and press tab.

Note2: Ben Harper – $ mpc ls Ben_Harper

Now, to add a specific album from an artist, you simply pipe

$ mpc ls James_Morrison/Undiscovered | mpc add && mpc play

Update your MPD database

$ mpc update

Sonata

Pretty straightforward – a graphical client to control your MPD. Quite simple with the most common features.

Keyboard binding

This is maybe the most beautiful thing about a CLI-client – by assigning commands to keyboard-bindings, you can control your MPD with the keyboard. I use LXDE/Openbox, so I only need to add a few lines in my ~/.config/openbox/lxde-rc.xml (rc.xml for openbox) in the <keyboard>-section ( I have used the Win-key ):

<keybind key="W-P">
 <action name="Execute"><command>mpc play</command>
 </action></keybind>
<keybind key="W-S">
 <action name="Execute"><command>mpc stop</command>
 </action></keybind>
<keybind key="W-N">
 <action name="Execute"><command>mpc next</command>
 </action></keybind>
<keybind key="W-B">
 <action name="Execute"><command>mpc prev</command>
 </action></keybind>
<keybind key="W-L">
 <action name="Execute"><command>sonata</command>
 </action></keybind>

Conky

Of course, Conky has built-in support for MPD! Mine looks like this:

${if_running mpd}$hr
MPD $mpd_status
$mpd_artist
$mpd_track $mpd_title
$mpd_elapsed $alignr $mpd_length
$mpd_bar
${endif}

Conclusion

It rocks! Once you have it up and running. I did encounter a few minor problems during setup, and also identified a bug, but I don’t know where the bug comes from. See this post for details.

Well, I have not actually posted that I have tried and installed MPD yet, but I found a bug. Suddenly the cpu usage jumps form around 2-5 % upto 25-30%! This is totally unacceptable!

Bug-report had already been filed, with a proposed tweak. I confirmed the bug, and that the tweak apparently works.

Tweak – fix sudden high cpu usage:

What you do, is add to /etc/mpd.conf

audio_output {
type                    “alsa”
name                    “My ALSA Device”
device                  “hw:0,0”     # optional
format                  “44100:16:2” # optional
}

audio_output_format             “44100:16:2”

This worked for me.

For those following my posts, I have a pretty bare install at the moment, ( Debian Lenny using LXDE+Openbox). So, in my search for a simple and intuitive mp3 player, I came across Decibel (see homepage). It is a lightweight audio-player, with a simplistic layout; a file-browser were you can change the root, and a simple player with added mp3’s.

Also, the plugin-section is growing. Missing the option of closing to system-tray, though.

Stiill, it fits my needs – it will be fun to see how long I will stick with it. For about 6 months now, I have been using mpg123 from command-line – which is actually quite simple and elegant. Mainly because I did not bother to search for a friendly, simplistic gui-audio player like Decibel. But mpg123 works like a charm:

$ mpg123 -Cv files

Exaile also caught my eyes – and I was pretty nice. Also Listen was my main player for a while, but lost interest due to some idiotic bugs (which I no longer can remember) and the fact that the homepage has not been updated for months (years!)…

Back to the topic – Decibel’s got potensial. The most useful plugin I have seen: write current playing song to a text-file. This means I can use Conky to display my current playing song 🙂 I did this by adding

${execi 5 cat ~/.config/decibel-audio-player/now-playing.txt}

I used execi 5 to set 5 seconds delay between the executions (I update Conky every second). The plugin lets you define what it should output to the file. Of course, the standard-plugin-system-tray-notification does this for you.

I installed update-manager on my Debian Lenny today. This installed an update-notifier daemon. I noticed a sudden jump in ram usage.

Top reports of a shared-memory-usage of 8.5 MB,and a total of 11 MB. For a new computer with sufficient resources, this is acceptable. Also on my current laptop ( Dell Latitude 1.8GHz 1MB ram ) this is acceptable on my Debian Lenny install, given that my memory usage is still below 50 MB when no other applications are running besides Conky and Update-notifier-daemon.

The only real gain using the ubuntu or debian update-notifier, is that you get notified whenever there is a repository update on installed packages on your system. Also, the daemon is generally shown in the system-tray whenever an apt-get or update-manager is running (it does so on Hardy Heron, but no so much on my Debian Lenny – go figure…).

On old computers or systems where you wish to save booting time and resources, specifically ram-usage, I recommend running apt-get update as a cron-job or manually, rather than installing the over-resource-hungry update-notifier/update-manager. Synaptic does the same job manually together with apt-get. Notice that you can simply disable the update-notifier-daemon.

Updated

When killing update-manager, and checking memory usage with free before and after, I only free up roughly 3 MB of memory. Not that much. However, I suspect the memory usage will go further down if I remove the installed daemon completely.

I like the update-manager using Debian. This is default in any *buntu install, so you probably have no problem with this.

My problem occurred last night when I tried to launch the update-manager. True enough, the gksudo app was loaded, but nothing happened. I was asked to type in my password again, and again….

Fix

gksu and gksudo needs to look at the same /etc/sudoers as sudo does – you need to initialize gksu to do so. Run

$ gksu-properties

and choose Authentication mode: sudo.

Save, and your gksudo should work.

I have succesfully installed LXDE – Linux X11 Desktop Environment. I have updated the packages in the repo’s from source, and I am now looking at a 45.62 MB ram usage upon startup!

Update: Ram usage after firing up: 39.98 MB ram usage!


From Ubuntu to Debian

My main goal was to use the Ubuntu minimal install as a base/core for the install, but after several attempts and hiccup due to a somewhat unreliable Hardy Heron, I went for Debian Lenny. Ubuntu is based upon Debian, so I don’t think I will loose anything significant.

I started with Debian Etch rc3 network installation cd. This allowed me to only install the base of Debian. I did this by booting with expertgui to get full control. This allows me to choose between su and sudo – the latter being preferred.

Etch to Lenny

I then update my /etc/apt/sources.list and changed Etch to Lenny (stable to testing), and then:

$ sudo apt-get update && sudo apt-get dist-upgrade

You may also upgrade to Sid (unstable) if you like. Now I added the debian repo from lxde.sf.net and installed lxde. Gdm is now added as default – fair enough, though I may change this to Slim. Xarchiver, GPicView and Leafpad are also added.

The Basics

I installed Conky, and compiled updates from latest source (using auto-apt and checkinstall where feasible + dependencies: gtk+2 dev, gettext gnu, pkg-config) ; lxappearance, lxtask. LXtask is based on Xfce4-taskmanager. It is lightweight and gives you some information regarding the running tasks.

I then installed Iceweasel (Firefox), Abiword, Gnumeric, Xchat which caused a long list of added dependencies and installation candidates. It was quite late when I did this yesterday, so I accepted without much thought. I may have to recheck if all of them are necessary.


The result

I now run Debian Lenny with LXDE at a staggering 39.98 MB ram usage upon startup! This is very satisfying! The boot-time is also very fast, despite of GDM as a Login manager. Maybe it’s faster than I initially thought.

However, I believe I have a lot of installed packages I really don’t need. Disk usage is as high as 1.59 GiB. Not a big problem though.

I will have to change my myUbuntu page and iBuntu page to something more fitting – maybe LEX!

The most usefull post: howto configure ‘xterm’.