Thursday, April 18, 2013

Compiling the Mali HW accelerated driver (xf86-video-fbdev for RK3066)


Expert Linux developer olegk0 has made a framebuffer driver for the RK30 HDMI with Mali acceleration (rk30fb_drv.so). You can just download and use his .so to have 3D acceleration, or you can follow these instructions to compile it yourself and help debug it.

Among other things, like 2D/3D, it allows playing fullscreen videos with far less CPU usage, leaving the processor just for what your app requires to decode the videos. With "app" I mean Parole, VLC or, my strong recommendation, the excellent commandline utility: mplayer (which immediately takes advantage of the HW acceleration).

The downside is that it still has some bugs, like turning everything in the screen black (except the played video). Just move the mouse or a window around and everything gets redrawn again.
Another bug is that the video output becomes mangled when the video window touches the left or right sides of the screen.

In any case I love to be able to watch movies/videos on this stick with Linux, so what I do is open a terminal and type:
mplayer whatever-video.avi
And screen turns black except the video, I move the mouse a bit around (which causes the black parts to be redrawn) to find the corners of the mplayer video window and make it big enough to cover most of the screen, just without touching either left or right sides of the screen.


In any case, if you would like to give us a helping hand debugging the XVideo implementation (my suspect is ./xf86-video-fbdev/src/video.c) just follow these steps to tinker with the code and compile the driver to see the changes:

git clone git://github.com/olegk0/xf86-video-fbdev.git
sudo apt-get install xserver-xorg-dev

We must then fix a dangling symlinked folder at "./xf86-video-fbdev/src/ump" pointing to "../../../../../r3p1/ump/include/ump"

So go to http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-ump-user-space-drivers-source-code-2/ and download the same revision (r3p1, until we get a first working driver; then we can try with a newer version), that is: Linux Kernel Device Driver r3p1-01rel1

Copy or symlink the uncompressed folder "./DX910-SW-99006-r3p1-01rel1/driver/src/ump/include/ump" to "./xf86-video-fbdev/src/ump"

And now just do:
./configure --prefix=/usr
make
sudo make install
There is a lot of debug information printed on /var/log/syslog every time you play a video with mplayer, which should help in the debugging.

Tuesday, April 16, 2013

3D HW acceleration on Picuntu Linux (Mali400)



I have ported olegk0's kernel (https://github.com/olegk0/rk3066-kernel) updates and Mali driver to Picuntu on my Picuntu kernel branch (https://github.com/Galland/picuntu-3.0.8-alok https://github.com/Galland/rk3x_kernel_3.0.36).

I'm testing and it seems very stable. glxgears reports now 85fps 3D, whereas before I was getting 5fps (3D in software), if I remember well. (glxgears is OpenGL, not OpenGL-ES, which is the HW accelerated one by Mali! thanks to Jean-Luc Aufranc for pointing it out) glmark2-es2 reports a glmark2 score of 80, and es2gears reports some 150fps.

Please note that Mali is the GPU on the RK3066, responsible for 2D/3D acceleration, not for HW video en/decoding! That's done by the VPU core, which is still unsupported.

Please note that, afaik, all of this is work done by olegk0 (see [1]) and I have just checked it does work on our Picuntu, so all cheers go to him, thanks for the great work, olegk0!

If you would like to test this too, grab my github kernel and follow the instructions on [1] or these Picuntu-targeted instructions here:

1) Get xorg.conf and place it on your Picuntu MicroSD's folder /etc/X11/

2) Get rk30fb_drv.so (or compile it yourself) and place it on your Picuntu MicroSD's folder /usr/lib/xorg/modules/drivers/

3) Modify /etc/rc.local by commenting (precede with #) existing lines that use "fbset" and adding the following new lines:
 fbset -rgba 8/16,8/8,8/0,8/24 -a
chmod 666 /dev/mali /dev/ump

4) Modify /etc/modules to add the following lines:
rk29-ipp
ump

disp_ump
mali
drm
mali_drm

5) Get the mali package, uncompress and install this file: mali400_2.1-13_armhf.deb

6) Run the following commands:


sudo mv /usr/lib/arm-linux-gnueabihf/mesa-egl/ /usr/lib/arm-linux-gnueabihf/.mesa-egl/ 
sudo ln -s /usr/lib/libMali.so /usr/lib/libEGL.so
sudo ln -s /usr/lib/libMali.so /usr/lib/libEGL.so.1.4
sudo ln -s /usr/lib/libMali.so /usr/lib/libGLESv1_CM.so
sudo ln -s /usr/lib/libMali.so /usr/lib/libGLESv1_CM.so.1.1
sudo ln -s /usr/lib/libMali.so /usr/lib/libGLESv2.so
sudo ln -s /usr/lib/libMali.so /usr/lib/libGLESv2.so.2.0



Then if you enter:        ll /usr/lib | grep libMali

The output should look something like this:
lrwxrwxrwx 1 root root 19 abr 16 17:58 libEGL.so -> /usr/lib/libMali.so
lrwxrwxrwx 1 root root 10 feb 22 02:06 libEGL.so.1.4 -> libMali.so
lrwxrwxrwx 1 root root 19 abr 16 17:58 libGLESv1_CM.so -> /usr/lib/libMali.so
lrwxrwxrwx 1 root root 10 feb 22 02:06 libGLESv1_CM.so.1.1 -> libMali.so
lrwxrwxrwx 1 root root 19 abr 16 17:58 libGLESv2.so -> /usr/lib/libMali.so
lrwxrwxrwx 1 root root 10 feb 22 02:06 libGLESv2.so.2.0 -> libMali.so
-rw-r--r-- 1 root root 731492 feb 22 02:06 libMali.so





LAST STEP : ONLY IF YOU ARE NOT USING KERNEL 3.0.36+
Get my github kernel code (3.0.36+) and compile it, just make sure that you do this too:

- I'm using the Measy U2C stick, which has DDR3 1333 9-9-9 capable memory, but this may not be your case and may cause your system to not boot. So just before compiling ("make -j 4") do "make menuconfig" and get inside "System Type" and there set "DDR Memory Type" to "DDR3 (Type default)" and "DDR SDRAM frequence (in MHz)" [sic] to "333".

- Also please note that my kernel is set to Maximum CPU frequency of 1.6 GHz (instead of 1.2 GHz in stock Picuntu), so use at your own risk!!!!! For added safety you can make your CPU run cooler by setting (in above menuconfig) into "CPU Power Management" --> "CPU Frequency scaling" --> "Default CPUfreq governor" to "conservative" or "powersave", so it will rarely go to high frequencies (but it'll be slower). My CPU does fine with 1.6 GHz without any heatsink, and usually runs at 60-70 ºC, with 80+ spikes :S however voltage scaling is known to work on my stick (not on others I fear). I fixed this in current github kernel, so CPU automatically scales down frequency when temperature rises.

- You may also want to check on "Device Drivers" -> "Network device support" -> "Wireless LAN" that your Wifi chip/stick is selected there, for its driver to be compiled. My kernel is, currently, more up to date than others, and as you will see, there is a driver for the RK903 Wifi. However, since I don't own a stick that has it, I haven't been able to test. Please let me know if it works for you :)

- After compiling, you have to do "make modules" too, this is very important!

- Then do "make modules_install" and go to your PC's /lib/modules to grab the full "3.0.8+alok" "3.0.36+" folder and copy it to your Picuntu MicroSD's /lib/modules folder (or just do all this on your Picuntu Linux!!:), then boot up your Picuntu stick and type in a terminal "depmod -a" so it will parse the new modules and restart Picuntu.

- After doing that you can flash the recovery partition with the compiled kernel

This could sound complicated but kernel tinkering is actually pretty straightforward and works! :)  Hope it helps and check your temperature with: cat /sys/module/tsadc/parameters/temp*

END OF LAST STEP (only for non 3.0.36+)



Testing 3D acceleration:

Run as a normal user:     es2gears   
It should report >120 fps (I usually get from 120 to 170 fps) with a CPU usage of around 30% for Xorg and just <15% for es2gears.
If that's not the case then double-check above steps and if it still doesn't work, you can, for example, post your questions at Miniand's Picuntu forum, where I try to be of help.



Disclaimer: Use at your own risk!!

If you run into an "Illegal instruction" error or a sudden reboot... your stick needs a heatsink... I spent the whole glmark2-es2 test blowing air to mine!
This is due to my overclocking the GPU from 266 MHz to its limit of 400 MHz, I've undone this in the github kernel too :)


MK808 note: If you have a MK808 you may want to compile olegk0's kernel instead of mine, because MK808 uses a different "LCDC video port" for HDMI output (1 instead of 0), which requires some minor code changes. However my kernel is more up to date (less bugs, less power consumption, etc.) than his, so I must recommend it for other sticks.



Reference
http://www.slatedroid.com/topic/55626-my-version-of-the-linux-kernel-for-mk808/
http://linux-sunxi.org/Binary_drivers
https://www.miniand.com/forums/forums/picuntu-linux/topics/new-kernel-3-0-36-for-picuntu-linux-on-rk3066-released

Saturday, April 13, 2013

Flash videos on Linux ARM chips


Until now I had been using Gnash, the extremely poor open substitute of Flash, which is actually unusable for any real purposes.


A couple weeks ago I read that it could be possible to have Flash on ARM by using the Flash Player that Adobe develops for the Chrome OS (used on the Samsung Chromebook ARM laptops).

So I found a page (see Reference below) that described what to do and, most importantly, provided the ARM compiled library that contains the official Flash Player.

Hence, the steps to have Flash up and running on the Chromium web browser in Linux (tested on Xubuntu 12.10) are:

1) Download compressed library
2) Copy the .so file to /usr/lib/
3) Change the Chromium shortcut from just:
chromium-browser
to the following single line:
chromium-browser --ppapi-flash-path=/usr/lib/libpepflashplayer.so --ppapi-flash-version=11.5.31.105 --ppapi-flash-args=enable_hw_video_decode=0,enable_stagevideo_auto=0,enable_trace_to_console=0 
4) Open Chromium and enjoy the real Flash, only limited by the maximum speed of your stick!


UPDATE: Popping noises
When I had a site with Flash open while listening to a local music file, or watching flash videos, I heard a 'pop' every few seconds, which stopped upon closing chromium. Running chromium from the commandline yielded this error along with every pop:
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream

Solved it by going into the PulseAudio Volume Control and making sure, on the last tab, that the profile was Analogic Stereo Duplex and KEEPING OPEN (!!!!) the PulseAudio Volume Control app, which for some reason makes the noises stop and a new line appears below the one above:
ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave



Reference
http://forum.xda-developers.com/showthread.php?t=2010440

Wednesday, April 10, 2013

Rockchip RK1000-S


UPDATE 2013/08/16: RK1000S datasheet here


Brief post to explain my findings about the RK1000-S chip present on my Measy U2C RK3066 stick:

RK1000-S TV Out and Audio CODEC chip on Measy U2C stick


From the probable schematics of the Ramos W9, we see the video data lines (LCD_D*) coming out of the RK2818 CPU go to three different places:
- an LCD connector, uninteresting,
- a chip labelled ANX7150, whouse output is the HDMI connector
- the RK1000-S chip, whose outputs are the headphones and the TV Out

Hence, the RK1000-S, that up until now I had supposed was an HDMI transmitter, is actually only an Audio CODEC chip with TV Out functionality, with no HDMI capabilities whatsoever.

I should have arrived to this conclusion earlier, since the RK3066 actually is able to drive the HDMI output by itself (see p.14).

Tuesday, April 9, 2013

RK3066 SDK board schematic

Look what I found googling around... the RK3066 SDK schematics!

For those that don't know, all this flood of RK sticks is due to Rockchip handing out those schematics to OEMs, which just remove the parts that don't fit their application (for example no G-sensor or no touchpad for a TV stick).

So, for the case of most RK3066 TV sticks around it is most usual to find the following chips inside them:

Power Management Unit: Texas Instruments TPS659102
Wifi: Mediatek MT5931
Bluetooth: Mediatek MT6622 (actually in the same bundle board with the Wifi chip)

Well, those are the chips depicted in this RK3066 SDK schematic (page 16 for Wifi+BT, and page 6 indicates TPS659102, even if WM8326 is mentioned in page 4).

For the case of my Measy U2C, which has an integrated webcam, the schematic part referring to the front camera (page 15) has also been of help (even if just to know it's rigged to I2C bus 3).

However the CODEC chip used here is the RK Jetta (i.e. RK610), not the RK1000 used in my stick.


UPDATE: Please note that above schematic is different and more recent (Jan 2013) than the one already known (Feb 2012), which uses PMU WM8326, Wifi+BT RK903 (BCM40183 - Broadcom 4330 Based Chipset).




Since my stick also has an A/V out (stereo headphone connection but with TV Out, missing on above schematic), an integrated microphone and a RK1000-S A/V CODEC chip, I've found this other old schematic that shows up how that part is likely set up on page 6 of this RK2818 schematic.




Why is this important?

Because for proper Linux support it is necessary to know which RK3066 pins are connected to what pins of other chips.
So it's not enough with having the source code of the Wifi MT5931 driver in order to enable it in Linux, you must also know how it is connected to the RK3066 CPU.


Also, since I'm currently debugging the unthinkable power consumption when the stick is turned "off" (from Android and Linux, so... kernel bug or PCB design catastrophe), the TPS659102 PMU connections along with its datasheet will shed some light on it.


Hopefully with these schematics we are another step closer to better Linux support.


BTW, if you are also working on supporting TV sticks in Linux (like for example Picuntu), drop me a line, we can probably help each other!



UPDATE 2: Reverse-engineering the Measy U2C stick


From a "high-megapixel" Measy U2C PCB inspection, trying to identify the remaining (tiny) chips, and by looking for SOT23 packages in the schematics, I've identified several other discrete components of  >2 pins:

- Another PM related [tiny] SOT23-6 chip, the Silergy SY8009B is U14 in the schematic (due to the nearby 3R3 inductor, or else it could've been U18) providing the VDD_LOG (1.1V) voltage that the original WM8326 regulator had (see p.4 of SDK schematic), but the TPS659102 doesn't (compare pp. 4 and 6). It's just below the MicroSD slot, marked "CU2UJ":

Measy U2C close up (in case you wonder, there is nothing under the GC2035)

- One SOT23 (3 pins) BAT54RS Schottky diode marked "LD3", just below the HDMI connector.

- Two SOT23 N channel [Enh. Mode] FET components of type DMN2170U labelled "21N" and found below the A/V out (which is above the HDMI). In my opinion, from their closeness to the HDMI connector, they are replacing Q14 and Q15, marked 2SK3018 in the schematic, and required for proper screen EDID reading.

- One/two SOT23 NPN transistor L8050QLT marked "1YC" to the right of the A/V out (right through, on the other side, there is another SOT23 that I think is the same type). If it weren't because these are NPN transistors, instead of FETs, I'd say they were stereo headphone related (so close to it!) and substituting the FETs Q12 and Q13, of type APM2306, in the RK1000 related schematic above. But my electronics are so far in the past that this could be blasphemy :)


BTW: no CPU heatsink for Measy :(

- A SOT23 chip marked "W41M" near the upper left corner of the Wifi+BT module (the brown board) that I haven't been able to identify yet.

MT6622 BT chip and MT5931 Wifi on the brown module and single antenna

Do you think those are many SOT23 components? Well, they are much less than those on the schematic!

Some are missing because there is no LCD and some others just because the system power comes from the USB, heavily simplifying the power part (or else it'd have to generate 5V for the USB OTG port).

However there are also unpopulated parts in the PCB and I am still missing some three pin components (like USB detection interrupt).



One particular component that I fear is missing is Q17, a FET for the PMU's PMIC_SLEEP with the following significative text (p. 7): "Note: Reduce the power consumption in deep sleeping. Place it near to crystal."

Maybe the "W41M" unknown component, which is not so far from the PMU could be this Q17? I hope so!


Tuesday, April 2, 2013

Measy U2C Webcam support in Linux RK3066


Since one of my goals for my Measy U2C stick is to use it as an in-home security camera, thanks to its integrated microphone and webcam (model GC2035 from GalaxyCore), I had to find a way to support them in Picuntu Linux (the RK3066 based Xubuntu 12.10 from developer Alok Sinha).



Wouldn't it serve its purpose running headless (no monitor) and attached to this battery or to a phone charger, ready to send an email to your phone upon sensing too much noise or "seeing" somebody? and we are talking of a CPU with Video encoding capabilities!

So, there is one of the motivations, now onto the quest. The first problem was that Picuntu does not include a driver for the GC2035 CMOS sensor (and the GC2015 it supports is different enough not to be fine), so I set out to github.com and its awesome code search just to find the latest RK3066 kernel (for Android Jelly Bean support), some months more modern than the one Picuntu uses.

Since porting Picuntu Linux to the JB (Jelly Bean) RK3066 kernel is taking me some time, at least I have made enough changes to successfully port the GC2035 driver.
Note the "(GC2035)" below the CMOS sensor at the right


I believe the Kimdecent B12 and, probably, the NX003II sticks are clones of the Measy U2C, in which case this solution would also work for them. If you are the owner of an RK3066 stick with integrated camera and are willing to take high resolution pictures of both sides of your PCB, we could all confirm that.


To add the driver to your Picuntu Linux stick, you have to recompile the kernel (quite easy actually) following the steps in this post but in the step where you download the latest Picuntu source code:
git clone https://github.com/aloksinha2001/picuntu-3.0.8-alok.git
you have to instead download the updated source code*:
git clone git://github.com/Galland/picuntu-3.0.8-alok.git
The rest of the instructions are exactly the same and you can still use the same SD card installation of Picuntu that you already have, since it doesn't change (only the kernel that goes inside the stick's flash recovery partition).

You'll just find that, upon bootup, the gc2035 driver is loaded and attached as a front camera (front_2) and the new device appears as:
/dev/video0

[*] You can review the changes by parsing through my commit history or just know that I've mostly added the GC2035 driver, updated the machine config to "talk" to this CMOS sensor and added a few notable bugfixes from Rockchip's JB kernel.



The catch


While the system can indeed communicate with the sensor, I've found that the driver is able to output NV12, NV21, NV16, or NV61 Video4Linux2 pixel formats (the way in which the luminance and chrominance samples of pixels are set up in the buffer where a captured image is sent to apps).

This would be fine unless for the fact that I haven't found an application able to get that V4L2 format and save an image to disk from it, though I haven't searched that much, I must say (see below).

While I temporarily move on to other tasks in this Linux support "challenge", this is a part where you, dear Measy U2C or clone owner, could be of great help, by googling and testing to get this very last step through! :-)

Even if you only find an app that dumps the raw NV* capture to a file, I can very quickly write a tool to transform it to a viewable RGB format.



My brief findings


Using the app "fswebcam" the output is the following:

user@picuntu:~$ fswebcam -v output.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
src_v4l2_get_capability,87: /dev/video0 information:
src_v4l2_get_capability,88: cap.driver: "rk-camera-rk30"
src_v4l2_get_capability,89: cap.card: "gc2035_front_2-270"
src_v4l2_get_capability,90: cap.bus_info: ""
src_v4l2_get_capability,91: cap.capabilities=0x04000001
src_v4l2_get_capability,92: - VIDEO_CAPTURE
src_v4l2_get_capability,103: - STREAMING
No input was specified, using the first.
src_v4l2_set_input,181: /dev/video0: Input 0 information:
src_v4l2_set_input,182: name = "Camera"
src_v4l2_set_input,183: type = 00000002
src_v4l2_set_input,185: - CAMERA
src_v4l2_set_input,186: audioset = 00000000
src_v4l2_set_input,187: tuner = 00000000
src_v4l2_set_input,188: status = 00000000
src_v4l2_set_pix_format,541: Device offers the following V4L2 pixel formats:
src_v4l2_set_pix_format,554: 0: [0x3231564E] 'NV12' (YUV420 NV12)
src_v4l2_set_pix_format,554: 1: [0x3631564E] 'NV16' (YUV422 NV16)
src_v4l2_set_pix_format,554: 2: [0x3132564E] 'NV21' (YUV420 NV21)
src_v4l2_set_pix_format,554: 3: [0x3136564E] 'NV61' (YUV422 NV61)
src_v4l2_set_pix_format,554: 4: [0x3231564E] 'NV12' (YUV420 NV12)
src_v4l2_set_pix_format,554: 5: [0x3631564E] 'NV16' (YUV422 NV16)
src_v4l2_set_pix_format,554: 6: [0x3132564E] 'NV21' (YUV420 NV21)
src_v4l2_set_pix_format,554: 7: [0x3136564E] 'NV61' (YUV422 NV61)
Unable to find a compatible palette format.



Whereas VLC tries to access it in four different ways, unsuccessfully (notice the warnings):

UPDATE (2013/04/05): It seems the previous problems related to I/O mmap were due to the kernel having a too small value for CONSISTENT_DMA_SIZE, which I have already changed from 2 to 8 MB in the GitHub repository above. Still no video but the warnings are:


v4l2 warning: Could not select any of the default chromas; attempting to open as MPEG encoder card (access)
v4l2 warning: Could not select any of the default chromas; attempting to open as MPEG encoder card (access)
ps warning: this does not look like an MPEG PS stream, continuing anyway
ps warning: garbage at input, trying to resync...

Ideas welcome :)


Message log output before update:


main debug: adding item `v4l2:///dev/video0' ( v4l2:///dev/video0 )
qt4 debug: Adding a new MRL to recent ones: v4l2:///dev/video0
main debug: no fetch required for (null) (art currently (null))
main debug: rebuilding array of current - root Lista de reproducción
main debug: rebuild done - 1 items, index -1
main debug: processing request item: v4l2:///dev/video0, node: null, skip: 0
main debug: resyncing on v4l2:///dev/video0
main debug: v4l2:///dev/video0 is at 0
main debug: starting playback of the new playlist item
main debug: resyncing on v4l2:///dev/video0
main debug: v4l2:///dev/video0 is at 0
main debug: creating new input thread
main debug: Creating an input for 'v4l2:///dev/video0'
main debug: using timeshift granularity of 50 MiB, in path '/tmp'
main debug: `v4l2:///dev/video0' gives access `v4l2' demux `' path `/dev/video0'
main debug: creating demux: access='v4l2' demux='' location='/dev/video0' file='/dev/video0'
main debug: looking for access_demux module: 1 candidate
v4l2 debug: opening device '/dev/video0'
qt4 debug: IM: Setting an input
v4l2 debug: trying kernel V4L2
v4l2 debug: device gc2035_front_2-270 using driver rk-camera-rk30 (version 0.2.14) on 
v4l2 debug: the device has the capabilities: 0x04000001
v4l2 debug:  (X) Video Capture, ( ) Audio, ( ) Tuner, ( ) Radio
v4l2 debug:  ( ) Read/Write, (X) Streaming, ( ) Asynchronous
v4l2 debug: video input 0 (Camera) has type: External analog input *
v4l2 debug: input set to 0
v4l2 debug: device codec NV12 (YUV420 NV12) not supported
v4l2 debug: device codec NV16 (YUV422 NV16) not supported
v4l2 debug: device codec NV21 (YUV420 NV21) not supported
v4l2 debug: device codec NV61 (YUV422 NV61) not supported
v4l2 debug: device codec NV12 (YUV420 NV12) not supported
v4l2 debug: device codec NV16 (YUV422 NV16) not supported
v4l2 debug: device codec NV21 (YUV420 NV21) not supported
v4l2 debug: device codec NV61 (YUV422 NV61) not supported
v4l2 debug: found default width and height of 640x480
v4l2 debug: will try to find optimal width and height
v4l2 warning: Could not select any of the default chromas; attempting to open as MPEG encoder card (access)
v4l2 debug: trying library V4L2
v4l2 debug: device gc2035_front_2-270 using driver rk-camera-rk30 (version 0.2.14) on 
v4l2 debug: the device has the capabilities: 0x05000001
v4l2 debug:  (X) Video Capture, ( ) Audio, ( ) Tuner, ( ) Radio
v4l2 debug:  (X) Read/Write, (X) Streaming, ( ) Asynchronous
v4l2 debug: video input 0 (Camera) has type: External analog input *
v4l2 debug: input set to 0
v4l2 debug: device codec NV12 (YUV420 NV12) not supported
v4l2 debug: device codec NV16 (YUV422 NV16) not supported
v4l2 debug: device codec NV21 (YUV420 NV21) not supported
v4l2 debug: device codec NV61 (YUV422 NV61) not supported
v4l2 debug: device codec NV12 (YUV420 NV12) not supported
v4l2 debug: device codec NV16 (YUV422 NV16) not supported
v4l2 debug: device codec NV21 (YUV420 NV21) not supported
v4l2 debug: device codec NV61 (YUV422 NV61) not supported
v4l2 debug: device supports chroma RV24 [RGB3, RGB3]
v4l2 debug: device supports chroma RV24 [BGR3, BGR3]
v4l2 debug: device supports chroma I420 [YU12, YU12]
v4l2 debug: device supports chroma YV12 [YV12, YV12]
v4l2 debug: found default width and height of 640x480
v4l2 debug: will try to find optimal width and height
v4l2 warning: Could not select any of the default chromas; attempting to open as MPEG encoder card (access)
main debug: no access_demux module matching "v4l2" could be loaded
main debug: TIMER module_need() : 885.952 ms - Total 885.952 ms / 1 intvls (Avg 885.952 ms)
main debug: creating access 'v4l2' location='/dev/video0', path='/dev/video0'
main debug: looking for access module: 1 candidate
v4l2 debug: opening device '/dev/video0'
v4l2 debug: trying kernel V4L2
v4l2 debug: device gc2035_front_2-270 using driver rk-camera-rk30 (version 0.2.14) on 
v4l2 debug: the device has the capabilities: 0x05000001
v4l2 debug:  (X) Video Capture, ( ) Audio, ( ) Tuner, ( ) Radio
v4l2 debug:  (X) Read/Write, (X) Streaming, ( ) Asynchronous
v4l2 debug: video input 0 (Camera) has type: External analog input *
v4l2 debug: input set to 0
v4l2 debug: device codec NV12 (YUV420 NV12) not supported
v4l2 debug: device codec NV16 (YUV422 NV16) not supported
v4l2 debug: device codec NV21 (YUV420 NV21) not supported
v4l2 debug: device codec NV61 (YUV422 NV61) not supported
v4l2 debug: device codec NV12 (YUV420 NV12) not supported
v4l2 debug: device codec NV16 (YUV422 NV16) not supported
v4l2 debug: device codec NV21 (YUV420 NV21) not supported
v4l2 debug: device codec NV61 (YUV422 NV61) not supported
v4l2 debug: device supports chroma RV24 [RGB3, RGB3]
v4l2 debug: device supports chroma RV24 [BGR3, BGR3]
v4l2 debug: device supports chroma I420 [YU12, YU12]
v4l2 debug: device supports chroma YV12 [YV12, YV12]
v4l2 debug: found default width and height of 640x480
v4l2 debug: will try to find optimal width and height
v4l2 debug: Driver requires at most 460800 bytes to store a complete image
v4l2 debug: Interlacing setting: progressive
v4l2 error: mmap failed: Cannot allocate memory
v4l2 debug: trying library V4L2
v4l2 debug: device gc2035_front_2-270 using driver rk-camera-rk30 (version 0.2.14) on 
v4l2 debug: the device has the capabilities: 0x05000001
v4l2 debug:  (X) Video Capture, ( ) Audio, ( ) Tuner, ( ) Radio
v4l2 debug:  (X) Read/Write, (X) Streaming, ( ) Asynchronous
v4l2 debug: video input 0 (Camera) has type: External analog input *
v4l2 debug: input set to 0
v4l2 debug: device codec NV12 (YUV420 NV12) not supported
v4l2 debug: device codec NV16 (YUV422 NV16) not supported
v4l2 debug: device codec NV21 (YUV420 NV21) not supported
v4l2 debug: device codec NV61 (YUV422 NV61) not supported
v4l2 debug: device codec NV12 (YUV420 NV12) not supported
v4l2 debug: device codec NV16 (YUV422 NV16) not supported
v4l2 debug: device codec NV21 (YUV420 NV21) not supported
v4l2 debug: device codec NV61 (YUV422 NV61) not supported
v4l2 debug: device supports chroma RV24 [RGB3, RGB3]
v4l2 debug: device supports chroma RV24 [BGR3, BGR3]
v4l2 debug: device supports chroma I420 [YU12, YU12]
v4l2 debug: device supports chroma YV12 [YV12, YV12]
v4l2 debug: found default width and height of 640x480
v4l2 debug: will try to find optimal width and height
v4l2 debug: Driver requires at most 460800 bytes to store a complete image
v4l2 debug: Interlacing setting: progressive
v4l2 error: device does not support mmap I/O
main debug: no access module matching "v4l2" could be loaded
main debug: TIMER module_need() : 226.883 ms - Total 226.883 ms / 1 intvls (Avg 226.883 ms)
main error: open of `v4l2:///dev/video0' failed
main debug: finished input
main debug: dead input
main debug: changing item without a request (current 0/1)
main debug: nothing to play
qt4 debug: IM: Deleting the input



BTW, this article has been posted with Picuntu (Xubuntu) on the Measy U2C