Writings Photos Code Contact Resume
GNU/Linux

You are here

Introducing vcamera, a virtual V4L2 camera.

Submitted by msameer on Mon, 20/06/2011 - 5:03pm

This is a kernel module I cooked in a couple of days. The idea is to expose a v4l device that gets its data from user space.

I had 2 use cases in mind:
1) Educational purpose for myself (I'm really a kernel noob).
2) Streaming movies over skype, google talk, ... etc.

The idea could be good or completely rubbish but hey ? Learning can only be done with stupid ideas!

The code is highly unstable. It shouldn't oops the kernel but I'm not responsible. I've been developing and testing it inside qemu.

Clone it from the git repository via:

git clone git@gitorious.org:vcamera/vcamera.git

Here are a few missing bits off the top of my head:

* I'm not following the kernel coding style yet ;-)
* I'm sure my locking, unlocking and concurrency handling is flawed.
* The code is a bit fragile.
* It'd be nice to implement mmap support for the character device. This should eliminate data copies.
* Perhaps expose the character device all the time and generate "fake" frames when streaming starts ? Problem now is one has to be very fast in feeding data to the module otherwise select() on the v4l device will timeout.
* Many more...

If someone finds this idea useful, please drop me a line.
Comments, use cases, ideas and tips are really welcomed!

If I see a lot of interest, I might try to push it to the kernel tree one day ;-)

Update: Seems vloopback already exists and renders my code useless. I might still do something with it as my idea seems a bit simpler but whatever.

Update 2: There's also v4l2loopback and its fork.


Bye fglrx...

Submitted by msameer on Thu, 09/04/2009 - 7:59pm

Thanks to all the hard work by the fglrx packaging team, DRI, MESA, Xorg, Radeon,... etc people!

I've been using fglrx with my laptop since I've had it:

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X1400

And to the people behind the Debian packaging..
* xserver-xorg-video-radeon from testing.
* libdrm-intel1 and libdrm2 from unstable
* libgl1-mesa-dri and libgl1-mesa-glx from experimental

vader:~# apt-get --purge remove fglrx-driver fglrx-kernel-src fglrx-kernel-2.6.26-1-686 fglrx-sourceReading package lists... Done
Building dependency tree      
Reading state information... Done

The following packages will be REMOVED:
   fglrx-driver* (9-2-2)
   fglrx-kernel-2.6.26-1-686* (9-2-2+2.6.26-13)
   fglrx-kernel-src* (9-2-2)
   fglrx-source* (9-2-2)
0 upgraded, 0 newly installed, 4 to remove and 17 not upgraded.
After this operation, 38.8MB disk space will be freed.
Do you want to continue [Y/n]?

I probably lost the ability to suspend and resume but I don't usually do it with that laptop.

Now let's hope my lapop at work will be adapted easily too :)

UPDATE: Seems you lose OpenGL 2.0 if you use the free driver. If you are doing OpenGL stuff like me then you are in trouble ;-|


Katoob, the baby has a new father.

Submitted by msameer on Mon, 12/05/2008 - 7:31pm

This post has a bit of my history and emotions. It can be skipped!

The summary is: Katoob has a new maintainer.

...

Yes, a long time.

Back in 2002, Gtk 2.x was just released. Efforts were spent porting, rewriting and redesigning parts of GNOME. The aim was GNOME 2.0 and later on 2.x

Previously, we had Gtk which did not support Arabic at all.
At that time, the only usable Arabic capable GUI editor was a closed source one, Axmedit. I was also trying to learn programming and write something useful. Katoob was born at that time. The aim ? provide the Arabic user with something usable and the secret agenda was me learning Gtk and get my hands dirty with C. Not having enough skills to contribute to something as large as GNOME.

It wasn't called Katoob (Which means something like an exaggerated writer in arabic). Me and Alaa wanted to call it gDhad (G is for GNU, Gtk, GPL, ... and Dhad is the letter. Arabic is known as the language of "dhad") but a miscommunication lead to that name.

Arabeyes hosted the project in the beginning. The problem was it was released after the first version of GNOME2. I missed a contest.

The problem is that it was already used by a few of my friends. A lot of testing has been done in the beginning. I still remember feeding it various media files as well as random garbage to see what will happen.

Years later, the whole thing grew into a pile of spaghetti code. It was the time for me to start learning C++. What else can I use to learn it ?
Then 0.5 was born. A bit cleaner, C++, Gtkmm and moving it to my own place. It even survived my migration from CVS to SVN last year.

It also started to be used by more people.

As I become busier with work and as my interests have started to change, I found myself incapable of maintaining it. It's actually a motivation problem more than anything else. I'm not involved into Arabization issues (I was never involved but people claimed I was ;-)) and I wasn't getting enough testing.

I don't use it a lot anymore. Everything supports Arabic now. I don't think we need that project anymore.
I can also use Emacs to read and write Arabic

Now, Fred Morcos decided to step up and maintain it. Good luck to him. At least I found someone to take care of the baby.


I love KDE. It just works!

Submitted by msameer on Fri, 25/01/2008 - 5:13pm

I have 2 laptops. My personal one at home and my work one at the office. Both are running testing. A month or two ago, I did a dist-upgrade on the home one. Later on I rebooted (DUH!) it for a reason I can't remember just to end up with very tiny fonts under GNOME. It took me some time to tweak them back again and play with the GNOME anti-aliasing dialog. Now if you know me well, you know that the last thing someone should do to me is to touch my font settings. I have a very sensitive eye (Because I have a very low vision) and I hardly tweak the fonts. All went somehow fine after that. Problem is I wasn't sure whether it was fglrx or GNOME who's responsible for that.

I always do a dist-upgrade everyday (!) but never bother to restart X or reboot. A few days ago, GNOME at the office crashed on me and guess what ? I ended up with the same problem again. Fonts. Tried tweaking it this time but no use. Copying the font settings from the other laptop was not an option because I'm using a large LCD at work but I can't afford to buy one for my personal laptop :-)

I thought it was fglrx, downgraded the driver but no use.

I decided that's it. I always used GNOME because I know Gtk+, gtkmm and somehow pygtk but the fonts breaking again was really too much.

I ended up switching back to KDE 3.x at work and at home. I just don't feel like using 2 different environments. This will confuse me ;-)

I remember I used KDE 1, GNOME 1.4, KDE 2.2, window maker, GNOME2, tried all the window managers out there until I settled with pekwm, hpanel, a few dockapps and that was my custom assembled DE. Until I switched to amd64 and the version I was using of pekwm (It was a CVS snapshot) started throwing exceptions. I wasn't really sure why and didn't have time to fix it. I wanted my laptop to be up and running again. I ended up trying the latest release but it did not work with hpanel (It was a hacked version because it wasn't originally working fine). and that's why I went back to GNOME.

Anyway, No flame please but KDE just rocks, it just works! I'm still having problems with fonts under Konsole (Bye multi-gnome-terminal) but I just need to free a few hours to test all the fonts out there.
Amarok works fine although the UI is a bit "cluttered" (But I managed to get it to crash :-))
I remember my phone complaining about not being correctly unmounted and warning about data corruption whenever I unplug it from the USB cable after asking GNOME to unmount it, KDE simply doesn't have this problem. The bad thing is that they removed "panel icons zooming upon mouse hover" but the tooltips are large and clear. Of course Arabic is still not that good under Konsole but I'd blame myself for that :-)

Konqueror is crappy as usual. I'm still using Opera :-(

Well done KDE team, Debian KDE team, GNOME team and Debian GNOME KDE team.

Thanks for the fish :-)

Now I guess I need to get myself familiar with the KDE/Qt API.


More packages for Chinook.

Submitted by msameer on Sun, 16/12/2007 - 2:47am

I was trying to package hunspell-ar for Chinook so I ended up packaging:
* hunspell (libhunspell and its development headers)
* enchant (hunspell and ispell providers but I'll disable ispell soon)
* hunspell-ar
* dictionaries-common and dictionaries-common-dev (hunspell-ar depends on them)

As for dictionaries-common and dictionaries-common-dev, they are different than the Debian ones. Yes I'm using the same source but I'm only providing the bits related to myspell. I didn't include the policy too.

uri = ftp://foolab.org/pub/apt
dist = chinook
components = spell

him-arabic is also available as well as a few Arabic fonts:

uri = ftp://foolab.org/pub/apt
dist = chinook
components = arabic

hildon input method and new languages...

Submitted by msameer on Fri, 14/12/2007 - 5:25pm

I noticed this because of my work on him-arabic.

If your plugin provides a language other than the 16 "known" languages, It will be displayed as " ()".

Ideally, The fix should be somewhere else but not all of the components are open so even if I can fix it, I won't be able to publish patches or packages.

It seems that the source provided with the SDK is a bit outdated so I had to grab the latest trunk: https://stage.maemo.org/svn/maemo/projects/haf/trunk/hildon-input-method/

And here's a patch. It'll return the language code if it fails to get the language description. (I know it's a bit hackish :|):

diff -Naur him.orig/src/hildon-im-languages.c him/src/hildon-im-languages.c
--- him.orig/src/hildon-im-languages.c  2007-12-14 19:09:29.000000000 +0200
+++ him/src/hildon-im-languages.c       2007-12-14 19:12:31.000000000 +0200
@@ -82,7 +82,18 @@
   }
   if (translate_function)
   {
-    return (*translate_function) (lang);
+    gchar *res = (*translate_function) (lang);
+    if (!res) {
+      return res;
+    }
+    else if (!strcmp(res, " ()")) {
+      g_free(res);
+      res = g_strdup(lang);
+      return res;
+    }
+    else {
+      return res;
+    }
   } else
   {
     gchar path [sizeof(GCONF_TRANSLATION_STATIC_PATH) + MAX_LANG_LENGTH];

Apply, build the packages and install hildon-input-method_1.99.33-2_armel.deb and libhildon-im-ui3_1.99.33-2_armel.deb

I hope it will be fixed otherwise I'll be providing packages soon. I know I promised to provide a lot of things (-:

Have a nice weekend.


My Arabic related TODO list for maemo

Submitted by msameer on Tue, 04/12/2007 - 5:45pm

This is my Arabic related TODO list for maemo. It's my personal one not the Nokia employee one :-)

* katoob should be fully functional (I'm learning here). Actually I did more work today and I guess it's fine.
* Package and publish some Arabic fonts (I know there's one provided by the browser team).
* See what can be done regarding input (Low priority. Sorry to say that I don't like the HIM plugin interface).
* Check arabeyes.org apps. Is there anything useful and needs "porting" ?
* glibc/x11 Arabic locale ?
* Any suggestions ?

I'll not translate the UI for 3 reasons:
* I'm not of a translator.
* The license you agree to while downloading the OS image prevents me from doing that.
* Because we are using logical IDs in the code, we will f*** up the UI unless all of the strings are translated.


Hello, Planet\n

Submitted by msameer on Wed, 14/03/2007 - 12:31am

Thanks to all the people volunteering their time for Debian and FOSS, to my sponsors, to anyone who gave me a tip and to those involved in the NM process.

I'm now a proud DD!


So yesterday.

Submitted by msameer on Wed, 14/03/2007 - 12:00am

* A month since I've been here in Finland and started working for Nokia
* I've got my creditcard PIN code in the morning (From the nordea bank suckers). At last they accepted my application but they decided to send the card to the wrong branch. 7 minutes on the phone to convince them to send it to another branch. It takes them also 2-3 days to send it to another branch!
* My debian.org account has been created and NOW I'm at last an official Debian Developer (Technically, this happened on the 14th. An hour ago ;-))