Amarok Jukebox!


What?!

Tuesday 10 July 2007

This page tries to explain the major passages that I've done build mine "Amarok Jukebox".
It consists in a quite old pc (celeron 766, 128 RAM) packed in a small box, with a touchscreen and AmarokFS (kde-apps.org).

Editing amfs-xml.cpp

I've made some little mods to the AmarokFS source adding some useful functions. In fact AMFS uses a really powerful interface based on an XML theme. Editing the theme file is possible to add buttons that calls DCOP functions. But something is missing...
My mod consists in two parts. The first one adds the functions needed in the source code:

void AmfsXML::controlButtonClicked(QCString command) {
	if (command == "close") {
		close();
	}
	else {
		sendPlayerCommand(command);
	}
}
void AmfsXML::sendPlayerCommand(QCString command) {
	if (command == "mix") {
		if (!dcopClient->send("amarok", "playlistbrowser", "loadPlaylist(QString)", "Mix casuale"))
		qDebug("there was some error using DCOP.");
	}
	else { if (!dcopClient->send("amarok", "player", command, (QByteArray) 0))
	qDebug("there was some error using DCOP.");
}
cout << "called: " << command << "\n";
}

As you can see I've added two commands: "close" that closes the program, and "mix" that loads the "mix casuale" playlist (that's the italian name of "random mix"). In fact my objective is to use the Jukebox as... a Jukebox! It can plays songs for hours, completely random.

Editing theme.xml

The second part of the mod is in the theme file. I've added two buttons calling the new functions.

<button>
<path>images/mix.png</path>
<clicked>images/mix_down.png</clicked>

<command>mix</command>
<x>648</x>
<y>530</y>
<w>50</w>
<h>55</h>

</button>

<button>
<path>images/close.png</path>
<clicked>images/close_down.png</clicked>
<command>close</command>
<x>648</x>

<y>530</y>
<w>50</w>
<h>55</h>
</button>



Bootsplash

Sunday 15 July 2005

A few days working on the bootsplash on kernel startup and... nothing solved yet. The problem it's in the fact that I use the most stupid video card: an intel 810/815. Googling around it's easy to find tons of people with problems with this card. In fact the framebuffer support in the kernel has many bugs. Anyway, I'll describe what I've done:
(1) With Yast I've selected a theme: Yast -> Sysconfig editor -> system -> boot -> theme
(2) From console I've installed the theme in the initrd:

# mkinitrd -s 800x600

(3) Opened the grub config file (/boot/grub/menu.lst) and edited it.
(4) Then I found a problem loading the framebuffer support in the video card. So I've recompiled the kernel:

Device Drivers ->
Graphics Support
[*] Support for frame buffer devices
[*] VESA VGA graphics support
<*> Intel 810/815 support (EXPERIMENTAL)
[*] Use VESA Generalized Timing Formula
[*] Enable DDC Support
Console display driver support ->
[*] Video mode selection support
<*> Framebuffer Console Support
Logo configuration
[ ] Bootup logo
Bootsplash configuration
[*] Bootup splash screen

(5) Loading the kernel from grub I've added this command:

video=i810fb:vram:4,xres:800,yres:600,bpp:16,accel,mtrr

But then, looking to "dmesg" I found this error:

bootsplash looking for picture... found, but framebuffer can't handle it!

Now, according to this site (link) I'm trying to (6) bypass the error commenting out the section in "bootsplash.c":

/* extern struct fb_ops vesafb_ops; */

and a little pages down to.........

/* if (!vc_cons[unit].d || info->fbops != &vesafb_ops) {
                   splash_free(vc, info);
                   printk(" found, but framebuffer can't handle it!\n");
                   return -1;
       }
 
*/

And then (7) recompiling the kernel.