Re: Nokia N900 cameras -- pipeline setup in python (was Re: [RFC PATCH 00/24] Make Nokia N900 cameras working)

2016-06-22 Thread Pavel Machek
Hi!

I tried to capture 1.2Mpix images, then scale them down to 800x600
using hardware... and results were  kernel dying.

[12552.400146] [] (isp_video_start_streaming) from
[] (vb2_start_streaming+0x5c/0x154)
[12552.400146] [] (vb2_start_streaming) from []
(vb2_core_streamon+0x104/0x160)
[12552.400177] [] (vb2_core_streamon) from []
(isp_video_streamon+0x17c/0x27c)
[12552.400207] [] (isp_video_streamon) from []
(v4l_streamon+0x18/0x1c)
[12552.400238] [] (v4l_streamon) from []
(__video_do_ioctl+0x24c/0x2e8)
[12552.400268] [] (__video_do_ioctl) from []
(video_usercopy+0x110/0x600)
[12552.400299] [] (video_usercopy) from []
(v4l2_ioctl+0x98/0xb8)
[12552.400329] [] (v4l2_ioctl) from []
(do_vfs_ioctl+0x80/0x948)
[12552.400329] [] (do_vfs_ioctl) from []
(SyS_ioctl+0x64/0x74)
[12552.400360] [] (SyS_ioctl) from []
(ret_fast_syscall+0x0/0x3c)
[12552.400390] ---[ end trace b4627b34449829a7 ]---
[12552.400421] In-band Error seen by MPU  at address 0
[12552.400421] [ cut here ]
[12552.400451] WARNING: CPU: 0 PID: 3936 at
drivers/bus/omap_l3_smx.c:166 omap3_l3_app_irq+0xcc/0x124
[12552.400482] Modules linked in:
[12552.400482] CPU: 0 PID: 3936 Comm: mplayer Tainted: GW
4.6.0-177572-g501bb64-dirty #360
[12552.400512] Hardware name: Nokia RX-51 board

I did more experiments before, and usually it does not end like
this. Usually, when I set up capture with greater resolution than cca
800x600, I get 4 copies of image above each other.

If you know how to get images with greater resolution, let me know.

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Nokia N900 cameras -- pipeline setup in python (was Re: [RFC PATCH 00/24] Make Nokia N900 cameras working)

2016-06-22 Thread Sakari Ailus
Hi Pavel,

On Tue, Jun 21, 2016 at 08:05:49PM +0200, Pavel Machek wrote:
> Hi!
> 
> > > > First, I re-did pipeline setup in python, it seems slightly less hacky
> > > > then in shell.
> > > > 
> > > > I tried to modify fcam-dev to work with the new interface, but was not
> > > > successful so far. I can post patches if someone is interested
> > > > (mplayer works for me, but that's not too suitable for taking photos).
> > > > 
> > > > I tried to get gstreamer to work, with something like:
> > > 
> > > While trying to debug gstreamer, I ran v4l2-compliance, and it seems
> > > to suggest that QUERYCAP is required... but it is not present on
> > > /dev/video2 or video6.
> > 
> > It's not saying that it wouldn't be present, but the content appears wrong.
> > It should have the real bus information there rather than just "media".
> > 
> > See e.g. drivers/media/platform/vsp1/vsp1_drv.c . I suppose that should be
> > right.
> > 
> > Feel free to submit a patch. :-)
> 
> For now I'd not know what to change, sorry :-(. Perhaps we can debug
> it after the support is merged into mainline.

A single line change to change the bus field contents to the actual bus
address.

grep -A1 platform: drivers/media/platform/vsp1/vsp1_drv.c

> 
> Another weirdness:
> 
> yavta, on v4l-subdev12 :
> 
> control 0x00a40906 `Sensivity' min 0 max 0 step 1 default 0 current 65536.
> 
> Min and max being the same, I don't think I can control the
> sensitivity. I guess I'll have to provid  more light for the tests for
> now...

That control should be removed. I think I concluded its value is the same
for all the modes...

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Nokia N900 cameras -- pipeline setup in python (was Re: [RFC PATCH 00/24] Make Nokia N900 cameras working)

2016-06-21 Thread Pavel Machek
Hi!

> > > First, I re-did pipeline setup in python, it seems slightly less hacky
> > > then in shell.
> > > 
> > > I tried to modify fcam-dev to work with the new interface, but was not
> > > successful so far. I can post patches if someone is interested
> > > (mplayer works for me, but that's not too suitable for taking photos).
> > > 
> > > I tried to get gstreamer to work, with something like:
> > 
> > While trying to debug gstreamer, I ran v4l2-compliance, and it seems
> > to suggest that QUERYCAP is required... but it is not present on
> > /dev/video2 or video6.
> 
> It's not saying that it wouldn't be present, but the content appears wrong.
> It should have the real bus information there rather than just "media".
> 
> See e.g. drivers/media/platform/vsp1/vsp1_drv.c . I suppose that should be
> right.
> 
> Feel free to submit a patch. :-)

For now I'd not know what to change, sorry :-(. Perhaps we can debug
it after the support is merged into mainline.

Another weirdness:

yavta, on v4l-subdev12 :

control 0x00a40906 `Sensivity' min 0 max 0 step 1 default 0 current 65536.

Min and max being the same, I don't think I can control the
sensitivity. I guess I'll have to provid  more light for the tests for
now...

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Nokia N900 cameras -- pipeline setup in python (was Re: [RFC PATCH 00/24] Make Nokia N900 cameras working)

2016-06-20 Thread Sakari Ailus
Hi Pavel,

On Fri, Jun 17, 2016 at 07:12:14PM +0200, Pavel Machek wrote:
> Hi!
> 
> > First, I re-did pipeline setup in python, it seems slightly less hacky
> > then in shell.
> > 
> > I tried to modify fcam-dev to work with the new interface, but was not
> > successful so far. I can post patches if someone is interested
> > (mplayer works for me, but that's not too suitable for taking photos).
> > 
> > I tried to get gstreamer to work, with something like:
> 
> While trying to debug gstreamer, I ran v4l2-compliance, and it seems
> to suggest that QUERYCAP is required... but it is not present on
> /dev/video2 or video6.

It's not saying that it wouldn't be present, but the content appears wrong.
It should have the real bus information there rather than just "media".

See e.g. drivers/media/platform/vsp1/vsp1_drv.c . I suppose that should be
right.

Feel free to submit a patch. :-)

> 
> Any ideas? (Kernel is based on Ivaylo 's github tree, IIRC).
> 
> Thanks,
>   Pavel
> 
> pavel@n900:/my/v4l-utils/utils$ ./v4l2-compliance/v4l2-compliance -d 
> /dev/video6
> Driver Info:
>   Driver name   : ispvideo
>   Card type : OMAP3 ISP resizer output
>   Bus info  : media
>   Driver version: 4.6.0
>   Capabilities  : 0x8423
>   Video Capture
>   Video Output
>   Streaming
>   Extended Pix Format
>   Device Capabilities
>   Device Caps   : 0x0421
>   Video Capture
>   Streaming
>   Extended Pix Format
> 
> Compliance test for device /dev/video6 (not using libv4l2):
> 
> Required ioctls:
>   fail: v4l2-compliance.cpp(537): missing bus_info prefix 
> ('media')
>   test VIDIOC_QUERYCAP: FAIL
> 
> Allow for multiple opens:
>   test second video open: OK
>   fail: v4l2-compliance.cpp(537): missing bus_info prefix 
> ('media')
>   test VIDIOC_QUERYCAP: FAIL
>   test VIDIOC_G/S_PRIORITY: OK
> 
> pavel@n900:/my/v4l-utils/utils$ sudo ./v4l2-compliance/v4l2-compliance -d 
> /dev/video2
> Driver Info:
>   Driver name   : ispvideo
>   Card type : OMAP3 ISP CCDC output
> ...
> Compliance test for device /dev/video2 (not using libv4l2):
> 
> Required ioctls:
>   fail: v4l2-compliance.cpp(537): missing bus_info prefix 
> ('media')
>   test VIDIOC_QUERYCAP: FAIL
> 

-- 
Regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Nokia N900 cameras -- pipeline setup in python (was Re: [RFC PATCH 00/24] Make Nokia N900 cameras working)

2016-06-20 Thread Pavel Machek
On Fri 2016-06-17 19:12:14, Pavel Machek wrote:
> Hi!
> 
> > First, I re-did pipeline setup in python, it seems slightly less hacky
> > then in shell.
> > 
> > I tried to modify fcam-dev to work with the new interface, but was not
> > successful so far. I can post patches if someone is interested
> > (mplayer works for me, but that's not too suitable for taking photos).
> > 
> > I tried to get gstreamer to work, with something like:
> 
> While trying to debug gstreamer, I ran v4l2-compliance, and it seems
> to suggest that QUERYCAP is required... but it is not present on
> /dev/video2 or video6.
> 
> Any ideas? (Kernel is based on Ivaylo 's github tree, IIRC).

I got fcam-dev to grab jpeg-s from the camera. Unfortunately, 800x600,
no autogain, no autofocus. But lot of fun with memory management :-).

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Nokia N900 cameras -- pipeline setup in python (was Re: [RFC PATCH 00/24] Make Nokia N900 cameras working)

2016-06-17 Thread Pavel Machek
Hi!

> First, I re-did pipeline setup in python, it seems slightly less hacky
> then in shell.
> 
> I tried to modify fcam-dev to work with the new interface, but was not
> successful so far. I can post patches if someone is interested
> (mplayer works for me, but that's not too suitable for taking photos).
> 
> I tried to get gstreamer to work, with something like:

While trying to debug gstreamer, I ran v4l2-compliance, and it seems
to suggest that QUERYCAP is required... but it is not present on
/dev/video2 or video6.

Any ideas? (Kernel is based on Ivaylo 's github tree, IIRC).

Thanks,
Pavel

pavel@n900:/my/v4l-utils/utils$ ./v4l2-compliance/v4l2-compliance -d /dev/video6
Driver Info:
Driver name   : ispvideo
Card type : OMAP3 ISP resizer output
Bus info  : media
Driver version: 4.6.0
Capabilities  : 0x8423
Video Capture
Video Output
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x0421
Video Capture
Streaming
Extended Pix Format

Compliance test for device /dev/video6 (not using libv4l2):

Required ioctls:
fail: v4l2-compliance.cpp(537): missing bus_info prefix 
('media')
test VIDIOC_QUERYCAP: FAIL

Allow for multiple opens:
test second video open: OK
fail: v4l2-compliance.cpp(537): missing bus_info prefix 
('media')
test VIDIOC_QUERYCAP: FAIL
test VIDIOC_G/S_PRIORITY: OK

pavel@n900:/my/v4l-utils/utils$ sudo ./v4l2-compliance/v4l2-compliance -d 
/dev/video2
Driver Info:
Driver name   : ispvideo
Card type : OMAP3 ISP CCDC output
...
Compliance test for device /dev/video2 (not using libv4l2):

Required ioctls:
fail: v4l2-compliance.cpp(537): missing bus_info prefix 
('media')
test VIDIOC_QUERYCAP: FAIL

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Nokia N900 cameras -- pipeline setup in python (was Re: [RFC PATCH 00/24] Make Nokia N900 cameras working)

2016-06-17 Thread Pavel Machek
Hi!

First, I re-did pipeline setup in python, it seems slightly less hacky
then in shell.

I tried to modify fcam-dev to work with the new interface, but was not
successful so far. I can post patches if someone is interested
(mplayer works for me, but that's not too suitable for taking photos).

I tried to get gstreamer to work, with something like:

class Camera:
gst="/usr/bin/gst-launch"
def __init__(m):
pass

def run(m):
if 0 != subprocess.call(
[m.gst, "-v", "--gst-debug-level=2",
# "v4l2src", "device=/dev/video2", "num-buffers=3", "!",
 
# "video/x-raw-yuv,width=864,height=656", "!",  
 
 "v4l2src", "device=/dev/video6", "num-buffers=3", "!",
 "video/x-raw-yuv,width=800,height=600,format=(fourcc)UYVY", 
"!",
# ,format=(fourcc)YU12  
 
 "ffmpegcolorspace", "!",
 "jpegenc", "!",
 "filesink", "location=delme.jpg" ]):


But could not get it to work so far.

Best regards,

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#!/usr/bin/python3

import subprocess
import os

class Camera:
mc="/my/v4l-utils/utils/media-ctl/media-ctl"
def __init__(m):
m.win_x, m.win_y = 800, 600
m.cap_x, m.cap_y = 864, 656
#m.cap_x, m.cap_y = 2592, 1968

def media_ctl(m, s):
if 0 != subprocess.call(['sudo', m.mc] + s):
print("Call ", s, " failed?")

def media_l(m, s):
m.media_ctl(['-l', s])

def media_v(m, s):
m.media_ctl(['-V', s])

def back(m):
m.media_ctl(['-r'])

m.media_l('"et8ek8 3-003e":0 -> "video-bus-switch":1 [1]')
m.media_l('"video-bus-switch":0 -> "OMAP3 ISP CCP2":0 [1]')
m.media_l('"OMAP3 ISP CCP2":1 -> "OMAP3 ISP CCDC":0 [1]')
m.media_l('"OMAP3 ISP CCDC":2 -> "OMAP3 ISP preview":0 [1]')
m.media_l('"OMAP3 ISP preview":1 -> "OMAP3 ISP resizer":0 [1]')
m.media_l('"OMAP3 ISP resizer":1 -> "OMAP3 ISP resizer output":0 [1]')

size = "%dx%d" % (m.cap_x, m.cap_y)
m.media_v('"et8ek8 3-003e":0 [SGRBG10 %s]' % size)
m.media_v('"OMAP3 ISP CCP2":0 [SGRBG10 %s]' % size)
m.media_v('"OMAP3 ISP CCP2":1 [SGRBG10 %s]' % size)
m.media_v('"OMAP3 ISP CCDC":2 [SGRBG10 %s]' % size)
m.media_v('"OMAP3 ISP preview":1 [UYVY %s]' % size)
m.media_v('"OMAP3 ISP resizer":1 [UYVY %dx%d]' % (m.win_x, m.win_y))

def perms(m):
os.system("sudo chmod 666 /dev/video? /dev/v4l-subdev*")

def run(m):
os.system("mplayer -tv driver=v4l2:width=%d:height=%d:outfmt=uyvy:device=/dev/video6 -vo x11 -vf screenshot tv://" % (m.win_x, m.win_y))

c = Camera()
c.back()
c.perms()
c.run()