Play music on command line

January 19, 2011 at 12:53 am (Audio / Video, console based, linux apps, Linux codecs) (, , , , , , )

There are many popular audio players for linux; to name a few they would be XMMS, audacious, amarock . But all of these players are GUI-based; and they does not feel like ‘home’ when you are so addicted to using the command line. So i did some searching on possible options, and i found many. I’m only listing two of the best here, mplayer and Music On Console (Player) or MOC. The command line players have the advantage of less crashes, less usage of resources, playability in CUI only OS’s, remote logging to play sound files on a remote machine. The MPD (music player daemon) server can stream audio using any sound output server to a remote machine.


Music on Console (MOC or MOCP) (homepage)

moc player

MOC 2.44 running on my fedora 14 (64 bit)

The MOC has a decent UI for a CLI program. Consists of two panes, one displaying the music files in the current directory and the other showing the current playlist. Play stats and tag info are displayed in the bottom, with the progress bar. Navigation within playlist and song can be done using keyboard. It’s updated support for pulse, OSS and alsa output.

Installation

for debian based sytems use, sudo apt-get install moc

for rpm based systems, it is unlikely that moc would be on the repository. Try yum install moc and see. If that’s the case, we need to compile from source which can be downloaded from this link. You would need following packages

for mp3 support: yum install libmad-devel libid3tag-devel

for wma,mp4,aac,ra support: yum install ffmpeg-devel (This caused a compile error due to ffmpeg-devel relocating its .h files .. so please don’t do this if you know how to use linking). To activate support for other codecs, see README.

then decompress the file, go to the folder and type usual

./configure && make && install as root to compile and install. See my article on compiling from source for more information.

After installation to run, type

mocp <filename>

press q and type mocp -x to end program. Otherwise the server will still be running 🙂

Mplayer

mplayer

Mplayer running on console

This doesn’t need much introduction; which is as my perception is the best multimedia player ever, which can play videos too. Apart from the gmplayer (or mplayer-gui), the mplayer command can be used to play music on command line, with showing in depth info. Mplayer can play any audio file, it’s heavily stable and takes less resources. You can see my previous post on mplayer.

to install,

sudo apt-get install gmplayer (for debian based systems)

yum install mplayer-gui (for rpm based systems)

Advertisements

Permalink Leave a Comment

Fedora 11 – The buggiest fedora ever

July 3, 2009 at 2:58 pm (1, Linux News) (, , , , , , , )

Fedora 11 is the buggiest of the Fedora clan but it doesn’t mean it’s bad. As my opinion it’s the best Linux Distro… Most of these bugs were due to the fact that I have out-dated hardware!

My fedora 11 Gnome desktop ... Nothing new fron FC9

My fedora 11 Gnome desktop ... Nothing new fron FC9

I have mentioned why I decided to upgrade from fedora 9 to 11 in my previous blog article. So here I’m almost after a week ……. wonder what happened? I was fighting the bugs which were found to be ultimate challenge and test of stamina after I started using Linux. For 3 days, I was hopeless as I was unable to see even the desktop! But problems did not end there for me… There are still some unsolved mysteries even with after upgrading bug-fixes. You should understand that I’m kind of addicted to Fedora, so whatever happens I would be using her just hoping that bug-fixes will arrive in time, and the next Fedora 12 would be somthing brilliant like Fedora 9. (Still, i think Fedora is the best as it comes with cutting-edge tech which is why actually these bugs come)

On last Saturday, after writing my previous blog, I first decided to upgrade from version 9 to 11. I saw the warnings on others who tried it, but as I have upgraded 7,8 to 9 it didn’t come new to me. So I upgraded which took 4 hours, and when restarted it shows GRUB all over the screen where GRUB should be loading. Like this:

GRUB GRUB GRUB GRUB GRUB GRUB GRUB

So I boot Fedora11 with rescue mode and typed

chroot /mnt/sysimage ‘changing root path to FC11 root

and i opened grub.conf file in /etc and it appeared good, it shows that it had identified the windows OS, and had pointed to correct paths. No problem.

The /boot/grub/device.map file was correct, which says which hard drive is sda and sdb. The file looks like this:

(hd0) /dev/sda

(hd1) /dev/sdb

Hence, (hd0,0) refers to 1st partition on 1st hard drive (ex: sda1) on the grub.conf file, (hd1,1) refers to 2nd partition on the 2nd (ex: sdb2).

So i reinstalled grub with grub-install sdb (as my linux installation was in 2nd hard drive) but didn’t work, but doing

grub-install -–force-lba sdb

did work. Error found to be something to do with the AWARD bios and grub.

So I came to the fedora 11, but upgrade has been buggy. So buggy that it crashes every time. With no choice, I decided to back-up my data and do a fresh install.

So I did the fresh-install using “use entire drive” option, and without changing any details as a beginner would do. When installation was complete, I saw “Error 22” instead of grub upon rebooting. It means that system cannot find the bootloader, which is GRUB. I looked at the files and it seemed like system has detected the drives in wrong #’s. So I did grub-install again, with –recheck and -–force-lba which didn’t work.

So I decide to install again, this time using custom settings for partitions. I used Ext3 for / partition where Ext4 was the default. This did work, finally. Finally I was able to run fedora11. The problem was that the GRUB still cannot identify Ext4 file system, and it gives errors in some systems.

So here I see the desktop, but wrong resolution. So i typed system-config-display on the terminal… but there was no such command! You do have a “Display” applet on System>Prefrences but it couldn’t even get my monitor type. So I installed system-config-display by,

yum install system-config-display

I was soon to find out that i’m becoming a yum addict. This is because programs which used to compile well on FC9, ends up on errors (C syntax errors – you can’t solve those) particularly due to version incompitabilty of GCC and Cmake etc… So a person who haven’t used yum before (me) started doing everything by it!

Upon installing mplayer – my favourite player, I found out that it crashes everytime I open a video! Damn— It did superbly on FC9! Unable to figure out why, I was shocked that even the vlc played buggy and totem too did the same! By this time I knew something was wrong with multimedia drivers — but later found out that it’s a bug of PulseAudio — and again updating didn’t help. Changing to ALSA and OSS didn’t help as they seem “deactivated” although everything I could find on these have been installed.

Anyway, I could get mplayer to run by changing the video output driver from Xvideo to opengl. But it doesn’t give the previous quality. But still up to now, i can’t hear any sound at lmms,hydrogen, audacity and record-sound.

Finally trying to print by IT degree notes I plugged in my HP P1005 laserjet. I saw an improvement than in FC9, it automatically installed driver and software for the printer! But when I sent a document to print… nothing happened.. It says “your printer may not be connected” … what the HELL? I checked the installed drivers and they were 100% correct. I guess this is a bug in new hplip 3 or cups. Still not solved. Printer did well in FC9 where I manually installed hplip 2.8.

Permalink 7 Comments

Installing linux players on fedora.

November 2, 2008 at 1:50 pm (Audio / Video, linux apps, Linux codecs, Linux installation) (, , , , , , )

This article is about using redhat package manager (RPM) to install Mplayer, xmms player, real player etc… on Fedora and redhat. I hope same techniques can be used for Suse and Mandriva.

For each of the given names of packages  below visit www.rpmfind.net or rpmsearch, and copy and paste the package name.

===============================================================================================

edit on 19/01/2010

Now it is much easier to install programs using yum and apt-get than from installing from the source. If you have set your repositaries correctly, following should work.

for  installing both mplayer and vlc player

p { margin-bottom: 0.08in; }

sudo apt-get install gmplayer vlc (for debian based systems)

yum install mplayer-gui vlc (for rpm based systems)

The information below were written two years ago and pretty much deprecated by now. 🙂

================================================================================================

Indentify your architecture (for pentium, dual core, C2D, athlon XP it’s i386 (x86); for 64-bit it’s x86_64. Learn more about RPM’s on my “Managing RPM’s” blog on linux installation category (This post may be pending). For example, you have p4, fedora9 and you want xmms, you choose

xmms-1.2.11-1.20071117cvs.1.fc9.i386.rpm note fc9 tag and i386 (if no tag is there, or noarch is there, you can choose for any architecture/fedora version).Package name with FC9 i386 compitable link as example.

1.Mplayer

mplayer-1.0-0.44.rc2.fc9.i386.rpm

2.Realplayer

http://www.real.com/realcom/R?href=http://forms.real.com/real/player/download.html?f=unix/RealPlayer11GOLD.rpm (for all fedora dist, any arch)

3.Helixplayer

HelixPlayer-1.0.9-2.fc9.i386.rpm

4.xmms player, for this you need

xmms

xmms-1.2.11-1.20071117cvs.1.fc9.i386.rpm

xmms-mp3

xmms-mp3-1.2.10-16.fc7.i386.rpm

continue with xmms-wma, xmms-skins if necessary xmms-libs

5. Gstreamer-ffmpeg

gstreamer-ffmpeg-0.10.5-1.fc9.i386.rpm

for mp3 for gstreamer use fluendo codec (google this to find a downloadable link)

for installing RPM’s, type in command line

su –

passwd:(Enter your pasword here)

rpm -ivh (rpm file) example:

rpm -ivh /home/malshan/HelixPlayer-1.0.9-2.fc9.i386.rpm

if no dependency errors found, now you’ve got program installed. Right clicking on a file on your explorer and saying to open with this program automatically sets that type of file with the program.

enjoy!

If any errors found, please reply.

sudo apt-get install gmplayer (for debian based systems)

yum install mplayer-gui (for rpm based systems)

Permalink Leave a Comment

Adding A/V support for linux: Install Mplayer

November 1, 2008 at 6:14 pm (Audio / Video, Linux codecs) (, , , , , )

This is for Mplayer installing: x86 based PC on Linux

mplayer running on FC9, gnome

mplayer

Many people are talking about cannot getting videos or sounds to play on linux. (except for ubuntu new)
Even if you have installed codecs, you should really go for this player: It can even play with win32 codecs; just need to drop in to folder!

go to http://www.mplayerhq.hu/design7/dload.html to check it out

download from
http://www.mplayerhq.hu/MPlayer/rele…1.0rc2.tar.bz2
untar it using your archeive manager (open- and drag and drop where you want to copy)
go in to the folder in command line (termina/console) and type

./configure –enable-gui

if no errors found (if you get dependency errors you’ve to install them first — look the list down)
then type

make

this takes about an hour ——- wait and hope for good luck — program is being compiled from the source code………
then if it’s completed without errors, then go admin in command line
su –
passwd: (enter your admin passwd here)
(NOTE: you can always type “root” as username and passwd at linux login screen to be admin from the start-if you are not familiar with command line-so you can use normal GUI to copy files without permission problems.)
type:

make install

will install mplayer to every user but, without codecs
download codecs at
http://www.mplayerhq.hu/MPlayer/rele…071007.tar.bz2
untar it as i said before, and copy the codec files (not the folder) in to
/usr/local/lib/codecs, if no codecs folder exist, create one. (hope you know to use cp and mkdir commands)

now goto the codecs path and type (as admin/root)

chmod ugo+rwx *.*

now you can type

mplayer filename

to play anyfile!
ex: mplayer *.* will play all files in directory.

for the gui; use gmplayer instead
in order to GUI to work, you need skins, download this:
http://www.mplayerhq.hu/MPlayer/skins/Blue-1.7.tar.bz2
untar it,
and paste the whole folder
/home/(your user name)/.mplayer/skins
or
~/.mplayer/skins (as normal user, not admin)
go inside the folder and use chmod as before (as admin)
enjoy!
If need more help, please reply.
I’m using fedora 9 (and not windows)

dependencies:
If configure says your machine not having something — you can just ignore them if they are optional
or else goto www.rpmfind.net search and type it there to find what you want (for Suse, mandriva and fedora only)

Check for my “Compiling Linux apps from source” page for more help. 

Permalink 5 Comments