Clique HUE HD with reasonable picture

22 views
Skip to first unread message

Daniel Holth

unread,
Feb 9, 2009, 7:02:13 PM2/9/09
to micr...@googlegroups.com
Thank you for the tips. After some trial and error I got this reasonable picture. There is still some fringing. Should I expect any better?

It looks the same if the hstart is 2 instead of 6.

Daniel Holth
0x4300.png
0001-fixes-for-Hue-HD.patch

Daniel Holth

unread,
Feb 9, 2009, 7:15:25 PM2/9/09
to microdia
I hadn't noticed the black line to the right of the image. hstart = 0
fixes that.

It's not better than my Sony EyeToy. Oh well.

Daniel

Brian Johnson

unread,
Feb 9, 2009, 8:26:12 PM2/9/09
to micr...@googlegroups.com
Wow thats nice so this means we finally have a correct patch that
seems to fix the color issues with the mt9m111 sensors now.

So other then this sensor do we have any other sensors we kno of that
have code in the driver but dont work right?

Kesava Chandran

unread,
Feb 10, 2009, 9:57:20 AM2/10/09
to micr...@googlegroups.com
Hi,
Congrats I think yours is an understatement.0x4300.png shows good
definition,fine colour balance,lot of depth,all the more reason for a
hearty hand shake from me Sorry if I have butted in
Good show, keep it up--.kesava.

Daniel Holth

unread,
Feb 10, 2009, 10:34:05 AM2/10/09
to microdia
On Feb 10, 9:57 am, Kesava Chandran <chandran.kes...@gmail.com> wrote:
> Hi,
> Congrats I think yours is an understatement.0x4300.png shows good
> definition,fine colour balance,lot of depth,all the more reason for a
> hearty hand shake from me Sorry if I have butted in
> Good show, keep it up--.kesava.

Thanks! I was hoping for a consistent 30 frames per second with no
dead pixels (should I turn off autoexposure [with a v4l control
program instead of source code edits]?), but I am happy because the
camera was extremely inexpensive. And great Linux support! ;-)

It seems buggy if the camera is unplugged while video capture is
taking place, something that happens easily enough by accident while
aiming the camera while it's plugged into its base. After enough tries
doing this I get a zombie mplayer process and a module that can no
longer be removed. Could that be handled more gracefully?

Derek Monner

unread,
Feb 10, 2009, 10:41:52 AM2/10/09
to microdia
Daniel,

Thanks very much for this patch! I can confirm that this works with my
Hue HD as well -- best picture I've seen yet.

--Derek

GWater

unread,
Feb 10, 2009, 10:48:00 AM2/10/09
to microdia, Vincenzo Bruno
> --~--~---------~--~----~------------~-------~--~----~
> Lets make microdia webcams plug'n play, (currently plug'n pray)
> To post to this group, send email to micr...@googlegroups.com
> Visit us online https://groups.google.com/group/microdia
> -~----------~----~----~----~------~----~------~--~---

The MT9M001 code in current origin/master is useless - but after a long trial
and error process there are some improvements (from no video at all to very
bad video). Patch and result are attached

(I just noticed that this discussion wnt off-list somehow. I'll move it back
where it belongs. Here!)

vbruno: I hope it's ok to post your image here - I figure your face is so
distorted it can't be used for ID purposes anyway ;) . Please make sure you
answer to this mail to micr...@googlegroups.com .

GWater

0001-Remove-MT9M001-code.patch
0002-Update-and-extend-MT9M111-code.patch
0003-Add-sensor-MT9M001.patch
0004-Move-externs-for-sensor-init-arrays-to-sensor-header.patch
schermata1.png_[Cs4697].png
signature.asc

Daniel Holth

unread,
Feb 10, 2009, 10:57:42 AM2/10/09
to microdia
That picture looks exactly like what I started with.

To be fair to my camera and its dead pixels, according to the
datasheet it looks like the MT9M111 sensor has defect correction and
scaling logic that could be enabled with a few more entries into the
initialization sequence, and the saturation of the image can be
adjusted with another register.

How about supporting the button on the back of the camera? In Windows
the user would see the 640x512 picture of themselves, and then when
they pressed the button a 1280x1024 still would be captured. Does v4l2
provide for that?

GWater

unread,
Feb 10, 2009, 11:02:35 AM2/10/09
to micr...@googlegroups.com
> --~--~---------~--~----~------------~-------~--~----~
> Lets make microdia webcams plug'n play, (currently plug'n pray)
> To post to this group, send email to micr...@googlegroups.com
> Visit us online https://groups.google.com/group/microdia
> -~----------~----~----~----~------~----~------~--~---

V4L2 doesn't offer still image capturing. But you can use the button for any
other feature (en- and disable gain, etc.) you want.

GWater

signature.asc

Brian Johnson

unread,
Feb 10, 2009, 11:24:45 AM2/10/09
to micr...@googlegroups.com
Since this patch has been confirmed to fix the mt9m111 issues i have
no push it out to the main repository.

GWater

unread,
Feb 10, 2009, 11:37:13 AM2/10/09
to micr...@googlegroups.com
Am Dienstag 10 Februar 2009 16:57:42 schrieb Daniel Holth:
> --~--~---------~--~----~------------~-------~--~----~
> Lets make microdia webcams plug'n play, (currently plug'n pray)
> To post to this group, send email to micr...@googlegroups.com
> Visit us online https://groups.google.com/group/microdia
> -~----------~----~----~----~------~----~------~--~---

rebased patches for new origin/master HEAD.

GWater

0001-Add-sensor-MT9M001.patch
0002-Move-externs-for-sensor-init-arrays-to-sensor-header.patch
signature.asc

Daniel Holth

unread,
Feb 10, 2009, 12:04:54 PM2/10/09
to microdia
> V4L2 doesn't offer still image capturing. But you can use the button for any
> other feature (en- and disable gain, etc.) you want.
>
> GWater

Would you handle that inside the driver? Or could it be reasonably
presented to userspace as a HID joystick with only 1 button?

GWater

unread,
Feb 10, 2009, 12:09:00 PM2/10/09
to micr...@googlegroups.com
> --~--~---------~--~----~------------~-------~--~----~
> Lets make microdia webcams plug'n play, (currently plug'n pray)
> To post to this group, send email to micr...@googlegroups.com
> Visit us online https://groups.google.com/group/microdia
> -~----------~----~----~----~------~----~------~--~---

For my webcam we did it in the driver - the infrastructure is there. But
hardcoded.

GWater

signature.asc

Brian Johnson

unread,
Feb 10, 2009, 12:45:19 PM2/10/09
to micr...@googlegroups.com
Here is a modified version of the mt9m001 patch that removes the many
duplicate writes and cleans things up a bit. Anyone with the mt9m001
sensor test and see if it works any better

On Tue, Feb 10, 2009 at 11:37 AM, GWater <grew...@googlemail.com> wrote:
> Am Dienstag 10 Februar 2009 16:57:42 schrieb Daniel Holth:
>> That picture looks exactly like what I started with.
>>
>> To be fair to my camera and its dead pixels, according to the
>> datasheet it looks like the MT9M111 sensor has defect correction and
>> scaling logic that could be enabled with a few more entries into the
>> initialization sequence, and the saturation of the image can be
>> adjusted with another register.
>>
>> How about supporting the button on the back of the camera? In Windows
>> the user would see the 640x512 picture of themselves, and then when
>> they pressed the button a 1280x1024 still would be captured. Does v4l2
>> provide for that?
>> >
0001-Add-sensor-MT9M001.patch

vbr...@gmail.com

unread,
Feb 11, 2009, 7:27:57 AM2/11/09
to microdia
Sorry,
but I did not understand what I want to try the cam.

Can someone explain what I do, now, please?

I have a cam with the mt9m001 sensor.

vbr...@gmail.com

unread,
Feb 10, 2009, 6:22:46 PM2/10/09
to microdia
Hi, people
then, I delete the folder Microdia.

I downloaded again the folder Microdia and I added the patch by Brian
Johnson.

I run the following commands:
make
sudo modprobe videodev
sudo modprobe compat-ioctl32
sudo insmod sn9c20x.ko

vincenzo@vinicio:~/microdia$ LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so
mplayer tv:// \-tv driver=v4l2:width=640:height=480:fps=25:device=/dev/
video0 -vo x11
ERROR: ld.so: object '/usr/lib/libv4l/v4l2convert.so' from LD_PRELOAD
cannot be preloaded: ignored.
MPlayer 1.0rc2-4.2.3 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) III Mobile CPU 1200MHz (Family: 6,
Model: 11, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote
control.

Playing tv://.
TV file format detected.
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski <olsch...@zpr.uni-koeln.de>
comment: first try, more to come ;-)
Selected device: SN9C20x USB 2.0 Webcam Driver
Capabilites: video capture read/write streaming
supported norms:
inputs: 0 = Webcam;v4l2: ioctl get input failed: Invalid argument

Current input: 1
Current format: unknown (0x30323953)
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
xscreensaver_disable: Could not find XScreenSaver window.
ERROR: ld.so: object '/usr/lib/libv4l/v4l2convert.so' from LD_PRELOAD
cannot be preloaded: ignored.
ERROR: ld.so: object '/usr/lib/libv4l/v4l2convert.so' from LD_PRELOAD
cannot be preloaded: ignored.
==========================================================================
Cannot find codec matching selected -vo and video format 0x30323953.
Read DOCS/HTML/en/codecs.html!
==========================================================================

v4l2: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 0 frames dropped.

Exiting... (End of file)
vincenzo@vinicio:~/microdia$

The window of mplayer did not open.
I tried with skype and cheese, but cam is not working.

Maybe I have something wrong.
What advice?

Bye
Vincenzo.




On 10 Feb, 18:45, Brian Johnson <brij...@gmail.com> wrote:
> Here is a modified version of the mt9m001 patch that removes the many
> duplicate writes and cleans things up a bit. Anyone with the mt9m001
> sensor test and see if it works any better
>
> On Tue, Feb 10, 2009 at 11:37 AM, GWater <grewa...@googlemail.com> wrote:
> > Am Dienstag 10 Februar 2009 16:57:42 schrieb Daniel Holth:
> >> That picture looks exactly like what I started with.
>
> >> To be fair to my camera and its dead pixels, according to the
> >> datasheet it looks like the MT9M111 sensor has defect correction and
> >> scaling logic that could be enabled with a few more entries into the
> >> initialization sequence, and the saturation of the image can be
> >> adjusted with another register.
>
> >> How about supporting the button on the back of the camera? In Windows
> >> the user would see the 640x512 picture of themselves, and then when
> >> they pressed the button a 1280x1024 still would be captured. Does v4l2
> >> provide for that?
>
> > rebased patches for new origin/master HEAD.
>
> > GWater
>
>
>
>  0001-Add-sensor-MT9M001.patch
> 3KVisualizzaScarica

GWater

unread,
Feb 11, 2009, 3:41:14 PM2/11/09
to micr...@googlegroups.com
> --~--~---------~--~----~------------~-------~--~----~
> Lets make microdia webcams plug'n play, (currently plug'n pray)
> To post to this group, send email to micr...@googlegroups.com
> Visit us online https://groups.google.com/group/microdia
> -~----------~----~----~----~------~----~------~--~---

The path to v4l2convert.so was not correct. Tither it is not installed or the
location is different. Maybe
/usr/local/lib/libv4l/v4l2convert.so
?

GWater

signature.asc

Vincenzo Bruno

unread,
Feb 11, 2009, 6:31:00 PM2/11/09
to micr...@googlegroups.com
Sorry,

Ok, but ....

vincenzo@vinicio:~/microdia$ LD_PRELOAD=/usr/local/lib/libv4l/v4l2convert.so mplayer tv:// \-tv driver=v4l2:width=640:height=480:fps=25:device=/dev/video0 -vo x11
mplayer: error while loading shared libraries: libv4l2.so.0: cannot open shared object file: No such file or directory
vincenzo@vinicio:~/microdia$ cd /usr/local/lib/libv4l/
vincenzo@vinicio:/usr/local/lib/libv4l$ ls
v4l1compat.so  v4l2convert.so
vincenzo@vinicio:/usr/local/lib/libv4l$ cd ..
vincenzo@vinicio:/usr/local/lib$ ls
libv4l  libv4l1.so  libv4l1.so.0  libv4l2.so  libv4l2.so.0  libv4lconvert.so  libv4lconvert.so.0  pkgconfig  python2.4  python2.5  site_ruby
vincenzo@vinicio:/usr/local/lib$

I do not know what to do with this error....









vbr...@gmail.com

unread,
Feb 12, 2009, 4:14:18 AM2/12/09
to microdia
I solved by running as root: ldconfig /usr/local/lib/

But now with

vincenzo@vinicio:~$ LD_PRELOAD=/usr/local/lib/libv4l/v4l2convert.so
mplayer tv:// \-tv driver=v4l2:width=640:height=480:fps=25:device=/dev/
video0 -vo x11
MPlayer 1.0rc2-4.2.3 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) III Mobile CPU 1200MHz (Family: 6,
Model: 11, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote
control.

Playing tv://.
TV file format detected.
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski <olsch...@zpr.uni-koeln.de>
comment: first try, more to come ;-)
Selected device: SN9C20x USB 2.0 Webcam Driver
Capabilites: video capture read/write streaming
supported norms:
inputs: 0 = Webcam;v4l2: ioctl get input failed: Invalid argument

Current input: 1
Current format: unknown (0x4745504a)
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
xscreensaver_disable: Could not find XScreenSaver window.
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 640 x 480 (preferred colorspace: Planar
YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [x11] 640x480 => 640x480 Planar YV12
[swscaler @ 0x89348f0]SwScaler: using unscaled yuv420p -> rgb32
special converter
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
==========================================================================
Audio: no sound
Starting playback...
libv4lconvert: Error decompressing JPEG: fill_nbits error: need 1 more
bits
libv4lconvert: Error decompressing JPEG: fill_nbits error: need 1 more
bits
libv4lconvert: Error decompressing JPEG: fill_nbits error: need 1 more
bits
libv4lconvert: Error decompressing JPEG: fill_nbits error: need 1 more
bits
.....

The picture is green again ---> http://groups.google.com/group/microdia/web/schermata3.png

GWater

unread,
Feb 12, 2009, 10:19:33 AM2/12/09
to micr...@googlegroups.com
> --~--~---------~--~----~------------~-------~--~----~
> Lets make microdia webcams plug'n play, (currently plug'n pray)
> To post to this group, send email to micr...@googlegroups.com
> Visit us online https://groups.google.com/group/microdia
> -~----------~----~----~----~------~----~------~--~---

Then Brian's patch broke it. My old patch should still work and we can still
use it to fix the remaining problems. (Like alien-colours, etc.)

GWater

signature.asc

Daniel Holth

unread,
Feb 13, 2009, 12:13:13 PM2/13/09
to microdia
The framerate is great during the day when there's lots of light.

The existing initialization parameters appear to enable automatic defect correction. I've decided I like the colors better when I add

/* saturation to 150% */
{0x25, 0x0029},

to the MT9M111 initialization sequence (saturation is adjustable from black and white all the way to 150%). I still get stray colors on edges, that might be tweakable with sharpness settings, but I doubt my relatives will notice after Skype applies its fierce compression.

Is there a way to poke the camera's i2c bus without having to recompile the driver every time?

Thanks!

Daniel Holth
0x25_0x0029.png

JoJo jojo

unread,
Feb 13, 2009, 1:22:36 PM2/13/09
to micr...@googlegroups.com
Hi Daniel

On Fri, Feb 13, 2009 at 10:43 PM, Daniel Holth <dho...@gmail.com> wrote:
> The framerate is great during the day when there's lots of light.
>

auto-exposure is funky that way, disable it & enable max. exposure
seems to help FPS!

> The existing initialization parameters appear to enable automatic defect
> correction. I've decided I like the colors better when I add
>
> /* saturation to 150% */
> {0x25, 0x0029},
>
> to the MT9M111 initialization sequence (saturation is adjustable from black
> and white all the way to 150%). I still get stray colors on edges, that
> might be tweakable with sharpness settings, but I doubt my relatives will
> notice after Skype applies its fierce compression.
>

saturation can be controlled at sensor & bridge level, better set
sensor to max. saturation,
and handle the control via bridge, then all models can use it.

> Is there a way to poke the camera's i2c bus without having to recompile the
> driver every time?
>

yup! there's even a page on it,
https://groups.google.com/group/microdia/web/microdia-debugfs

> Thanks!
>
> Daniel Holth
>


-JoJo

Message has been deleted

GWater

unread,
Feb 21, 2009, 11:51:31 AM2/21/09
to micr...@googlegroups.com
Am Dienstag 17 Februar 2009 16:50:04 schrieb Howard Ranyard:
> Seems im having some problems patching. Which patches and what order
> should i use to get the best chance of this working with my hue cam.
>

If you got your copy of our driver recently via git you don't need the patch.
All the changes are already included.

GWater

signature.asc
Reply all
Reply to author
Forward
0 new messages