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.