Wednesday, October 01, 2014

enable csi camera on A20-SOM EVB

The csi camera on the debian image with kernel 3.4.79+ from olimex doesn't work. To make it works, we need to change the configuration in script.bin and /etc/modules. We must convert script.bin to script.fex using bin2fex tools to change the configuration.
olimex@a20-Lime2-SOM:~$ bin2fex script.bin script.fex
We will have script.fex file after that command. Open the file and change the value as below:
...
[csi0_para]
csi_used = 1
...
Convert back script.fex to script.bin.
olimex@a20-Lime2-SOM:~$ fex2bin script.fex script.bin
Add the following value in the /etc/modules file:
gt2005
sun4i_csi0 i2c_addr=0x78 ccm="gt2005"
After that, we can reboot the board. Wait a couple second, and voila...the csi camera will now work.
But there is still error message from the kernel log as follow:
[CSI_ERR]input index invalid!
Nevertheless, the csi camera works fine, if someone know how to solve this error, please let me know.



5 comments:

Deepak said...

Hi,

This information is very helpful. We are considering this board for our development. However, there is NOT much information about the camera and the hardware interface to the CSI or Parallel camera. Would it be possible to provide some pointers/inputs about the camera used and how it was connected and any other information/issues that one should be aware of to connect such camera?

Thanks and any input will be appreciated.

tmarlok said...

Hi,

I have a strange issue. If I put the modules into the /etc/modules file or load them through rc.local init script then the image is very green-ish (example: http://picpaste.com/web-cam-shot-W6WXunDH.jpg ). But if I load the sun4i_csi0 by hand (modprobe), then I see the correct colors.
Did anyone experienced anything similar?

Thanks in advance!

arieedzig said...

Hi,

Do you use the latest image from olimex?If yes, it might be a conflict. Latest image from olimex has enabled this feature. Or try to put it on the last line of /etc/modules

tmarlok said...

Hi, I tried with the 3.4.79+, 3.4.90+ even compiled a brand new kernel (3.4.103+) from git. I also tried it another identical board, still the same.
The sun4i_csi0 is in the last line in the /etc/modules (I even tried to load it with rc.local with a 60 sec sleep before the modprobe command).

I just find that if I start the ffmpeg while the "green state", I get this error message (dmesg):

[ 47.792902] [CSI_ERR]buffer count is invalid, set to 5
<6>[CSI]buffer_setup, buffer count=5, size=1382400
[ 47.802735] [CSI]buffer_setup, buffer count=5, size=1382400
<6>[CSI_ERR]No active queue to serve
[ 48.674898] [CSI_ERR]No active queue to serve
<6>[CSI_ERR]No active queue to serve
[ 48.805972] [CSI_ERR]No active queue to serve
<6>[CSI_ERR]No active queue to serve
[ 48.937044] [CSI_ERR]No active queue to serve

After I load the modules by hand, I get these:
[ 72.071463] [CSI_ERR]buffer count is invalid, set to 5
<6>[CSI]buffer_setup, buffer count=5, size=1382400
[ 72.081337] [CSI]buffer_setup, buffer count=5, size=1382400

without the "No active queue to serve" message.

arieedzig said...

Did you connect any uext device in uext2 port?I remember to have the same error with [CSI_ERR]No active queue to serve when connecting lcd board on it. But I am not sure with your problem, may be that could help, btw I use 3.4.79+ version.