Test Pattern Generator configuration

Has anybody tried to configure the TPG in the CSI unit of Tegra K1? I’m trying using the default values provided in the tegra camera driver. But I’m unable to get a correct frame. Anybody else having any luck?

I’m assuming that TEGRA_VI_CSI_0_SURFACE0_OFFSET_MSB and TEGRA_VI_CSI_0_SURFACE0_OFFSET_LSB are the registers where you specify the location where the output of VI channel is stored. Am I correct?

The “soc_camera host” tegra_camera module can already (and only) work in TPG mode:

modproble -r nvhost-vi
echo 0 > /sys/class/graphics/fb0/blank
modprobe tegra_camera tpg_mode=1

Hence you mat get something from reading its source code.

You can then grab a frame with, for instance, yavta (http://git.ideasonboard.org/yavta.git):

yavta /dev/video0 -c1 -n1 -s1280x720 -fRGB32 -Ftpg.rgba

Please update us if you get something.

Hi, I tried the exact same commands you have mentioned, but the output file that I get contains only zeros when I checked with a hex viewer. The output file size is 3686400 bytes which seems to be correct for the mentioned resolution and format (with alpha channel).

This is the output i get on my device.

ubuntu@tegra-ubuntu:~$ yavta /dev/video0 -l
Device /dev/video0 opened.
Device `vi' on `' is a video output (without mplanes) device.
No control found.
Video format: RGB32 (34424752) 1280x720 (stride 5120) field none buffer size 3686400
ubuntu@tegra-ubuntu:~$ cat /sys/module/tegra_camera/parameters/tpg_mode 
1
ubuntu@tegra-ubuntu:~$ yavta /dev/video0 -c1 -n1 -s1280x720 -fRGB32 -Ftpg.rgba
Device /dev/video0 opened.
Device `vi' on `' is a video output (without mplanes) device.
Video format set: RGB32 (34424752) 1280x720 (stride 5120) field none buffer size 3686400
Video format: RGB32 (34424752) 1280x720 (stride 5120) field none buffer size 3686400
1 buffers requested.
length: 3686400 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0xb62cd000.
0 (0) [-] none 0 3686400 B 1411563408.134773 241.274778 0.001 fps ts mono/EoF
Captured 1 frames in 0.000017 seconds (57411.872775 fps, 211643127798.828827 B/s).
1 buffers released.

Have you tried these commands and obtained correct TPG frame data in your board?

This is strange. I used to be able to get the expected test pattern with that commands, but now, after I reflashed my Jetson, it is not working…

I have 2 Jetsons. Both recently flahed. One works with this commands, the other do not… :?

Ok, my bad. I’ve found the problem for my case:

I was doing

echo 0 > sudo tee /sys/class/graphics/fb0/blank

which does nothing.
I should had done

echo 0 | sudo tee /sys/class/graphics/fb0/blank

(notice de the pipe) or run as root, and be sure

cat /sys/class/regulator/regulator.10/state

is enabled.

Check that you too.

BTW, tpg_mode=2 gives a nicer patter.

Ok. I’ll try and update immediately.

Yes, we are able to obtain TPG data in both modes. Thank you. It seems that enabling the regulator did the trick. How did you figure it out? Is it mentioned in any document?

Instead of doing this, you can directly enable the required regulator using sysfs entries as root user.

echo enabled > /sys/class/regulator/regulator.10/state

Yes, the regulator 10 named LDO2 (/sys/class/regulator/regulator.10/name) is related to CSI in the “Jetson TK1 Schematics” document.

The “/sys/class/graphics/fb0/blank” I read from somewhere I can’t remember.