Monday, April 25, 2011

Parole media player --xv option and display via ati3450

Using Xfce4, I add a couple of media players to my desktop - Vlc and KDE Dragon Player.

On this particular desktop, I want to avoid installing Totem and all the Gnome stuff it might bring with it.

But wanting another media player to try, I visited the Xfce recommended page, and saw "Parole".


Parole and "Could not initialise Xv output":

Right after installing, I tried to run Parole for the first time and hit a snag:


Here is the workaround...


The above reporting 'xv disabled' was accompanied by my Ogg Theora video playback, working just fine :)

Reading the help for parole, got me started but did not really provide enough information on how to use the --xv option.

Trying --xv off & trying --xv disable
...would get you nowhere!!

One advantage of parole being 'Free and Open Source Software' is that you can browse the source code, which is what I did...


Now I am no C expert (although I can get by at a push), but any intermediate programmer, seeing this, would probably have a stab at true and false being arguments to try.


--xv option true and false are persistent switches:

Again this is not so obvious, but a bit of trial and error showed me that you tell parole --xv false, and it remembers this for when you next playback a video.

To clarify: Switch --xv false or switch --xv true as you see fit, and then, play back your movie. Parole will remember your preference between command calls.

Note: You will only have to set it the once, then you should be all set and never have to adjust things again (hopefully).


--xv true being default for Parole - wise or unwise?

The advantage of relying on XV might be improved playback performance perhaps.

The disadvantage is that you might lose some folks who, like me, have a good working X11 setup, but xvinfo output says 'no adapters present'


For me --xv false is the way to go and Parole can then play videos just fine:


( The chap in the fair water ball, wearing Reina, is my nephew )

Now the next section is really very specific and involves me, confirming that, the driver in use for my video card is "radeon".
Skip to the end (Notes and Further Reading) if that sounds like too much.


xvinfo "no adapters present" - first step is to figure out driver card uses:


...and...


From experience I know from looking at both of the above, that my system is using the radeon driver (rather than the "ati" driver, which is also available)

The file /var/log/Xorg.0.log can be consulted on most GNU / Linux systems, to help you understand what driver choices your system made on your behalf.

I understand why /var/log/Xorg.0.log contains the level of detail it does, however if you just want to know which driver is in use, there is a fair amount of stuff to wade through.


Awk to the rescue - some code and gist also:

Here is a simple version, which I enhance further later...

/) ATI/ { count["ATI"]++ }
/) RADEON/ { count["RADEON"]++ }
END { print "lines really ATI count="count["ATI"]"\nlines really RADEON count="count["RADEON"]"\n" }

...and run that Awk code as follows:

awk -F"(0)" -f ati-radeon-xorg-counter.awk /var/log/Xorg.0.log

Above, you were hopefully, creating a file ati-radeon-xorg-counter.awk, from the 3 lines of code I provided, and if all is well, the Awk command might output:


An enhanced version of the awk script, gives a more definitive answer as shown:


...the awk code for the enhanced version is available as a gist here.

...and I embed the gist (fingers crossed) below:



Notes and Further Reading:

Parole relies on Gstreamer, so you might argue that installing Totem might not have required too many dependencies.

Note: The awk Gist I provided above, is little more than a snippet of code, however it does have versioning support, and so by looking in the block labelled "Revisions", you will be able to follow how the code developed from initial test, through to then enhanced version.

Awk is a very powerful tool, and is usually available on every GNU / Linux machine.

Try and play around with the Awk code example I have provided.

Github has support for adding your enhanced version, or forking as you see fit.

    1 comment:

    Nevin Cussen said...

    I am forever grateful to you for this post. First time to linux and trying to get a bittorent client and media player up and running in a crouton/chroot/ubuntu on my new chromebook. took me a few days and -xv false was the last piece of the puzzle. thank you so much!