Reply
Thread Tools
Posts: 235 | Thanked: 339 times | Joined on Nov 2010
#51
Hi there,

Originally Posted by Mitrandir View Post
I'm probably going to start developing this project
Well, thank you

I need several days to bring my current Harmattan project to solid shape and ready for Ovi Store. So we have time to discuss technical details and overall design now.
Good luck!

So, i'm thinking of using Vala. Vala is a kind of preprocessor that takes sources in Vala language which is C#-styled with automatic memory management, closures, and very tight GTK integration and builds plain C code that then compiled with regular gcc and works nearly as fast as hand-written C program. I think this is the best approach that combines modern language's features & conding speed and low-level performance of C.
I know GObject isn't nice, but the version of Vala available for Diablo is old (admittedly the GLib version isn't any better) and bug fixes have been noted in the changelog since...

What about audio engine. I think we can start with GStreamer[...]
Yessir!

By the way, does anybody has ready solution for how to react on headset button press? I think it could be figured out from 'headphoned' (right?) sources, but may be someone remembers exact D-Bus signal name?
Code:
/* valac --pkg dbus-glib-1 --disable-dbus-transformation dbus-hal.vala */

void on_Condition (string name, string details)
{
		if (name == "ButtonPressed") && (details == "phone")
		{
			stdout.printf ("Headset button pressed\n");
		}
}

void main () {
	DBus.Connection conn = DBus.Bus.get (DBus.BusType.SYSTEM);
	dynamic DBus.Object hal = conn.get_object ("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/platform_retu_headset_logicaldev_input", "org.freedesktop.Hal.Device");

	hal.Condition.connect += on_Condition; /* Deprecated syntax, but it's not like Vala is getting any newer on Diablo */

	new MainLoop().run();
}
I haven't compiled the code, but I do know that the interface names etc. are correct.
There is a libhal binding, but DBus (through DBus-GLib) seems to be better integrated - I don't think all of libhal's functions are bound

http://code.google.com/p/fingertier/ is a player written for the OpenMoko by a person who seems to have had some of the same ideas as you

Originally Posted by auouymous View Post
dbus-monitor doesn't show any signals when I press buttons on my headset. Volume changes but no signals and the main button doesn't do anything in media player.
If you have an headset with a single button on it (to end calls) such as the one that came with the N800 (its model name eludes me, sorry) or this Sony Ericsson HPM-75(i)j I'm using now, pressing the button gets this event emitted on the system bus:
signal sender=:1.1 -> dest=(null destination) serial=218 path=/org/freedesktop/Hal/devices/platform_retu_headset_logicaldev_input; interface=org.freedesktop.Hal.Device; member=Condition
string "ButtonPressed"
string "phone"

Last edited by jstokes; 2011-09-20 at 08:27.
 

The Following 4 Users Say Thank You to jstokes For This Useful Post:
Posts: 336 | Thanked: 47 times | Joined on Jul 2008
#52
what would really be good is if the music player can stream internet radio and have streamripper incorporated so you can record music and play it-streamtuner would be a good example
 
Posts: 355 | Thanked: 598 times | Joined on Sep 2009 @ Nizhny Novgorod, Russia
#53
Yes, Tear is coded in Vala. The only thing i hate about Vala is a lack of incremental compiling support. All source code must be recompiled after single line change.

auouymous, are you sure you measure memory consumption correctly? VSZ of GTK-based application will be greater, but VSZ includes memory that is shared among all GTK-apps. I think RSS is the right thing to compare. Or you already measure RSS?
I need to do some tests, I think. If memory consumption difference will be considerably big, using of GTK should be reconsidered.

By the way, Telescope is linked with Glib already, since merging with Launcher which uses Glib for parsing XML But no GTK and no Glib's D-Bus bindings.

jstokes, thanks for the snippet!
Yeah, Diablo has very old Vala version, but I already have some skills in working around its bugs
 

The Following 3 Users Say Thank You to Mitrandir For This Useful Post:
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#54
Originally Posted by Mitrandir View Post
The only thing i hate about Vala is a lack of incremental compiling support. All source code must be recompiled after single line change.
Ouch!


Originally Posted by Mitrandir View Post
auouymous, are you sure you measure memory consumption correctly? VSZ of GTK-based application will be greater, but VSZ includes memory that is shared among all GTK-apps. I think RSS is the right thing to compare. Or you already measure RSS?
Yup, the memory values in ASUI's process viewer are all RSS.

I have an idea, why don't you write a new Xlib UI toolkit for Maemo. Lightweight, flexible, pretty graphics, good theme support and so on. Then I can use it in the file manager and ASUI.
 

The Following 2 Users Say Thank You to auouymous For This Useful Post:
Posts: 355 | Thanked: 598 times | Joined on Sep 2009 @ Nizhny Novgorod, Russia
#55
I have an idea, why don't you write a new Xlib UI toolkit for Maemo. Lightweight, flexible, pretty graphics, good theme support and so on.
Hehe, i guess this is the very same phrase which was said before creation of Tk, FLTK, Fox, Motif and a dozen of other UI tooklits
But UI library is a huge amount of work and, after all, I'm not sure that it will use less memory if it will be as flexible and powerful as GTK

By the way, I have measured RAM consumption of the very simple gstreamer app and it seems to eat around 8mb when playing from local file and ~10mb when playing from http url. Adding empty GTK window adds another 3mb. But that's on desktop PC, i will test it on N810 later but i expect the same result.

And by the way, if we want GStreamer backend we must use Glib because GStreamer is based on GObject

Upd: rewrote experimental GTK+GStreamer program in vala: exactly same result in memory size than in C (even 150kb less )

And look how beautiful vala code is This is a full code of working program that plays mp3 from http
Code:
static void main(string[] args)
{
    Gtk.init(ref args);
    Gst.init(ref args);

    var pipeline = Gst.ElementFactory.make("playbin2", "player");
    pipeline.set("uri", "http://www.peternalitch.ru/mp3/lostandforgotten/1_lost_and_forgotten.mp3");
    pipeline.set_state(Gst.State.PLAYING);

    var window = new Gtk.Window();
    window.show_all();
    window.destroy.connect(Gtk.main_quit);

    Gtk.main();
}

Last edited by Mitrandir; 2011-09-20 at 10:19.
 

The Following 5 Users Say Thank You to Mitrandir For This Useful Post:
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#56
Originally Posted by Mitrandir View Post
I'm not sure that it will use less memory if it will be as flexible and powerful as GTK
Who said it needs to flexible or powerful, just fast and lightweight.


Originally Posted by Mitrandir View Post
By the way, I have measured RAM consumption of the very simple gstreamer app and it seems to eat around 8mb when playing from local file and ~10mb when playing from http url. Adding empty GTK window adds another 3mb. But that's on desktop PC, i will test it on N810 later but i expect the same result.
11-13meg for a blank window that plays a song? This will consume 20meg like media player. I wish Nokia had made their own lightweight
UI toolkit that was similar enough to GTK that most basic GTK apps could compile against it without changes.
 

The Following 3 Users Say Thank You to auouymous For This Useful Post:
Posts: 637 | Thanked: 445 times | Joined on Dec 2009 @ Kaliningrad, Russia
#57
I did a few minor changes in drafts I showed before and some kind of settings page.
Keys, font size and about are links to the submenu which may be looks the same.
I think play and switch buttons may still work as they used to even in the Settings menu. Who nows, maybe you will need to stop playing immediately…



I would like to hear what to do with seek circle on the seek bar. I have no idea what to draw...

Last edited by Kroll; 2011-09-20 at 22:11.
 

The Following 3 Users Say Thank You to Kroll For This Useful Post:
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#58
Originally Posted by Kroll View Post
I think play and switch buttons may still work as they used to even in the Settings menu. Who nows, maybe you will need to stop playing immediately…

I would like to hear what to do with seek circle on the seek bar. I have no idea what to draw...
Can GTK do all of this?

The new seek circle looks good, so did the last one. The checkboxes in settings need to stand out more, too hard to see. And you should gray out any control buttons that aren't active with settings open, like the playlist button. Unless you want to use it, in addition to the settings button, to close settings.

That red close button has bugged me since the first mockup though. It stands out too much because it isn't blue/black/white like the rest of the window. Maybe darkening the red would help, or changing it to a blue X like diablo5.
 

The Following 2 Users Say Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#59
Somebody mentioned recording live internet radio.

I love this idea.

I listen to Acoustic Radio Cafe and it plays songs you can't find or purchase anywhere online.

So yeah, having Streamripper (already available) support would be amazing.
 
Posts: 355 | Thanked: 598 times | Joined on Sep 2009 @ Nizhny Novgorod, Russia
#60
11-13meg for a blank window that plays a song? This will consume 20meg like media player
Yep, but this isn't due to GTK. This is due to Glib & GStreamer. Adding GTK to primitive gstreamer-based app adds only 3mb.

Okay, i'm not insisting on using GTK. After all, such non-generic UI will not use the core part of GTK — standard widgets. Simple pixmaps-based widgets and handling touch events can be implemented as thin abstraction layer over Xlib.
So, okay, i'm going to agree with you about GTK Small & simple X-based UI toolkit seems to be enough. And this toolkit can be reusable in other projects

(By the way, I already have some little experience in writing lightweight UI toolkits: I did one over WinAPI when developed project for Windows CE. Qt & Gtk was too heavy for device with 32mb RAM and I have created my own, because coding with plain WinAPI is even more ugly than with plain Xlib )

And if we are dropping GTK, Vala might be the next, because the main advantage of Vala is the ease of using GTK. And ok, D-Bus can be handled manually too

But using GStreamer will eat 8-10mb of ram anyway. And i don't know how we can do anything about it.

About the UI. I *love* these mockups! The last one with settings menu is really amazing (except checkboxes as auouymous said).
But unfortunately blurred background is not the case for N8x0. We have no OpenGL shaders which can do this easily. And blurring with CPU is really expensive. I think the most we can do is to dim background with plain color.
And yes, close button is not from here. It seems to be from Windows Vista


Somebody mentioned recording live internet radio
This seems to be pretty easy to do with gstreamer


Kroll, i think it's time to start working out some formal technical requirements. Could you create some public Google Doc for it, please?

Last edited by Mitrandir; 2011-09-21 at 08:45.
 

The Following 3 Users Say Thank You to Mitrandir For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 13:55.