[Letux-kernel] GTA04 camera driver

H. Nikolaus Schaller hns at goldelico.com
Mon Apr 17 23:19:26 CEST 2017


> Am 16.04.2017 um 19:40 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> 
> 
>> Am 16.04.2017 um 17:34 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>> 
>> Hi,
>> I think I am a little closer to finding the issue(s)...
>> 
>> First of all I observed that although power is properly
>> turned on (ov965x_s_power), there is no call to
>> ov965x_s_stream which IMO should turn on the video
>> stream. There is only a single call to ov965x_get_fmt()
>> as the only other activity after ov965x_s_power()
>> and before I stop mplayer (which calls ov965x_s_power()
>> to turn the camera module off). In log lines:
>> 
>> [  620.049804] ov965x_s_power: on: on
>> [  620.352020] ov965x_get_fmt(which=1)
>> [  628.761810] ov965x_s_power: on: off
>> 
>> Therefore, I have looked into the isp code where the
>> camera should be turned on. It looks like this is
>> done in isp_video_streamon().
>> 
>> Now some prinkt in isp_video_streamon() show that it
>> returns -EPIPE. Which appears as if it is not reported
>> to userspace and makes mplayer show a green screen.
>> 
>> 
>> [  620.049804] ov965x_s_power: on: on
>> [  620.147277] ov965x_write: 0x01 @ 0x09 (2)
>> [  620.151916] ov965x_write: 0x40 @ 0x15 (2)
>> [  620.157989] ov965x_write: 0x00 @ 0x11 (2)
>> [  620.162658] ov965x_write: 0x4a @ 0x6B (2)
>> [  620.178619] ov965x_write: 0x40 @ 0x0F (2)
>> [  620.183166] ov965x_write: 0x05 @ 0x3B (2)
>> [  620.200469] ov965x_write: 0xc0 @ 0x40 (2)
>> [  620.216857] ov965x_write: 0x50 @ 0x31 (2)
>> [  620.222351] ov965x_write: 0x88 @ 0x3A (2)
>> [  620.261779] isp_video_mmap()
>> [  620.268737] isp_video_mmap()
>> [  620.348297] isp_video_streamon()
>> [  620.352020] ov965x_get_fmt(which=1)
>> [  620.358184] isp_video_streamon() err -32
>> 
>> ^^^^
>> vvvv ctrl-C to kill mplayer after some seconds
>> 
>> [  628.746398] isp_video_release()
>> [  628.749755] isp_video_streamoff()
>> [  628.761810] ov965x_s_power: on: off
>> 
>> 
>> This is now a very specific symptom ready for further
>> study...
>> 
>> Please keep fingers crossed that we can use this info
>> to find out why the module isn't showing a video...
> 
> First issue is identified: the /root/camera-demo script does
> not tell the camera or the camera interface to use SXGA resolution.
> 
> That becomes known to the isp driver which refuses to approve
> the links/network/pipeline due to format mismatch.
> Therefore we get -EPIPE.
> 
> But there is another issue I have to find which still
> prevents link validation.

Ok, it was another bug in the media-ctl commands.

So no driver change was needed, but the camera-demo script had to
be fixed. To be precise: I have factored out a new camera-setup
script which was improved.

Unfortunately there is still no image from camera (although
signals are available on the data lines - I can see them with
my Oscilloscope).

If you want to test, install the letux-4.11-rc7 which has
all latest fixes.

Then run

/root/camera-demo $FORMAT

Currently these FORMAT names are recognized: sxga, sxga-old, vga-r, vga
(the naming scheme isn't very good and experimental...).

Interesting is that two of them give a "select timeout" with green
screen while the two others simply show a green screen and no such
console message. They just show some ? in the progress message.

- sxga and vga show the select-timeout
- sxga-old and vga-r have none

This means, something is different with them which makes the
select either timeout or not. It could be another hint for our
final bug or may be not.

For certain the camera module isn't programmed 100% well, but
we should already see some image since clocks and sync impulses
are there. At least on the DM3730 camera interface (I could not
yet check if the pinmux is correct - maybe I should try to do that).

BR,
Nikolaus



More information about the Letux-kernel mailing list