Monday, February 07, 2011

Savage 2 on R600g

Thanks to a patch from Henri Verbeet, the r600g driver in Mesa is now playing Savage2 as of Feb 7, 2011. The only thing that needs to be disabled is shadows. Everything else seems to look very nice and run very fast even on my rv635 (3650) video card.

I'm using
Kernel 2.6.38-rc3
libdrm - git
mesa - git
xf86-drv-ati - git
Based on Fedora 14

Savage2 on r600g screenshot

Friday, January 28, 2011

Alsa Device Widget

As part of the work to make alsa and pulse audio device selection working. I created a widget that gets a list of alsa devices. I'm planning on extending this to pulse devices as well. Not sure how I want to do this completely yet. But I have some ideas forming.

I think the main idea may be that rather than selecting the mplayer ao device. The user would just pick the device from list and would not need to worry if it was a pulse or alsa device. I plan to have a "Default" option that will use whatever mplayer is either configured for or whatever it detects. That allows legacy stuff to work correctly.


Screen shot, showing the widget with the devices it found on my computer. I have noticed that the order of the devices may change from boot to boot, so I may need to sort the list.

Thursday, January 27, 2011

Alsa and Pulse Output Devices

So over Christmas I got myself a Logitech Clear Chat Wireless Headset. It is a really nice headset for listening to music, and I really like that it doesn't have a cord.

Selecting the headset for audio playback is kind of a pain, you have to go through a couple of menus in pulse and for alsa it is even worse. So I have been experimenting with how can I select this device in Gnome Mplayer using a menu or preference.

After a few hours here and there I have figured out how to get the device lists from both Alsa and Pulse. So I have the foundation set, now I just need to work on integrating it into Gnome Mplayer. The bad part of this, is that it is going to make me rethink sound defaults again. My plan is this..

1. Detect if pulse can be connected to, if not default to alsa playback
2. Get the volume from the sound server (I have existing code for alsa in gnome-mplayer, but for pulse I have it is a test program).
3. Under the audio preference dialog create a new drop down, which contains default and then the list of devices
4. On the plugin preference page, reuse the same data to create a possible different setting (you may want to have webpages play out the speakers, but audio come out headphones)
5. Create a quick select menu under the edit menu if more than one device is found. Using the quick select will require an Mplayer restart of the current media, as it does not have a way to switch outputs that I see via the slave interface.

Now I just need 8 - 10 hours to put this all together...

Monday, November 22, 2010

Making Audio Meter pretty with Cairo

With GTK 3 coming out in a few months, one of the tasks for gnome-mplayer has been to replace the drawing code with cairo, rather than gdk drawing primitives. This gives us several cool features including better gradient support.

Here is a screen shot of the current code.


Side note.. one of these days gnome-screen shot should be fixed to grab compiz window decorations.

Friday, November 12, 2010

Getting the default volume from PulseAudio in C

I have been screwing around with trying to find out how to get the default volume from PulseAudio for the longest time. I finally got it working in a GTK application by reading the pavucontrol applications code. Since this was such a pain for me to find, I thought I would share it.

In your configure.in make sure you have these lines

PKG_CHECK_MODULES(PULSE, [libpulse libpulse-mainloop-glib])
AC_SUBST(PULSE_CFLAGS)
AC_SUBST(PULSE_LIBS)


Then make sure in your Makefile.am you have $(PULSE_CFLAGS) in the INCLUDES and $(PULSE_LIBS) in appname_LDADD. These may vary in your setup, but that should work for automake projects.

The code...

#include "gtk/gtk.h"
#include "pulse/pulseaudio.h"
#include "pulse/glib-mainloop.h"

void pa_sink_info_callback(pa_context *context, const pa_sink_info *i, int eol, gpointer data)
{
    if (i != NULL) {
        //printf("channels = %i\n", i->volume.channels);
        //printf("raw volume = %i\n", pa_cvolume_avg(&(i->volume)));
        //printf("linear volume = %f\n", pa_sw_volume_to_linear(pa_cvolume_avg(&(i->volume))));
        printf("percent volume = %f\n", (gdouble)pa_cvolume_avg(&(i->volume)) / (gdouble)PA_VOLUME_NORM);
    }
}
   

void pa_server_info_callback(pa_context *context, const pa_server_info *i, void *userdata)
{
    //printf("server info\n");
    printf("default sink name = %s\n",i->default_sink_name);
    pa_context_get_sink_info_by_name(context,i->default_sink_name, pa_sink_info_callback, NULL);
}

void context_state_callback(pa_context *context, void *userdata)
{
    //printf("context state callback\n");
   
    switch (pa_context_get_state(context)) {
        case PA_CONTEXT_READY: {
            pa_context_get_server_info(context,pa_server_info_callback,NULL);
        }

        default:
            return;
    }

}

int main(int argc, char *argv[]) {
   
    gtk_init(&argc,&argv);
    pa_glib_mainloop *loop = pa_glib_mainloop_new(g_main_context_default());
    pa_context *context = pa_context_new(pa_glib_mainloop_get_api(loop),"test");                             
    pa_context_connect(context, NULL, 0 , NULL);
    pa_context_set_state_callback(context, context_state_callback, NULL);
   
    gtk_main();
    return 1;
}

Thursday, November 11, 2010

Gnome Mplayer 1.0 is out and whats next

Well now that gnome-mplayer 1.0 is out.. where to from here. I have a couple of ideas that I am working on and basically just lack for time to get them all done.

1. Conversion of gnome-mplayer to gtk3
2. Which means redoing the audio meter widget in Cairo
3. I also am converting the main mplayer control to a GTK Widget in libgmtk
4. Probably spawning libgmlib and libgmtk into their own SVN projects

Why do all this, I'm hoping that by making it a widget it will solve some of the weird GTK positioning side effects that I have to work around. So far I have a basic version of the widget working and it seems decent. I have a test harness working where I can use the media player widget and the tracker widget and have them working with each other.






So that is what I am working on...

Monday, October 25, 2010

More testing on r600g

A few weeks ago I posted about some testing I did with the r600 Gallium (r600g) drivers in Mesa 7.9 on my Radeon HD3650 (rv635) card. Well, I've been keeping up with the testing and all I can say is that it keeps getting better. Today, upgraded some more components (xorg) and did some more testing, with the power settings on high. Lowering the cards power setting to 'med' can drop the FPS by 20-30%.

Current packages installed
kernel 2.6.36
libdrm 2.4.22
mesa git
xf86-video-ati git
xserver 1.9

With this setup my desktop (gnome 2.30 with compiz 0.8.6) things seem pretty smooth. Scrolling seems better in Firefox and other things seem correct. I still have some problems with fullscreen video tearing in flash (10.2.161) videos. But mplayer and totem seem to run fine. Clutter apps still don't work quite right on my machine even though I have upgraded clutter to 1.4. But I think I am down level on some of the requirements.

Testing results
nexuiz-glx, normal settings, 1024x768 windowed, 30fps (about the same)
vdrift, 1024x768 windowed, 30-60fps (this is a big improvement)
openarena, 1024x768, windowed, 50-60fps (no change)
etracer, 1024x768, 25-30fps

What is funny is just having the blogger editing screen open seems to drop the FPS of games by about 30%. So the editor code at blogger needs some help.

Wednesday, October 13, 2010

Nautilus script to create mp3s from video files

Do you ever download a video off youtube and think "gee I wish I had an mp3 of that". Well here is a script for nautilus (the gnome file manager in linux) to help you create that mp3.

Create the file in $HOME/.gnome2/nautilus-scripts

I named it "Convert to MP3" and set the execute flags on the script (chmod a+x $HOME/.gnome2/nautilus-scripts/Convert\ to\ MP3)

#!/bin/bash

in_file="$1"
out_file=`echo "$in_file" | sed 's/\.\w*$/\.mp3/'`

ffmpeg -i "$in_file" -f mp3 -ab 128000 "$out_file"


This script requires ffmpeg to be installed for it to work. Once you install this script you should see a new menu item on the context menu of the files named Scripts if it was not already there, and then you should see your "Convert to MP3" option.


Select any video file, choose the "Convert to MP3" option and after a few seconds (depending on the size of the file) an mp3 file will be created with the same name as the original file. 
Hope you found this useful.

Tuesday, October 05, 2010

Radeon Power Management in Linux

In addition to my desktop computer that has a Radeon 3650 video card in it, I have an Lenovo T400 laptop that has and Intel and an ATI video card in it. I have been using the Intel card primarily as it gives good battery life and the fan in the machine does not run much. With the Linux 2.6.35 kernel being out that supports Radeon power management I thought I would give it a try.

Fedora 13, my OS of choice, currently only has kernel 2.6.34 available. So I went to koji and grabbed the latest kernel source package. I made sure I had the dependencies for building the kernel installed, by running yum-builddep kernel. I then took the kernel source package I had and rebuilt it using rpmbuild --rebuild [kernel src rpm]. This process took awhile, but eventually I got a set of kernel packages. I then changed to the ~/rpmbuild/RPMS/x86_64 directory and ran yum --nogpgcheck upgrade kernel*. Once that was installed I rebooted into the new kernel. I then followed the wiki to enable dynpm. I actually placed the options in my /etc/rc.local file so they were applied on every reboot. The system seemed to work ok, but had a little flashing every now and then do the video clocks changing, so I upgraded the xorg-x11-drv-ati rpm using the same process as I did for the kernel and rebooted again. So far the ATI card seems to be working fine, I still have a few flashes every now and then and the battery life is not as good as when using the Intel card. But the 3d performance is much better.

I have not upgraded Mesa on this machine yet, so it is still using Mesa 7.8.

Friday, October 01, 2010

Mesa's r600g Driver Test Drive

There has been alot of talk about the Mesa driver in Linux. One of the new things that has been talked about as the savior of 3d graphics on Linux is the Gallium technology. This technology is supposed to make writing drivers easier and to allow for much more functionality in the Linux 3d stack.

While I am not a gallium expert, I know enough to build the driver and test it out. So I started with my stock Fedora 13 setup (64bit, Q6600, 8GB RAM). I followed the wiki and installed the Kernel, libdrm, mesa and the ATI driver all from git. It took a little while, but it was reasonable to get going. It really helped that I had built many of these components before when the r600c driver originally came out, so I knew the process.

So after installing all the components I booted my machine and plymouth came up, but GDM was a black screen. So I disabled rhgb on the kernel boot line and rebooted. This time I got a working GDM. I fixed the plymouth problem by running /usr/libexec/plymouth/plymouth-update-initrd.

I logged into my normal desktop and compiz was running fine. I verified that I was indeed running gallium, by using glxinfo.

glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on RV635
OpenGL version string: 2.1 Mesa 7.10-devel
OpenGL shading language version string: 1.20

I then did a few tests with the r600g to see how things were working. glxgears seems to work as did many of the other demos (tunnel, tunnel2, geartrain, dinoshade, etc). All the demos were running right around 60fps, which is the refresh rate of my monitor, so far so good.

I ran IOQuake 3 in a window on my desktop (1024x768 I believe) and averaged around 30fps. With r600c I got around 90fps. So I'm not sure if that is due to the change in mesa to reduce tearing or not.  Vdrift and Extreme TuxRacer both ran at around 20fps both in a 800x600 window on my desktop. That is the fastest Vdrift has ran on my machine. Google Earth also ran quite well even in 32bit mode.

I ran Diablo II via wine in both directdraw and opengl mode and it ran at a solid 25fps for the few minutes I played it.

So far the r600g driver appears to be working decently, I'm sure there are things to fix as it is still in development. But, it appears to be working well.

Tuesday, September 21, 2010

Asterisk in Operation

In my last post I talked about how I got the Openvox A800P card. I found that the card was sharing an interrupt with one of the SATA controllers in the machine. The card would work fine, until the disks on that controller were accessed. So I ended up pulling the card and moving it to a new slot so that it did not share an interrupt. This helped with the majority of the clicking I was getting on the card. But I still had some problems with echoing when I talked on the line. The echo problem was solved by running 'fxotune'. After running this tool the audio quality really improved.

I still get a few clicks every now and then, that I believe are related to the PCI bus. I talked to the Openvox support people and they recommend trying a new motherboard. This is not something I have handy at the moment, so I'll wait on that. I do think that going to pure VoIP phones will help with some of the noise. The VoIP adapter I bought has some of the clearest calls.

Being able to tweak the Asterisk dial plans has really been interesting. It is actually a little trickier that I expected, but once you get the concepts down it becomes a little clearer how to really make it work smoothly.

Saturday, August 21, 2010

New FXS/FXO Card

Well the initial experiments with the X100P card (single line) went well. The card itself was a little flaky, but the overall concept looked good. So I decided to take the plunge and get a real TDM card. I decided on the OpenVox A800P card. This card is a knock off of the Digicom TDM800P, but at 1/3 the cost. I got the card with 2 FXS and 3 FXO daughter-cards. This well allow me to reuse all the phones in the house and several other devices without change and also allow me to run 3 outgoing lines. The card is large and requires a power connector (due to the FXS options). I actually had a hard time getting it into my PC case. Especially with the 3 hard drives I have in that machine. I have a total of 5 drives connected to the machine, so I may need to rethink that layout in the future.

Anyway, again getting the card installed and working was tricker than expected. I followed the instructions on the OpenVox website on how to get the drivers working. They didn't even compile, but it was due to a kernel issue. So I made a minor patch to the OpenVox drivers and then it compiled. Again the dahdi-tools had trouble with the card. I had to force some of the things to work. Hopefully, when I reboot the machine next time it all just comes up. I would think that the hardware drivers would be better than this.

I setup asterisk and I've made a couple of outgoing calls, the call quality seems ok so far. I'll have to test it on a longer call next week to ensure it doesn't drop, this is a problem the X100P card had.

Thursday, August 12, 2010

Desktop Eye Candy

I was reading the post about a good looking desktop by Seif Lotfy on My sexy desktop I really liked some of the things that he had setup but there were others that were not for me.

For example he was using some docks and the mac-ish menu bar at the top. Both of these tools really don't work for me and my daily usage. I also didn't care for the scroll bar in the theme. But I did find somethings that I like.

1. The background - I have to admit the wood background is quite nice.
2. The grey theme and the dark panels. I've been using the grey theme "Inverted" for awhile, so I stuck with that.
3. The icon set

So I used his background


I chose the "Inverted" Gnome widget theme
I chose the "Inverted" Window border
I chose the "Faenza-Dark" Icon set, it can be found here
I chose the "comfortaa" font that Fedora is using, it can be found here there is a Fedora rpm available for this as well, just search for comfortaa. The Droid fonts also look quite nice.

Now it gets a little tricky, but not bad.


Set your panel background color to color name: #716968, which matches the selected color of the title bar of the active window from the theme, keeping the colors consistent.

We set the panel to be a dark color, but the theme has dark text so to be able to read the text on the panel, we need to alter the font color on the panel. We do that by altering the theme colors.

Edit ~/.gtkrc-2.0 and add the following lines. These lines change the dark font color to white on just the panel and the user-switch-applet.

style "panel_color"
{
fg[NORMAL] = "#eeeeee"
}
widget "*PanelWidget*" style "panel_color"
widget "*PanelApplet*" style "panel_color"
widget "*user-switch-applet*" style "panel_color"

Then logout and log back in. And you should get a desktop that looks something like this:



Comments?

Sunday, July 25, 2010

The no-desktop experience

After seeing a couple of posts about the concept of working on a computer without desktop being an active clutter space. I'm going to try running my Fedora 13 desktop with the nautilus desktop disabled.

It is very simple to do, just open gconf-editor and choose

/apps/nautilus/preferences and uncheck the show_desktop box. So I'm going to see how this works for me and if life feels uncluttered afterwards.

Thursday, July 22, 2010

Asterisk PBX - Adventures in building a home PBX

We have a lot of phone lines here that are really a mess to manage. So I've been experimenting with Asterisk. Luckily Fedora has Asterisk in its repository. So I decided to take the plunge and try it out.

The first thing I wanted to do, was to get basic callout working. I found tollfreegateway.com and setup their sip server so I could make US tollfree calls from my Asterisk server. I used Linphone and Ekiga on my desktop to connect to the Asterisk server. Setting up accounts on the Asterisk server was harder than expected due to trying to use one of the guis and all of them having particular limitation. I eventually dumped the GUIs and just modified the .conf files. I got my desktop connected to the local Asterisk server and then called a 877 number. It actually worked. So I had the proof of concept working.

The next step was to get callin working. As I already have several phone lines, I didn't want to add another line via SIP so I looked into an FXO device. These devices allow you to plug a standard phone line into the Asterisk server and have the server accept the calls. I wanted to be cheap about it, so I got a X100P adapter off eBay. I Figured $20 was not bad for a test. I installed the card in my server and for some reason the drivers would not find it. I found that the card required that it have its own interrupt.. geesh, I thought we were done with dealing with interrupts when the ISA bus died. Anyway, I disable the parallel, serial and firewire ports as I don't use them anyway and after that the card drivers started loading correctly. I have simplified this alot, I spent several hours getting this stuff to work and a lot of missteps so far. Challenging but fun at the same time.

Once the drivers were working, I had to configure Asterisk to respond to incoming calls. So I following the directions for editing the extensions.conf file and then I called the system and got prompt to select an extension. I dialed on and my desktop rang. I then setup the dial rules to call the extension I wanted and it worked automatically.

The next step is to get a OpenVox A800P card and configure all my incoming lines properly and make the system work the way I want it to. At $200 for the device it is a significant cost to make this work for a project. But it should make things work better. I also have purchased a couple ATA devices a Linksys SPA1001 and a Linksys PAP2  for adding phone extensions around the house. The one SPA1001 device works great so far. So I might pick up a few more on eBay.

So more to come with adventures in home PBX...

Thursday, June 10, 2010

Laptop Screens

Lately, I've been shopping for a laptop. I would like a model with an I5 or I7 processor and a 14" screen. However, all the of the 14" models have the 1366x768 resolution. This is an absolute disaster for anyone trying to use a computer. My job recently issued me a new laptop that has a 1440x900 screen and this feels really tight. I can't imagine what a smaller screen would be like to work on. My last 14" laptop (Lenovo T60p) has a 1600x1280 screen and it was great. I hate that the screens we are using today are much much worse than the screens we had 5 yrs ago.

So manufactures out there... quit using crappy screen on otherwise decent laptops. Or at least give us the option to upgrade to a decent screen.

Thursday, April 08, 2010

Gnome Icon Theme

It is not often that an icon theme really blows me away, but I found something today that is pretty darn neat.


Any Color You Like 0.8.2

This icon theme which includes a large set of icons for Gnome, also allows you to customize it with different colors or gradients or other neat things. Quit impressive what can be done with this. So give it a try, I think you'll be glad you did.

Monday, March 01, 2010

UPS for Linux / Fedora 12

Can anyone recommend a good UPS that works well with Linux? I've had a few power glitches where I live and would love to suppress a few of those. I've been looking at the APC ones like these.
But so far I cannot decide on which one would be best. I have a server with 5 hard drives in it and I also have my routers plugged in. So I think that I would need about 10 mins of runtime so the machine could properly shutdown.

Comments?

Thursday, February 25, 2010

ANNOUNCE gnome-mplayer and gecko-mediaplayer 0.9.9.2

gnome-mplayer and gecko-mediaplayer 0.9.9.2 have been released

gnome-mplayer:
http://gnome-mplayer.googlecode.com/files/gnome-mplayer-0.9.9.2.tar.gz

gecko-mediaplayer:
http://gecko-mediaplayer.googlecode.com/files/gecko-mediaplayer-0.9.9.2.tar.gz

Changes

gecko-mediaplayer

identify and fix problems from 0.9.9 including better playlist support and support for firefox 3.5, 3.6 and Opera.

Opera still has issues with apple.com/trailers sites, due to user agent issues.

gnome-mplayer

A ton of translation updates and additional languages.
Better seeking using position tracker
Several assertion fixes


Kevin

Monday, February 22, 2010

gnome-mplayer and volume getting set to 100%

If you are using gnome-mplayer and have pulse audio installed on your machine, you may notice situations where the volume is set to 100%. This appears to be an issue with mplayer and pulse audio. My suggested work around is to use the pulse audio alsa emulation. To do this select 'alsa' as the default audio output in gnome-mplayer.

The problem stems from the change in pulse audio from separate volumes per each application to a single flat volume control. So if flat volumes are disabled on your system, you will not experience this issue.

This issue happens by default on Fedora 12 when used with mplayer from rpmfusion, so adjust your configurations as needed.

RPMFusion bug #1011

Google Chrome on Linux with videos at http://www.apple.com/trailers

Many people are now starting to ask me if gecko-mediaplayer works on Google Chrome on Linux. For the most part I can say yes, but the main exception appears to the media at http://www.apple.com/trailers . What appears to be happening is that the code to switch the user agent from Chrome to QuickTime does not appear to be working. I believe this is due to Chromes emulation (or not) of the NS_GetServiceManager function call. So until that is fixed, apple.com media will be unplayable in Chrome on Linux.

Tuesday, February 16, 2010

r600 tearfree video on Linux, it is a reality

For some reason I always read "tear" as in crying. I understand that tearing can make some people cry so maybe I am not that far off. Anyway, I got the latest git of drm-radeon-testing, libdrm, mesa and xf86-video-ati. After installing all that everything seems to be running really nicely. I can drag an gnome-mplayer window around the screen and the video does not exhibit any tearing. Even large windows like a browser look good. The only tearing I do get is when I drag a window from one display to another in my dual head setup. I talked to agd5f on #radeon and he said that was due to different pixel clocks on the two displays. He said it could be fixed in software, however. I said while it would be nice to have fixed. I'm sure there are more important things to deal with first.

Thursday, February 11, 2010

Album Cover Art with Shoutcast

I noticed that many shoutcast sites have their track data in a common format "Artist - Song Title'. Based on this, I could use the code I use to obtain the album cover art for MP3 files where not much meta data is available. So a simple parse of the content and a call to the art lookup code and we get this.

This is from http://yp.shoutcast.com/sbin/tunein-station.pls?id=7022 which is an 80's shoutcast station Sky.FM.

Wednesday, February 10, 2010

gecko-mediaplayer and gnome-mplayer 0.9.9

I released gecko-mediaplayer and gnome-mplayer 0.9.9 on 2009-02-05 and the release was decent for the most part. But compile issues where found with various flavors of libxul and there were some other problems with shoutcast and other websites.

So I reworked some code and found some bad problems. So I released a gecko-mediaplayer 0.9.9.1 only on the mailing list which was a snapshot of SVN as of 2009-02-08.

So expect a new release coming soon to fix some of these issues.

Wednesday, January 20, 2010

r600 and Fedora 12 Update

I've done a few posts about the r600 chipset and Fedora Linux. I did one awhile back in April of 2008 and I did another in Sept of 2009 so I thought it was about time for another update.

First of all let me say that the r600 driver has gotten much better since April of 2008, it is hardly in the same ballpark. So I am running Fedora 12 will all the currrent updates. The 2.6.32.3-24 kernel and mesa from git. The mesa in F12 is fine, but the one from git contains support for glsl and OpenGL 2.0 vs the OpenGL 1.5 in mesa 7.7.

So lets get to the raw data...

gtkperf -c 500 -a now runs in 36 - 39 seconds on my machine (Q6600 at 2.4Ghz, 64bit, 8GB of RAM). I have switched to using compiz as my window manger which actually may slow the results down a little. And I also have found that the GTK theme can really impact the performance of GTK.

3d apps for the most part run solid, glxgears is around 2000 fps, Quake 3 runs as 90, Nexiuz is 30-40 depending on the detail. Diablo 2 under Wine gives 25fps (which is its max for the most part). I have had some issues with screen corruption when running diablo with -opengl.

My video player, fosfor, that is based on clutter and gstreamer plays quite well. Even with larger files.

So when testing the radeon r6xx driver on Linux, ensure you have the latest packages available. It really makes a difference.

Tuesday, November 24, 2009

Fosfor UI

Here is the UI for fosfor. I think I will keep with this model for awhile. The buttons light up as you move over them and the control bar only appears when the mouse is over the window. If you don't move the mouse for 3 seconds the control bar and the pointer disappear. Also there is a slight transparency to the control bar so that you can see the video thru the controls.


The audio and subtitle options do work, but for subtitles, sometimes to get the proper one to appear you need to seek in the media. Problem appears to be in gstreamer, but still seeing if I can work around that issue.

Monday, November 16, 2009

Fedora 12, WebCam in Flash

If you are using Fedora 12 and the webcam is not working in Flash applications (the camera is not found). Then add this to $HOME/.bash_profile

LD_PRELOAD=/usr/lib64/libv4l/v4l1compat.so
export LD_PRELOAD

If you are on a 32bit machine change 'lib64' to 'lib'

Then logout and log back in and your webcam should start working.

Tuesday, November 03, 2009

Fosfor Widgets - Implemented

I was able to get the widgets finished up early this weekend and enable them as the main widgets for the fosfor application. So far everything is working pretty decently. I have some ideas I still want to try and see if they work better but I'm happy so far.


One idea I have is to only show the controls when the mouse is over the media and to have it fade in smoothly. I've seen this on a couple of flash animations and it looks nice.

Fosfor now requires

clutter 1.1.2
clutter-gtk 0.90
clutter-gst 0.90

All of these are found in clutter git, and have not been released yet.

Wednesday, October 21, 2009

Fosfor Widgets

I've been working on creating some user interface widgets that are mostly done using clutter. I'm doing this for a couple of reasons..

1. Possibility of fun fade in / fade out options when controls are shown/hid
2. When running in fullscreen mode the clutter widgets can be over the media and transparent or opaque. For example show the details while playing a video.

Nothing real exciting here, but let me describe what you are seeing.


Only widgets I'm talking about are widgets in the black area

1. The green items is the traditional tracker, I need to work with the thumb look and feel, but it is getting there
2. The Pause button is what a button looks like when the mouse is over the button, the background highlights and as you move the mouse off, it unhighlights and looks kinda like the play button
3. This particular play button is set "insensitive" so it will appear darker than a button that is sensitive.

Colors are taken from the gtk theme, so it should remain consistent with other apps.

Well that is all I have at the moment.

Wednesday, October 14, 2009

r600 lockups on Fedora 12/rawhide

If you are experiencing lockups when using an r6xx or r7xx card in Fedora Rawhide (12) try adding

pcie_aspm=off

To your kernel command line in /etc/grub.conf. This solved the lockups for me. Dave Airlied is working on fixing this, so this option should not be needed in the Fedora 12 release.

Tuesday, October 06, 2009

fosfor - media player project

I created a new project at google code called fosfor (phosphor) that is a new player using the clutter and gstreamer code.

You can find the project here

http://code.google.com/p/fosfor/

Wednesday, September 23, 2009

GtkBuilder XML to .h file

Here is a little perl script to convert a GtkBuilder .xml file as generated by libglade3 to a .h file. Kind of in the style of gdk-pixbuf-csource.
#!/usr/bin/perl
$var = $ARGV[0];
open IN, "<$var";
$var =~ s/\./_/g;
print "static const char $var\[\] =\n";

while() {
$line = $_;
chomp $line;
$line =~ s/\"/\\\"/g;
if (/<\/interface>/) {
print "\"$line\";\n";
} else {
print "\"$line\"\n";
}
}
close IN;

Use it like this
xmltoh.pl GtkBuilder.xml > GtkBuilder.h
And then #include "GtkBuilder.h" and you should have a variable name GtkBuilder_xml that is a string that holds the xml that gtk_builder_add_from_string can use.

Tuesday, September 22, 2009

Using Clutter and Gstreamer for Media Playback

I have been watching the clutter toolkit for sometime and putting together a couple of demo apps at the same time just to see what it can do. So with Fedora 12, there is a new clutter 1.0. Unfortunately none of my old demo apps work, so clutterdesk and couple of other thing would need to be converted to the clutter 1.0 api. So when I feel like it I'll probably get around to do it. But what was most interesting to me in clutter 1.0 was the new ClutterMedia actor. So I installed the components to use it, and it is based on GStreamer (which finally appears to produce pretty decent output for most media items).

So I created a simple playback area and actually had two videos (one ogg and the other quicktime) playing on a single "stage" with about 30ish lines of code. Could just play the media, but it seemed to work quite well.

Next was to see what it would take to get some information about the media. This was actually the difficult part, but luckily I was able to dig thru the totem code and find the information I needed.

Next was to create a gnome-mplayer like gui for it, but since I was playing with new toys, I decided to use GtkBuilder to do it. I used glade3 to create an XML file that gtkbuilder could read. As a side note, having Glade3 produce an include .h file that contained the XML in a const gchar would be a nice improvement, that way you could just include the .h file and go, nothing else to ship.

Had a few issues figuring out how to use it, but after awhile, I got it and produced something that looks like this. (This is the Harry Potter and the Half Blood Prince trailer, that I have stored locally).


Looks a lot like gnome-mplayer and I think I have about 4-6hrs into learning how to do all this. It is quite interesting and the toolkits are quite well thought out. So I'll continue to play with this demo on and off and see what comes out.

If you would like the code, I would be happy to email it to you.

Sunday, September 20, 2009

r600 and Fedora 12 Snapshot 3ish

I had been running the r600 drivers or at least trying to, using the git versions of the kernel (drm-next branch), mesa, libdrm and xf86-video-ati on my Fedora 11 machine. And I understand that when running this type of config that things are probably gonna crash.

So when I used this config with KMS/DRI2 enabled it annoyed, but did not surprise me when it crashed. However, to get a stable system I was able to add radeon.modeset=0 to the kernel command line and things just worked correctly. No crashes, fast XV all that stuff.

So I decided that I should upgrade to F12 for a couple of reasons.
1. The new GTK with client side windows was included and I have a feeling that could cause gnome-mplayer some pain

2. The r600 drivers were built in to everything

So after downloading 2.5GB of files and upgrading using preupgrade I rebooted the machine. The preupgrade process ran, but hard locked the machine a couple of times using everything default while the upgrade was running (I should have known then). I finally on the third try added radeon.modeset=0 to the kernel command line and the preupgrade finished. After that was done I ran yum and got the latest of everything else.

Then more pain started. The machine using the default of everything would boot up and let me login and promptly lock pretty much right as the desktop showed up and sometimes it would even lockup in GDM when the screen was shuffling around and sometimes I would get 10 mins before it would lock up. So back to the radeon.modeset=0 option. However, this disabled all acceleration. Firefox was dead slow and xv didn't work. Unacceptable. Tired playing around with it a bit more and was out of lock, all I got were lockups for my efforts.

Luckily my motherboard has the Intel G35 chip onboard so I have that as a backup video card. So out comes the ATI card and in goes the ADD2 DVI adapter that I use with my display. After that everything is pretty happy and no lockups and etracer has twice the framerate with the Intel card as with the ATI card (this should not be). Now I know this is all early stuff and I do expect the ATI card to work eventually. But to have snapshot 3 of Fedora out and to have these kinda lockups, well that kinda sucks.

Monday, August 24, 2009

Apple.com Trailers and gecko-mediaplayer

Right after the 0.9.7 release of gecko-mediaplayer I was made aware of the fact the apple.com/trailers videos don't work anymore. They worked about a week ago, but Apple apparently made a change. A bug was opened in the gecko-mediaplayer bug tracker (#34). And due to the information provided on how to work around this bug, I was able to create a patch for this bug.

SVN now has a fix for it and should work correctly. Depending on demand I may do a new release of gecko-mediaplayer.

EDIT: Sept 23,2009. I made a similar patch to mplayerplug-in and the code is in CVS now, or you can get it from the nightly code build on the 24th.

Thursday, August 20, 2009

r6xx Mesa 3d Driver on Fedora 11

I've been following the 3d driver development for the r6xx/r7xx chipsets using the open source mesa drivers. Progress has been moving along well. In fact compiz has been working for the last week or so. Today, I did some testing and was able to play Quake3 at around 90fps (1280x1024) on my machine without using fglrx or catalyst. The only trick I needed was to specify.

LIBGL_ALWAYS_INDIRECT=1 quake3

on the command line.

However, I did need libdrm from git, the libdrm/linux-core kernel modules (you may need to regenerate initrd to use these modules) from agd5f's r6xx-r7xx-support branch, mesa git and the ATI ddx from git. Other than that I am using stock Fedora.

I also played vdrift and neverputt today, but etracer and neverball crash, so still more to do.

ANNOUNCE: gnome-mplayer and gecko-mediaplayer 0.9.7 released

gnome-mplayer 0.9.7 changes

New tracker for monitoring media progress
Better subtitle support
New screen redraw code for video
New playlist randomizer, sorting and searching options
New icons
Internal ASX parser
Updated translations

Download here:

http://gecko-mediaplayer.googlecode.com/files/gecko-mediaplayer-0.9.7.tar.gz

gecko-mediaplayer 0.9.7 changes

Linker fixes
RAM file parser
Updated translations

Download here:

http://gecko-mediaplayer.googlecode.com/files/gecko-mediaplayer-0.9.7.tar.gz

Thursday, July 30, 2009

Gnome MPlayer changes

This week I made some interesting changes to Gnome MPlayer.

1. Asynchronous metadata loading. So now a threadpool is used to load the metadata in the background. Not that it is very slow, but it should reduce the time of long playlist loads. On my test of a 300 item playlist it cut the time by at least 50%.

2. Playlist storage rework, before this change I used to hold the playlist twice in memory, once in the load order and another in random order and switch between them as needed. I redesigned this process so that I now use indexes to hold this value. Allows for quicker randomizing, faster playlist loading and hopefully less memory usage. In addition the playlist now has an order parameter and you can sort the playlist by this value by clicking on the Order header. The change does result in when "Shuffle Playlist" is selected just the indexes are shuffled and not the actual items.

3. I also made a bunch of minor changes that were results of bug reports/enhancement requests.

Thursday, July 09, 2009

Another new Media Tracker

Well the media tracker in 0.9.6 was not well received. I thought it worked well and gave plenty of feedback and looked ok. I knew it had some "GTK Theme" issues, but in general it stuck the the standards.

So anyway, after messing around with a couple of mockups, I decided to ditch the 0.9.6 media tracker and create a new one. It is a little closer to the one in totem, but still uses as little screen space as possible.


So there you go... this should be in 0.9.7. So far I'm amazed how much code I have changed yet again in the 0.9.6 to 0.9.7 development cycle.

Thursday, May 07, 2009

Video of Fullscreen ClutterDesk

ClutterDesk

ClutterDesk is starting to be something. I can have it run and take over the desktop now and then you can open folders and applications (using gnome-open). You can also drag items around, but nothing remembers where it was from run to run.

I'm thinking of turning this into a real project now. It does require accelerated 3d to work. (my r6xx, with the radeon driver, sucks running it).

Wednesday, May 06, 2009

Followup on an Application Idea - ClutterDesk

About a year ago, I posted an idea about an application idea. Nobody ever took me up on it as far as I can tell. So I finally had some time and thought I would post a slight mockup of the idea. So here is a video that shows the mock up I have made. I developed this in about 2-3 hrs using the clutter library.




I'll continue working on this mockup and eventually turn it into something as I have time, but if anyone wants to run with it and make it a real app, I'll be happy to provide code.

Friday, May 01, 2009

Picasa on Fedora 11

I found out today that in order to run Picasa on Fedora 11, you need to have the openssl-devel.i586 package installed. This package includes libssl.so, which is what Picasa needs when connecting to the Google site.

I found this odd, because -devel packages are normally not needed on non-developer machine. But just thought I would share this information.

You might also want to install nss-mdns.i586

Wednesday, April 08, 2009

More F11 sound tips

I was having some issues with F11 and mplayer, in that the first few seconds of a file would be played at an odd rate or delayed at the start

Editing /etc/pulse/default.pa

and changing

load-module module-hal-detect

to

load-module module-hal-detect tsched=0

Got rid of that lag, also I found that commenting out 'load-module module-suspend-on-idle' in that file didn't seem to hurt.

I also found that if you have the snd_hda_intel device and you are hearing loud pops, you might want to try this

echo "options snd_hda_intel power_save=0" > /etc/modprobe.d/snd_hda_intel.conf

After doing all that, reboot and enjoy sound again... Now this all applies to the beta, so in the future these tips may be all wrong.

UPDATE: It appears that this issue has been fixed in rawhide and so the tsched=0 is no longer needed.

Saturday, April 04, 2009

Disable 'flat' volume in pulseaudio 0.9.15

If you don't like the new 'flat' volume feature in pulseaudio 0.9.15, like I don't then try this.

Login as root and run


echo "flat-volumes = no" >> /etc/pulse/daemon.conf

And then relogin to your desktop, and that should do it.

Tuesday, March 17, 2009

New Media Tracker

As you can tell I'm been on kind of on a gui cleanup roll. After learning how to make widgets and finally having the time to think about what I wanted, I wrote a new tracker widget. I think this widget looks great. You'll see it below where the time of the file is.


Let me know if you agree or not. Also this code is now in SVN.

Monday, March 16, 2009

Audio Meter hits gnome-mplayer

I am just about ready to commit the first version of gnome-mplayer with the audio meter integrated... Here is what it currently looks like.


Seems to be working pretty good, and I created it as a full widget, so it could be reused in other projects quite easily.

Sunday, March 15, 2009

GtkStyleColors

I wrote a little app for GTK that displays the style colors of the current theme. If you would like a copy of it, drop me an email..

It looks like this


I found it useful for picking which color to use when creating some GTK widgets.

Saturday, March 14, 2009

Audio Meter

Zdravko Nikolov asked be if gnome-mplayer could have an audio meter. I had looked at this in the past and didn't get very far with it and so I decided to take a look at it again. The first thing was how to get the data from mplayer and then I found the export audio filter. I still don't quite get what I am actually getting from the filter, but the data is interesting enough that when graphed it gives something like an audio meter. Now audio techies are probably gonna think what I came up with is an abomination, but it looks pretty and for some people that is all they want.

Here is a screenshot of what I current have working in some test code, and the next thing will be to merge it into the gnome-mplayer code base.


It does scale out and so as you drag the window, everything scales up, which is good. Also if anyone has better math for this or can enlighten me a little as to what the data actually is that would be great.

Friday, March 13, 2009

Gnome MPlayer and Gecko MediaPlayer 0.9.5 Released

gnome-mplayer 0.9.5 is available here:
http://gnome-mplayer.googlecode.com/files/gnome-mplayer-0.9.5.tar.gz

gecko-mediaplayer 0.9.5 is available here:
http://gecko-mediaplayer.googlecode.com/files/gecko-mediaplayer-0.9.5.tar.gz


Translation updates, general bug fixes. So hot key changes for example
playlist is now F9, to be more compatible with other Gnome Apps

New features:
gnome-mplayer now includes a property page in Nautilus that displays
media info. To use restart nautilus after installing and then select a
media file and choose properties, you should see an Audio/Video tab and
you can view the properties that mplayer knows there. If you have totem
installed you might see two pages.

Saturday, February 28, 2009

Gnome Theme - Japan 2007

I was looking at some themes for the E17 window manager and found one called Japan2007. I liked the colors in it and so I grabbed the screen shot and then used gimp to find out the color ids. So since I use gnome, I setup up my preferences using these colors. Here is what I came up with.

Controls: Nodeka
Colors:
Window - #D8D9CC
Input Box - #EDEDE6
Selected Items - #D3D5C0
Tooltips - #F5F5B5
For all the text I used black or #000000
Window Border: Nodeka
Icons: Gnome

It looks like this

Friday, February 27, 2009

Glest and Catalyst 9.1 with dual head

I wanted to try out the game Glest on my machine and ran into some odd things.

1. Running with two displays, the game spans over both displays with the menu being split right down the middle. I'm guessing this is due to the xrandr 1.1 compatibility of the Catalyst 9.1 (fglrx 9.1) drivers.

2. Switching the displays into clone mode prior to bringing up game and then trying to start it, causes the game to crash on start.
[kdekorte@quad ~]$ glest
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 135 (XFree86-VidModeExtension)
Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)
Value in failed request: 0x5b

So I guess I am kinda out of luck trying out the game. I might try and play it in dual head and see if I can move some of the in game menus around. But for games, I really wish they would stick to one display unless told otherwise.

Monday, February 23, 2009

Nautilus Property Page now included in Gnome MPlayer

Andrew Kluger asked me that since I had a replacement for all of the Totem components (thumbnailer, browser plugin, media player) except for a property page in Nautilus then perhaps I could create one. I took a look at how Totem did it an determined that it didn't look that bad. So I started working on it and within about 4 hrs had something functional. It may not be finished yet, but it seems to fit the bill.


So how it works, is you install Gnome MPlayer from SVN (0.9.5) and it will install the Nautilus plugin. Select a media file that has an appropriate mime type (if your file type is missing, let me know and I'll add it), and right click on the file. Select properties and you should then see the Audio/Video tab. Click on it an it should then give you details about the media file based on what MPlayer knows about the file.

Wednesday, February 04, 2009

New gnome-mplayer and gecko-mediaplayer 0.9.4

gnome-mplayer 0.9.4 has been released you can download it here

http://gnome-mplayer.googlecode.com/files/gnome-mplayer-0.9.4.tar.gz


gecko-mediaplayer 0.9.4 has been released you can download it here

http://gecko-mediaplayer.googlecode.com/files/gecko-mediaplayer-0.9.4.tar.gz


Changes:

gnome-mplayer

Compatibility with Free/Open/NetBSD
Updated translations
New commandline option "--showsubtitles" defaults to 1, set to 0 to
prevent subtitles from showing by default.
Cleanup glib/gtk assertions
Fix window resize issues
Better handling of initial video playback window, should cause fewer resizes
Fix crashes when HOME is not set
Fix some realplayer emulation issues, may not be entirely fixed as
problem site is not accessible at my location
Stability improvements
Compatibility with libgpod 0.7 (API change between 0.6 and 0.7)
Mixer option is only used when the ALSA ao is selected


gecko-mediaplayer

Switch from XPCOM to NPRuntime Mozilla interface, removes need of idl
compiler and should work on more platforms easier
Compatibility with with Konqueror 4
Fix problems with realmedia sites that use a control parameter that dbus
does not like

Monday, February 02, 2009

Google Earth on Fedora 10

If you are running Google Earth on Fedora 10 and are getting the following dialog box:

Google Earth Error

Google Earth detected an error while trying to authenticate. Please
check the following:
- your network connection (can you get to www.google.com?)
- your firewall settings
(are you blocking /usr/lib/googleearth/googleearth-bin?)

Error code: 29
For more information, visit:

Try installing nss-mdns.i386, it solved the problem for me.

Linux Catalyst 9.1 on Fedora 10

I've been using Fedora and ATI cards together for awhile and the fglrx support has always been kinda hit and miss. The last combination that worked well was Fedora 8 and fglrx 8.10 (I believe). Anyway, when I upgraded to Fedora 10, I did not expect it work well and I had trouble with 8.11 and 8.12 various issues from no display to no 3d support.

So when 9.1 came out, I was not expecting much. However, I installed the akmod-fglrx package from rpmfusion-updates-testing today and so far I have been happy. I run a x86_64 distrobution so I had to install the additional xorg-x11-drv-fglrx-libs-8.573-1.9.1.fc10.i386 package so that 3d would work with i386 applications like SecondLife. If you don't have this installed SecondLife will run at a reduced frame rate. I have not seen other apps that have required this. And since I run dual head I had to remove the virtual setting from the screen area so that fglrx set the screen rez correctly (leaving this in caused the horizontal width to be much to wide). I used the ATI Catalyst Control Center to setup the dual head setting (in previous versions this application crashed) and restarted and everything looked correct.

But I will say that Fedora 10 and Catalyst 9.1 do work together and it seems to work well. Thanks rpmfusion!

Thursday, January 29, 2009

gnome-mplayer 0.9.4 will work with the *BSDs

I've had an open issue with gnome-mplayer not working on the BSDs for awhile now. It always seemed to be a locking error with the code and the problem didn't happen on any of my machines. After trying to have people help me debug it, it kept coming back to the same issue, the second call to g_mutex_lock didn't block, it would just go on thru. So I decided to bite the bullet and install FreeBSD 7 on a VM. I was able to duplicate the issue quite easily. So the next step was to write a test program that simulated my code. I did that and found that the test program behaved the same way that gnome-mplayer did in Linux and BSD. So I then opened a bug on GLIB. The comment was that the a GMutex was not guaranteed to be recursive or non-recursive. What this means is that depending on your environment the way it works changes. So I did a little chatting on irc and __tim told me to check out GCond objects. So I tweaked my test program from using a second lock to g_cond_wait(...) and changed the g_mutex_unlocks to g_cond_signal(...) . After that the test program ran correctly on both Linux and FreeBSD.

So after seeing how the test program worked, I made the needed changes to gnome-mplayer. Did some quick tests on Linux and FreeBSD and everything worked properly. The changes were committed to SVN, so expect to see gnome-mplayer available for *BSD in the near future.

Thursday, January 08, 2009

gecko-mediaplayer: Replacing XPCom with NPRuntime

Thought I would give a little post-op on the XPCom to NPRuntime conversion. One of the biggest issues with XPCom was the need for .idl files and the code that went along with them. How an .idl file worked was that you declared a class with a unique id and then the methods and properties of that class. Then you took that .idl file and ran it thru the xpidl compiler and this gave and .xpt and a .h file as the output. The .xpt was used by firefox,mozilla, et al to know what methods the class/plugin provided. The .h file was used by the code to create then entry points for the methods. Anyway, getting all the working on many different distrobutions was a pain. Many of the files needed for this step ended up in different places and usually the .pc files (the pkg-config files that say where everything is) were wrong.

So with libxul 1.9.1 coming out shortly and it changing things with XPCom again I decided to look at npruntime since that is where things need to go anyway. Before doing this I did make sure that I could get the plugin working in XPCom mode with 1.9.1 and I was able to, with some minimal fuss. But still decided to take a look into the conversion since I was sick of the whole idl thing.

I planned that the conversion to npruntime would take me about a month on an off and just getting it work, based on the issues I had to get xpcom working initially (this is the mplayerplug-in 2.0 code, version prior to 2.0 had no javascript support).

I started looking at the npruntime sample that I had I started cutting out code from gecko-mediaplayer first. Took about 2-3 hrs and I had the code running and linking against npruntime but without javascript code. I took, npn_gate,npp_gate and np_entry from the sample to get going. At first I didn't think I should touch those files, but after looking at them and reading the comments in them, it looked like I should edit them as needed. Once I got past this step I was actually able to get the plugin to do something other than stare at me. So I got it doing the basics and then I thought I should get javascript working.

So again I looked at the sample and noticed that the classes in the file, kinda resembled the stuff from XPCom and so I decided to get two methods working, play and pause. I had to declare an id and then define that id to be the same as the methods that I did in the .idl file. I then had to edit HasMethod to say, yeah I could handle that id. After I got HasMethod working I noticed that the code was dropping into Invoke and found that with a couple of lines of code I could take the same call that I used in the XPCom callbacks and apply it here. Once I got that working I started doing the bookwork and created all the methods and the callbacks. The same was pretty much true for the properties as well. And in about 8 hrs of work it was pretty much working.

The conversion turned out to be much less work than I expected it to be and I think the code is actually easier to understand now. Before I really dug into this, I looked at it and just was really dreading the conversion as I expected it to be a huge learning curve, but actually I was able to reuse a lot of what I already knew.

Friday, January 02, 2009

radeonhd drivers on r600

After installing libdrm and radeonhd from the r6xx-r7xx-support branch. And running configure with the --prefix=/usr and --libdir=/usr/lib64 and making a slight modification to the libtool file in drm so that it would install when the libdir was /usr/lib64 I got my system back up and working in the same state as before. Except that with radeonhd I need to enable the composite manager in metacity to make it display better.

After that I reran the gtkperf -c 500 -a test and got this

GtkPerf 0.40 - Starting testing: Fri Jan 2 12:57:55 2009

GtkEntry - time: 0.16
GtkComboBox - time: 4.70
GtkComboBoxEntry - time: 4.07
GtkSpinButton - time: 0.41
GtkProgressBar - time: 0.26
GtkToggleButton - time: 0.70
GtkCheckButton - time: 0.51
GtkRadioButton - time: 0.90
GtkTextView - Add text - time: 8.33
GtkTextView - Scroll - time: 0.98
GtkDrawingArea - Lines - time: 2.02
GtkDrawingArea - Circles - time: 3.88
GtkDrawingArea - Text - time: 2.93
GtkDrawingArea - Pixbufs - time: 0.35
---
Total time: 30.20


Which is a fun 5 seconds faster than the eariler test... excellent

Radeon r600 drivers

It appears that the r600/r700 AMD/ATI chipsets are finally making some progress on getting hardware acceleration going. So I'll be doing some testing here with them in the future.

As of right now I'm running Fedora 10 and am using the xorg-x11-drv-ati drivers that come with Fedora 10 and they are giving these performance metrics. rpm is xorg-x11-drv-ati-6.9.0-63.fc10.x86_64

gtkperf -c 500 -a

GtkPerf 0.40 - Starting testing: Fri Jan 2 11:46:31 2009

GtkEntry - time: 0.18
GtkComboBox - time: 6.01
GtkComboBoxEntry - time: 5.69
GtkSpinButton - time: 0.43
GtkProgressBar - time: 0.25
GtkToggleButton - time: 0.86
GtkCheckButton - time: 0.61
GtkRadioButton - time: 1.04
GtkTextView - Add text - time: 8.95
GtkTextView - Scroll - time: 1.61
GtkDrawingArea - Lines - time: 1.60
GtkDrawingArea - Circles - time: 4.31
GtkDrawingArea - Text - time: 3.20
GtkDrawingArea - Pixbufs - time: 0.45
---
Total time: 35.17

glxgears is not hardware accelerated yet.

glxgears
1071 frames in 5.0 seconds = 214.146 FPS
1075 frames in 5.0 seconds = 214.934 FPS

Also to note that I am running two screens with one desktop across them.

gnome-mplayer and gecko-mediaplayer 0.9.3 released

Updated versions of gnome-mplayer and gecko-mediaplayer have been released. Pretty much several small fixes for a few annoying issues. But would recommend the update.

Wednesday, December 17, 2008

Perl glob performance

I was working on a project and found that my file server that I was pulling data off of seemed a little slow when getting the list of filenames. I was using 'glob' to get a list of files from the server and then kept the 10 most recent (the file names were sequential so a reverse sort gave that simply). But I found that the glob was taking a long time (there were about 4000 files in the directory and I could not remove them due to business rules). So I asked on the perl irc channel and found that they recommended using opendir/readdir over the glob call since glob does a stat on everyfile, making it run slower. So replacing (1) with (2) resulted in a 10 times speed up of my code for just this part of the code.

(1)

@files = glob "d:/path/to/directory/*";
$i = 1;
foreach $file (reverse(sort @files)) {
print $file . "\n";
$i++;
if ($i > 10) {
last;
}
}


(2)
opendir DH, "d:/path/to/directory/";
@files = readdir DH;
$i = 1;
foreach $file (reverse(sort @files)) {
print $file . "\n";
$i++;
if ($i > 10) {
last;
}
}
closedir DH;


I found this change useful so I thought I would share it.

Thursday, December 04, 2008

Recover a failing disk using a Linux Live CD

I had a friends disk fail the other day and this is how I attempted to recover it.

First the situation, a Windows XP machine that was having trouble booting. I eventually got it to boot but shortly after that the disk in the machine started giving random read/write errors. So here is how I tried to recover it.

Tools:
Fedora Live CD (I used Fedora 8 cause that is what I had)
A Fedora Linux based file server with lots of diskspace or another hard drive.

My file server is setup as a samba server, so a Windows Server could be used in place if you have one.

  • Boot the machine using the Live CD
  • Switch to running as root
  • Install dd_rescue and samba-client (on fedora the command is 'yum install dd_rescue samba-client')
Note: if you have to reboot, you will have to install these tools every time, unless you are using a Live CD on a USB Flash drive.

  • Mount the file server using cifs (this is the Samba/Windows Server protocol)
Create the local mount point
mkdir /media/public

Mount the fileserver
mount -t cifs //[hostname or ip]/[share] [local path] -o username=[id]
e.g. mount -t cifs //192.168.0.210/public /media/public -o username=anyone
It will ask for a password, and you should give the password for the anyone account.

If you are using another disk you can just mount it. The device name will probably be /dev/sdb1, but check dmesg to be sure.

mount /dev/sdb1 /media/public

  • Use dd_rescue to copy the partition to a file on the file server
dd_rescue -A /dev/sda1 /media/public/disk.img
This may take several hours or even days and will take up large amounts of diskspace. In my case it was 2 days and 40GB.

  • Once the rescue is complete you can mount the disk on the server with a loop mount or copy it back to a new disk

Loop method (requires Linux)
Create the local mount point
mkdir /mnt/disk

Mount the image using a loop device
mount -o loop -t ntfs-3g [path to disk.img] [mount point]
e.g. mount -o loop -t ntfs-3g /data/public/disk.img /mnt/disk

Copy the needed files from the /mnt/disk directory.

If the disk image is not mounted, you might be able to boot the image using qemu with the following command:
qemu -m 512 -hda /data/public/disk.img

Copy method
(reboot back into live CD with the new disk installed and partitioned, install the tools,mount the server/disk again)
dd_rescue -A /media/public/disk.img /dev/sda1

If the new disk is larger than the old disk (it cannot be smaller) then you may need to use parted or Partition Magic to resize the partition. Also, you may need to run 'fixboot' and 'fixmbr' using the Windows Install CD in rescue mode to get the new disk to boot. I would recommend doing a clean install and just copying the data files back since the OS and applications may have been damaged by the disk errors.

Hopefully this is useful, but remember that depending on the level of disk failure it may not work.

Friday, November 21, 2008

Gnome MPlayer 0.9.2 is out

I released gnome-mplayer 0.9.2 today. Normally I wait about a month between releases, but since 0.9.1 had so many annoying little issues. I decided to try and push 0.9.2 out a little quicker. Turns out even with this short release I still got 90+ changes in. Seems like an awful lot. Anyway 0.9.2 seems ok, although I'm already moving forward and making a few more patches. Sometimes I think the mplayer team has the right idea with the no release policy, but I do like being able to refer to a release when fixing bugs.

Tuesday, November 11, 2008

Gnome MPlayer Subtitle Updates

I did some more work on the subtitle and audio language pickers today. The problem I had is that some media types don't have a label for the subtitle or audio ids. So for some cases media that had subtitles or different audio tracks this tracks where not getting picked up. So I got to work on fixing that today and what happens is that for ids that have a label, the label is placed in the menu, otherwise the raw id value is put in the menu. This should at least allow the user to try some of the different options and see if they get what they want.


As you can see in this example of an mkv file with many subtitles, all of the possible subtitles are in the menu with the active title marked. You can see on the video how Spanish is the subtitle set being used.

In the above example the media (dvdnav://) does not have a label for the audio languages and so we get the code. Since this is all the information that mplayer is providing at this point, I can't present a label but it is better than no option. In this case 128 is English and 129 is Spanish.

Monday, November 10, 2008

gnome-mplayer UI

I've gotten cover art working in gnome-mplayer, and I found that when I run the application as basically a music player (which I do alot) I found that seeing the cover art and the playlist can be handy. However, I don't care how this display looks when it is running in horizontal mode, but in vertical mode it looks pretty nice. Here is a screen shot of my current SVN code when I run in vertical mode.

Monday, November 03, 2008

gnome-mplayer 0.9.0..err 0.9.1 out

Well I released gnome-mplayer 0.9.0 on Friday and by late Saturday a bunch of compile bugs started coming in. Turns out I had done two things wrong.

1. I used some features only in glib 2.16 and higher
2. I didn't handle the gio check properly in autoconf

I've fixed it now, but that will remind me to check that everything compiles properly in the future.

Friday, October 17, 2008

Another rebuild

I've been working on my development machine to get it the way I wanted. When I started working on the GIO functions of gnome-mplayer I needed to upgrade to Fedora 9 so that I could get the libraries. It was working ok, but what I really wanted was to run in 64bit mode on my machine, since I do have 4GB of RAM and a 64bit CPU.

So I reinstalled the x86_64 version of Fedora 9. However, I still wanted to be able to run a few 32bit apps. One is my scanner driver and the other is mplayer. The 32bit version of mplayer has a few more codecs than the 64bit version so I wanted to have that. My first test was to get everything I needed from livna and setup the basics. I decided that I would first install mplayer.i386 from livna to make sure I had all the right basics. To do this I had to edit my fedora, fedora-updates and livna repo files. I copied the base setup to a new [fedora-i386] for example and then made sure I was getting the 32bit files. I then installed mplayer.i386 and mencoder.i386. I then rebuild gnome-mplayer in 64bit mode and made sure that all that was working.

So far my 64/32 setup is working ok. And it already helped me fix a minor install bug in gecko-mediaplayer.

Tuesday, September 30, 2008

Trying dual display

When I got my last video card I wanted to make sure I got one with two DVI ports on it, so if I ever wanted two work with two displays, I would be ready to go. Well my wife got a new display for her laptop and I so I stole the LCD off of her desk and stuck it on my machine.

Having the two displays is nice, but it is taking some getting used to. So far I think I like it and am going to stick with it.

gnome-mplayer 0.8.0 and gecko-mediaplayer 0.8.0

Both gnome-mplayer and gecko-mediaplayer 0.8.0 have been released. There are several great improvements to gnome-mplayer. The changes to gecko-mediaplayer were minor but it was released to keep version sync.

Enjoy

Tuesday, September 02, 2008

Nailer aka MPlayer Video Thumbnailer at Google Code

I have created a new Google Code project called mplayer-video-thumbnailer. This project holds the code I developed called nailer.

You can find this code at: http://code.google.com/p/mplayer-video-thumbnailer/