CLI and Console Audio

I seldom carry an external mouse with me when I use my laptop and I don’t use my touchpad. Never have, never will. It’s one of the most ridiculously engineered products ever. I primarily use GNU screen in the console to run applications simulatenously and then just page through terminals. I rarely start X on laptop, and I use ratpoison when I do.

One of my bad habits is listening to music while I work, even when my battery is running low. I was experimenting with several multimedia applications to see what uses the least RAM and the least CPU cycles.

I have several sound applications on the laptop. DSL comes with mpg321 and ogg123, which are CLI tools for mp3 and ogg files (as well as streaming audio). I also use mp3blaster, a console application that provides a curses interface to manage tune selections and sound levels, etc. And I have a python front-end for mpg321 and ogg123 called cplay.

I decided to do a quick and dirty test on these three to see what my best choice is. I already know my own preference. I was hoping for validation. I was wrong.

First up was raw mpg321 run from symlink. Here’s the relevant text I copied (another reason I love screen):

—————————————————
CPU[|||| 8.6%] Tasks: 19 total, 2 running
Mem[||||||||||||||||||||||17/122MB]…

1146 dsl 14 0 1480 1480 1276 S 7.9 1.2 0:03.06 mpg123…
—————————————————

I was surprised that my CPU was running up to 11% while using mpg321. Since cplay is a front end, I knew it would perform similarly (if not “worse” since it uses python). So I quit mpg321 and fired up the same playlist with mp3blaster. Here’s what I saw:

—————————————————
CPU[|| 1.0%] Tasks: 22 total, 2 running
Mem[||||||||||||||||||||||18/122MB]…

1147 dsl 9 0 3508 3504 1552 S 0.0 2.8 0:00.06 mp3blaster…
1148 dsl 9 0 3508 3504 1552 S 0.0 2.8 0:00.00 mp3blaster…
1149 dsl 16 0 3508 3504 1552 R 0.4 2.8 0:00.34 mp3blaster…
1150 dsl 10 0 3508 3504 1552 S 0.1 2.8 0:00.02 mp3blaster…
—————————————————

It was much lighter on CPU cycles and used up more RAM.

I was expecting the curses-based app to use more CPU cycles than the CLI tool. I was wrong, but now I know which app will buy me a few more minutes on my battery charge. Good job, mp3blaster.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: