Sunday, January 20, 2008

Compiling VLC for Streaming Music

Compiling media players from source are perhaps the most problematic and most confusing among most linux packages, given the vast number of dependencies required, and the different choices of codecs to choose from, with some of them just competing sounds and video libraries that provides similar features, adding to the confusion, making it an exercise not for the faint of heart.

I wouldn't have tried doing it myself, if not for the fact that I felt ransomed by pandora's music service:

1) It's only available within the United States, which luckily doesn't affect me for now while I'm here;

2) The flash player is excruciatingly slow, but more importantly that it causes music to skip uncontrollably when the CPU is under high load.

The second problem is a big issue, given that the player does not return to normalcy even after the CPU load subsides. If I were to do some compilation, or simply just tax X a little bit with some graphical applications, the flash player will start skipping, forcing me to stop and reload it.

I'm not sure what to blame in this case, as it could be the flash player's shoddy programming (which is doubtful, because it doesn't seem to happen to a Mac machine I use from time to time), or it's the flash or other associated libraries provided for linux, or maybe it could be an underlying hardware issue.

Since pandora's flash player high load requirement is the trigger for the problem, and the fact that they do not provide a native player version of it, I had to dump it and look for other alternatives. Fortunately there are still a number of good free internet radio stations around, and it happens that my favourite station, KKSF, does broadcast online, which makes it a plausible alternative to just listen to the music streams direct instead.

Unfortunately, of all the media player software I've installed, xine didn't seem know how to deal with the stream, and mplayer decided to conk out after spewing an error message saying that it required a windows library called 'avisynth.dll'. And after much Googling and trials, they all led to dead ends - none of the touted solutions worked.

Frustrated with my attempts, I've decided to install VLC, given that I had good success with it when playing most media on the Mac. But it turned out not to be as straightforward as I wanted: first of all, the mpeg player library, 'ffmpeg', refused to emerge, and keeps giving me some dubious compile errors.

But it was needed as a VLC dependency, to which is failing to compile because of some missing symbols that weren't available in my older version of 'ffmpeg' I had installed. In the end, I had to keep emerging older versions of 'ffmpeg' until emerge is finally happy to compile. And fortunately, it's a version that is compatible with VLC.

Then comes the tweaking of USE flags. The instructions are available here, and in addition to gentoo's install guide. The instructions given on by VLC's website is still lacking an essential USE flag, at least for me, that left me scratching my head for a while why I haven't got any sound despite the lack of error messages.

Given my experience with compiling mplayer in the past, the problem was easily rectified by the addition of the sound output management library/platform ALSA, so if you aren't having any sound as well, make sure you add the "alsa" USE flag.

Once compiled, I must say that out of all the available players I've used on linux, VLC is probably the most versatile one compared to xine and mplayer. But I'll give my overall preference to mplayer, given that it is strictly command line based, and looks better than the GUI versions. I do confess that GUIs looked bad because I don't use either Gnome or KDE, and hence the players I compile usually just uses the minimalistic gtk widgets, thus making them uglier than usual.

At least for now, music streaming works, and I'm restored to normal sanity again!

1 comments:

Nazar Lojofiv said...

I wear tinfoil on my head when I am on the internet to prevent the ISP from be able link me to security agencies.

Post a Comment