[linux-sunxi] Re: HDMi Output on OrangePi Win/Win Plus Allwinner A64 (SUN50I)

2020-08-19 Thread Milos Ladni
I forgot to mention that i am using A20 SoC but it should be similar.

среда, 19. август 2020. 11.32.58 UTC+2, Milos Ladni је написао/ла:
>
> Hi, i do this few weeks ago for LVDS display...
>
> What i did in u-boot configuration:
> CONFIG_VIDEO_SUNXI=y
> # CONFIG_VIDEO_HDMI is not set
> # CONFIG_VIDEO_VGA is not set
> # CONFIG_VIDEO_COMPOSITE is not set
>
> CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:24,pclk_khz:51000,le:319,ri:4,up:34,lo:2,hs:1,vs:1,sync:3,vmode:0"
> CONFIG_VIDEO_LCD_DCLK_PHASE=1
> CONFIG_VIDEO_LCD_POWER="PH9"
> CONFIG_VIDEO_LCD_RESET=""
> CONFIG_VIDEO_LCD_BL_EN="PH8"
> CONFIG_VIDEO_LCD_BL_PWM=""
> # CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW is not set
> # CONFIG_VIDEO_LCD_PANEL_I2C is not set
> CONFIG_VIDEO_LCD_IF_LVDS=y
> # CONFIG_VIDEO_LCD_PANEL_PARALLEL is not set
> CONFIG_VIDEO_LCD_PANEL_LVDS=y
>
> You should enable HDMI instead of my LVDS display and set correct times...
>
> Milos Ladicorbic
>
> петак, 14. август 2020. 12.24.17 UTC+2, gorl...@gmail.com је написао/ла:
>>
>>
>> Hello.
>> Need help to enable HDMI output on u-boot load.
>> At current time HDMI output work only after linux kernel is loaded. At 
>> u-boot time HDMI output is blank (no signal on monitor)
>> .I try some option like
>>
>> setenv video-mode=sunxi:1024x768-24@60,monitor=dvi,hpd=0,edid=1
>> setenv video-mode=sunxi:1024x768-24@60,monitor=dvi,hpd=1,edid=1
>> setenv video-mode=sunxi:1024x768-24@60,monitor=dvi,hpd=0,edid=0
>> setenv video-mode=sunxi:1024x768-24@60,monitor=hdmi,hpd=0,edid=1
>> setenv video-mode=sunxi:1024x768-24@60,monitor=hdmi,hpd=1,edid=1
>> setenv video-mode=sunxi:1024x768-24@60,monitor=hdmi,hpd=0,edid=0 
>> and
>> setenv hdmi.audio=EDID:0 disp.screen0_output_mode=1024x768p60
>> setenv hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1024x768p60 
>>
>> Full output of U-BOOT load
>> ===
>> U-Boot SPL 2020.07-STLK1-dirty (Aug 14 2020 - 02:43:26 
>> +0300)   
>>  
>>
>> DRAM: 2048 
>> MiB  
>>  
>>
>> Trying to boot from 
>> MMC1 
>> 
>>
>> NOTICE:  BL31: 
>> v2.3(debug):v2.3-420-gf0b1864f8  
>>  
>>
>> NOTICE:  BL31: Built : 15:05:30, Jul 31 
>> 2020 
>> 
>>
>> NOTICE:  BL31: Detected Allwinner A64/H64/R18 SoC 
>> (1689)   
>>   
>>
>> NOTICE:  BL31: Found U-Boot DTB at 0x4099690, model: OrangePi Win/Win 
>> Plus 
>>   
>>
>> INFO:ARM GICv2 driver 
>> initialized  
>>   
>>
>> INFO:Configuring SPC 
>> Controller   
>>
>>
>> INFO:PMIC: Probing AXP803 on 
>> RSB  
>>
>>
>> INFO:PMIC: dcdc1 voltage: 
>> 3.300V   
>>   
>>
>> INFO:PMIC: dcdc5 voltage: 
>> 1.500V   
>>   
>>
>> INFO:PMIC: dcdc6 voltage: 
>> 1.100V   
>>   
>>
>> INFO:PMIC: dldo1 voltage: 
>> 3.300V   
>>   
>>
>> INFO:PMIC: dldo2 voltage: 
>> 3.300V   

[linux-sunxi] Re: HDMi Output on OrangePi Win/Win Plus Allwinner A64 (SUN50I)

2020-08-19 Thread Milos Ladni
Hi, i do this few weeks ago for LVDS display...

What i did in u-boot configuration:
CONFIG_VIDEO_SUNXI=y
# CONFIG_VIDEO_HDMI is not set
# CONFIG_VIDEO_VGA is not set
# CONFIG_VIDEO_COMPOSITE is not set
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:24,pclk_khz:51000,le:319,ri:4,up:34,lo:2,hs:1,vs:1,sync:3,vmode:0"
CONFIG_VIDEO_LCD_DCLK_PHASE=1
CONFIG_VIDEO_LCD_POWER="PH9"
CONFIG_VIDEO_LCD_RESET=""
CONFIG_VIDEO_LCD_BL_EN="PH8"
CONFIG_VIDEO_LCD_BL_PWM=""
# CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW is not set
# CONFIG_VIDEO_LCD_PANEL_I2C is not set
CONFIG_VIDEO_LCD_IF_LVDS=y
# CONFIG_VIDEO_LCD_PANEL_PARALLEL is not set
CONFIG_VIDEO_LCD_PANEL_LVDS=y

You should enable HDMI instead of my LVDS display and set correct times...

Milos Ladicorbic

петак, 14. август 2020. 12.24.17 UTC+2, gorl...@gmail.com је написао/ла:
>
>
> Hello.
> Need help to enable HDMI output on u-boot load.
> At current time HDMI output work only after linux kernel is loaded. At 
> u-boot time HDMI output is blank (no signal on monitor)
> .I try some option like
>
> setenv video-mode=sunxi:1024x768-24@60,monitor=dvi,hpd=0,edid=1
> setenv video-mode=sunxi:1024x768-24@60,monitor=dvi,hpd=1,edid=1
> setenv video-mode=sunxi:1024x768-24@60,monitor=dvi,hpd=0,edid=0
> setenv video-mode=sunxi:1024x768-24@60,monitor=hdmi,hpd=0,edid=1
> setenv video-mode=sunxi:1024x768-24@60,monitor=hdmi,hpd=1,edid=1
> setenv video-mode=sunxi:1024x768-24@60,monitor=hdmi,hpd=0,edid=0 
> and
> setenv hdmi.audio=EDID:0 disp.screen0_output_mode=1024x768p60
> setenv hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1024x768p60 
>
> Full output of U-BOOT load
> ===
> U-Boot SPL 2020.07-STLK1-dirty (Aug 14 2020 - 02:43:26 
> +0300)
> 
>
> DRAM: 2048 
> MiB   
> 
>
> Trying to boot from 
> MMC1  
>
>
> NOTICE:  BL31: 
> v2.3(debug):v2.3-420-gf0b1864f8   
> 
>
> NOTICE:  BL31: Built : 15:05:30, Jul 31 
> 2020  
>
>
> NOTICE:  BL31: Detected Allwinner A64/H64/R18 SoC 
> (1689)
>  
>
> NOTICE:  BL31: Found U-Boot DTB at 0x4099690, model: OrangePi Win/Win 
> Plus  
>  
>
> INFO:ARM GICv2 driver 
> initialized   
>  
>
> INFO:Configuring SPC 
> Controller
>   
>
> INFO:PMIC: Probing AXP803 on 
> RSB   
>   
>
> INFO:PMIC: dcdc1 voltage: 
> 3.300V
>  
>
> INFO:PMIC: dcdc5 voltage: 
> 1.500V
>  
>
> INFO:PMIC: dcdc6 voltage: 
> 1.100V
>  
>
> INFO:PMIC: dldo1 voltage: 
> 3.300V
>  
>
> INFO:PMIC: dldo2 voltage: 
> 3.300V
>  
>
> INFO:PMIC: dldo4 voltage: 
> 3.300V
>  
>
> INFO:BL31: Platform setup 
> done  
>  
>
> INFO:BL31: Initializing runtime 
> services  
>
>
> INFO:BL31: cortex_a53: CPU workaround for 843419 was 
> applied   
>   
>
> INFO:BL31: cortex_a53: CPU workaround for 855873 was 
> applied   

[linux-sunxi] Re: Installation procedure for mainline U-Boot

2020-08-12 Thread Milos Ladni
Hi,

unfortunatelly i played with A10s long time ago and do not have experience 
with mainlune u-boot and A10s, only with mainline u-boot for A20 SoC.

If it's of any help to you, i just recompiled u-boot 2020-04 for 
'A10s-OLinuXino-M_defconfig' and i got 'u-boot-sunxi-with-spl.bin' without 
problem.

Once when you have new 'u-boot-sunxi-with-spl.bin' compiled well. Maybe you 
can try to tune boot.scr for additional board parameters like rootfs 
partition etc.
For A20, i added additional setup for board booting by set boot.cmd and 
compile it to boot.scr by:
$ mkimage -C none -A arm -T script -d boot.cmd boot.scr

Milos

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/8e012b76-54d9-4152-b132-bc1945c5ecb9o%40googlegroups.com.


[linux-sunxi] Re: Installation procedure for mainline U-Boot

2020-08-11 Thread Milos Ladni
Hi,
i am not sure for which board you are trying to compile but generally...
If you have yout custom board or want to create your custom default setup 
you can create new branch and execute:
$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make savedefconfig
This command will create defconfig file. After this you can copy defconfig 
to arch/arm/configs/ and rename it to your custom settings name.
As i said, this step is not related to you issue.

I just tryed to pull mainline u-boot and compile it from master branch for 
A20-OLinuXino_MICRO-eMMC_defconfig.
After compilation passed i also see 'BINMAN all' and i got 
u-boot-sunxi-with-spl.bin
Maybe your defconfig does not include spl support by default. For which 
board are you tring to compile u-boot?

Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/17893d17-4d48-4ce0-a0fd-9bcb67a22419o%40googlegroups.com.


[linux-sunxi] Re: Installation procedure for mainline U-Boot

2020-08-10 Thread Milos Ladni
Hi Stefan,

i am not sure where is the issue but here are my tips how i built new 
meinline u-boot few months ago...
https://linux-sunxi.org/Mainline_U-Boot
Install additional packages:
$ apt-get install swig python-dev python3-dev
Build HowTo:
$ git clone git://git.denx.de/u-boot.git
$ git checkout v2020.04
  # or whatever is latest
$ make CROSS_COMPILE=arm-linux-gnueabihf- A20-OLinuXino_MICRO-eMMC_defconfig
$ make CROSS_COMPILE=arm-linux-gnueabihf- _defconfig# at 
this point i created new branch and create default configuration for my 
custom tcs-7Zoll device using the 'savedefconfig' method (this is only 
optional step).
$ make CROSS_COMPILE=arm-linux-gnueabihf- 
menuconfig# here you can check if SPL is turned 
on (it should be enabled by default)
$ make 
CROSS_COMPILE=arm-linux-gnueabihf-  
 
# voilaaa u-boot-sunxi-with-splbin is here

Milos
On Sunday, August 9, 2020 at 10:20:57 PM UTC+2 Stefan Monnier wrote:

> http://linux-sunxi.org/Bootable_SD_card says that to install U-Boot
> coming wither from mainline of legacy should be done with:
>
> dd if=u-boot-sunxi-with-spl.bin of=${card} bs=1024 seek=8
>
> [ except for U-Boot v2013.07 or earlier. ]
>
> But when I build U-Boot from the mainline's `master` branch, I don't get
> any `u-boot-sunxi-with-spl.bin` file.
>
> Did the procedure change? Where is it documented now?
>
>
> Stefan
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/b158d8d9-98ea-45ca-b499-de2a3164fac1n%40googlegroups.com.


Re: [linux-sunxi] Re: A20 - Mainline 5.8.0 - Display Engine

2020-08-07 Thread Milos Ladni
I forgot to put link for cedar VE PoC :)
https://github.com/milosladni/sunxi-tvin2jpeg_h264

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/a2567fcd-70de-4405-9130-e1a765558bdao%40googlegroups.com.


Re: [linux-sunxi] Re: A20 - Mainline 5.8.0 - Display Engine

2020-08-07 Thread Milos Ladni
I think i have two problems:

1. When i decode video i need to find a way to show it under GUI 
application by using Display Engine (DRM in this case think) as a separate 
layer that is always on top. On legacy kernel, i used Display Engine by 
/dev/disp but it does not exist anymore.
2. Find a way how to speed up firefox. I tried to set 
'layers.acceleration.force-enabled' under about:config but i didn't get any 
improvement. QT unfortunately is not an option because of license and guy 
who will maintain GUI application in the future currently does not have 
time to learn QT.
I suspect that my window manager uses LIMA in the right way, actually, i 
suspect that it uses lima at all because of errors which i posted in the 
previous message.

About cedar VE:
If you are interested in video encoding/decoding and PoC i have written a 
good example of how to do this in legacy kernel 3.4 a few years ago.
With my PoC you can have more than one operation simultaneously. I wrote it 
according to a few PoC which you could find on sunxi at that time. You can 
do H264 encoding/decoding and MJPEG encoding/decoding at the same time and 
it works like a charm without any CPU load and 25fps for each task (100 fps 
in total) for PAL resolution.
The good thing about this PoC beside simultaneous operation is H264 decoder 
which you couldn't find anywhere outside of VDPAU and cedrus. Because if 
you use VDPAU you can't do any other cedar task in parallel (only one 
operation is available) i decide to rewrite it by looking to source code 
for vdpau cedar plugin for GStreamer i think, i am not sure anymore.
This is the only example of how to direct use cedar VE for H264 decoding in 
a raw way.
I have to say that for input i used composite CVBS input which is not 
available in the mainline. It also wasn't available for legacy 3.4 but i 
patched it to get it working.
This PoC should also work on the mainline but it needs slight modification. 
Some cedar VE IOCTLs were changed and for video input you have to use some 
digital camera instead of TV in.

Best regards,
Milos

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/1da93125-02c4-420f-89a7-ede13ff6101co%40googlegroups.com.


[linux-sunxi] Re: A20 - Mainline 5.8.0 - Display Engine

2020-08-06 Thread Milos Ladni
 Hi Andrey, thank you for supporting.

Actually, i am not sure if i need 'lima' driver or not... Because i run a 
simple web based (Javasctipt) GUI application in firefox in fullscreen 
kiosk mode. It has only two tabs (contexts) with fixed size without 
scrolling, a few buttons and window space for playing video on top of all 
without desktop environment.
GUI application is very simple. I am not a web programmer but i know that i 
am not using any specific openGL code in web application.
Maybe lima can help with CPU load because no matter how simple my GUI 
application is, it does not run smoothly when i switch between these two 
tabs. CPU can take more than 50% during switching and showing different 
contexts to the user.
Anyway i also tried to load Lima driver and i got /dev/dri/card0,  card1  
and renderD128 but i am not sure how to test it.

When i try to load xwindow or kmscube i get following error message:
root@olinuxino:~/workspace# kmscube 
gbm: failed to open any driver (search paths 
/usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/sun4i-drm_dri.so: cannot open shared 
object file: No such file or directory
failed to load driver: sun4i-drm

kmscube fail at this point but xwindow show only this error and continue 
running. I can run gui application after xwindow is started.

My LVDS display is working well and one of my issues is how to put decoded 
video to a specific location in GUI application.
After the video is decoded by cedar VE it is in YUV NV12 RAW format. I have 
to scale it to another resolution and show it inside of GUI application.

On legacy kernel i used Display Engine and /dev/disp device node for this 
purpose.
Unfortunately on mainline /dev/disp vanish and we are forced to use drm 
driver instead of it which is if i understand well the same Display Engine 
driver in the background.

Regards,
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/49e7f2a7-5c34-4265-8c2c-d868eeb9af14o%40googlegroups.com.


[linux-sunxi] A20 - Mainline 5.8.0 - Display Engine

2020-08-05 Thread Milos Ladni
Hi all,

I am trying to port my custom board from legacy kernel 3.4 to the mainline.
I am using an LVDS display with a capacitive touchscreen and it works fine. 
For the test, i am currently running Armbian Debian Buster without Desktop 
environment because i need only one application on top of all.
I additionally installed manually by apt-get X window and ratpoison window 
manager. Run firefox which is used for Javascript GUI interpretation, Cedar 
VE for encoding/decoding and DisplayEngine for showing the video on display 
on a particular place and particular size.
On mainline, i recompiled Cedar VE instead of Cedrus because i already 
wrote all needed features for both Encoding/Decoding H264 and MJPEG for old 
legacy kernel and because encoding is not currently supported by Cedrus. 
Under legacy kernel i wrote my VideoEngine application and managed to get 4 
simultaneous operation (Encode H264 and MJPEG and Decode H264 and MJPEG), 
all this works smoothly for a long time in legacy kernel 3.4 with any issue.

For mainline, i recompiled CedarVE from uboborov repo: 
https://github.com/uboborov/sunxi-cedar-mainline.
I already tested CedarVE Encoder part but for Decoder i need to show video 
on my display on particular place with particular resolution.
On old kernel, there was /dev/disp node which was used for showing video 
across firefox application in a particular window place or even in full 
screen.

My question is how to do this in Mainline kernel?
I set my dtb and enable Display Engine but i am stuck there.
I see in dmesg that framebuffer is switched from simple to sun4i-drm-fb and 
i have /dev/dri/card0 device node but i am not sure what is my next step.
Do i need to create some drm plane for that purpose and how? Is there any 
simple example of how to do this?

Also when i run '$startx ratpoison' in its output i can see next message: 
'failed to load driver: sun4i-drm'. Does it mean that X window could not 
use DRM or what? I am not sure if drm is working or not. And did i create 
drm display engine pipeline as well?
Also, i think that firefox which i am using for running my Javascript GUI 
is an overkill a little bit. Does someone else can recommend some other 
interpreter?
Do i need to compile and run lima driver for my purpose?

Sorry for long description. I also attached my dtb files and dmesg output 
here.

Thanks,
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/afa43aef-bd6e-43b5-bf94-de6ce1555b72o%40googlegroups.com.
root@olinuxino:~# dmesg 
[0.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 5.8.0-rc1-g05ba036ff (milos@debian1064) 
(arm-linux-gnueabihf-gcc (Debian 8.3.0-2) 8.3.0, GNU ld (GNU Binutils for 
Debian) 2.31.1) #60 SMP Thu Jul 30 17:47:50 CEST 2020
[0.00] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[0.00] CPU: div instructions available: patching division code
[0.00] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing 
instruction cache
[0.00] OF: fdt: Machine model: sun7i-a20-tcs-7Zoll
[0.00] printk: bootconsole [earlycon0] enabled
[0.00] Memory policy: Data cache writealloc
[0.00] Reserved memory: created CMA memory pool at 0x4a00, size 96 
MiB
[0.00] OF: reserved mem: initialized node default-pool, compatible id 
shared-dma-pool
[0.00] Zone ranges:
[0.00]   Normal   [mem 0x4000-0x5fda7fff]
[0.00]   HighMem  empty
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x4000-0x5fda7fff]
[0.00] Initmem setup node 0 [mem 0x4000-0x5fda7fff]
[0.00] On node 0 totalpages: 130472
[0.00]   Normal zone: 1020 pages used for memmap
[0.00]   Normal zone: 0 pages reserved
[0.00]   Normal zone: 130472 pages, LIFO batch:31
[0.00] psci: probing for conduit method from DT.
[0.00] psci: Using PSCI v0.1 Function IDs from DT
[0.00] percpu: Embedded 15 pages/cpu s30732 r8192 d22516 u61440
[0.00] pcpu-alloc: s30732 r8192 d22516 u61440 alloc=15*4096
[0.00] pcpu-alloc: [0] 0 [0] 1 
[0.00] Built 1 zonelists, mobility grouping on.  Total pages: 129452
[0.00] Kernel command line: console=ttyS0,115200 earlyprintk 
root=/dev/mmcblk1p5 rootfstype=ext4 rootwait panic=10 rw
[0.00] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, 
linear)
[0.00] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, 
linear)
[0.00] mem auto-init: stack:off, heap alloc:off, heap free:off
[0.00] Memory: 406620K/521888K available (7168K 

Re: [linux-sunxi] A20 mainline kernel 5.8.0 - some GPIO ports does not works

2020-07-10 Thread Milos Ladni
Thanks, i saw this in officialy kernel and dts for Lime2. It works perfect 
now:)

петак, 10. јул 2020. 08.06.46 UTC+2, plaes је написао/ла:
>
> On Thu, Jul 09, 2020 at 02:38:17PM -0700, Milos Ladni wrote: 
> > Hi, thank you very much! 
> > 
> > It works now. I totally forgot to enable ldo3 and ldo4:) 
> > I am using my custom board and i want to migrate from legacy 3.4 to 
> > mainline. 
>
> Sample patch for Olimex Lime2: 
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cd42ca0515d3952fc78a591618d57dd54f881d1f
>  
>
> > 
> > Thanks, 
> > Milos 
> > 
> > четвртак, 09. јул 2020. 19.06.05 UTC+2, Chen-Yu Tsai је написао/ла: 
> > > 
> > > Hi, 
> > > 
> > > On Fri, Jul 10, 2020 at 12:51 AM Milos Ladni  > > > wrote: 
> > > > 
> > > > Hi, 
> > > > 
> > > > I am using mainline kernel on my A20 board and can not get GPIO 
> working 
> > > for some ports. 
> > > > I tested them through standard sysfs and for pin number id i used 
> next : 
> > > (position of letter in alphabet - 1) * 32 + pin number 
> > > > I tried with PE0, PE1, PE2, and PE4, i think that whole PE port does 
> not 
> > > work. Pin is exported in /sys/class/gpioX and direction is set to 
> 'out' but 
> > > when i write 1 or 0 to value nothing happens (actually it changed 
> value for 
> > > 0.2~0.4V between logical 0 and 1). Pin numbers for that port was 
> > > (5-1)*32+pinNumber => 128 + pinNumber. 
> > > > In dtsi for A20 port E is by default intendent for CSI0 but CSI0 is 
> not 
> > > enabled in my case and i also tried to completly remove SCI0 from 
> linux 
> > > kernel and comment pin confiruration for CSI0 in dtsi file but it 
> still 
> > > does not works. 
> > > > I noticed this issue because i use LVDS display and my display 
> standby 
> > > pin is connected to PE2. 
> > > > After system is started i can login normally. After ~10 seconds i 
> can 
> > > see only this message in dmesg: 
> > > > 
> > > > [   27.180481] random: crng init done 
> > > > [   31.896048] vcc3v0: disabling 
> > > > [   31.899038] vcc5v0: disabling 
> > > > [   31.902015] ldo3: disabling 
> > > > [   31.905150] ldo4: disabling 
> > > > [   31.908346] ahci-5v: disabling 
> > > > [   31.911416] usb0-vbus: disabling 
> > > > [   31.914644] usb1-vbus: disabling 
> > > > 
> > > > After this message PE2 goes to LOW and never come back to HIGH 
> level. 
> > > > I also tried to completelly remove my LVDS display and i got the 
> same 
> > > behavior for all pins on PE port. 
> > > > I also tried to connect PE2 to pull-up 3V3 through 10k resistor but 
> > > without success. After ~30 seconds after i turn on device PE2 goes LOW 
> > > forever. 
> > > > Interesting part is that when it is HIGH it is 2.8, not 3.3V. Maybe 
> i 
> > > missed some configuration in dts file. 
> > > 
> > > What board are you using? 
> > > 
> > > Any board based on Allwinner's reference design will use one of the 
> > > LDOs at 2.8V to power the 
> > > PE and PG pin groups. This is because the two pingroups are almost 
> > > exclusively used for camera 
> > > sensors, which a lot of use 2.8V I/O levels. Now if you don't have 
> > > power for the pingroups, 
> > > i.e. the LDOs are off, then of course the pins don't work. 
> > > 
> > > First check your schematics to see if that's the case. Then you need 
> > > to properly wire up 
> > > pin power supplies using the vcc-pX-supply properties in the pinctrl 
> > > node. See other newer 
> > > boards for how that works. 
> > > 
> > > ChenYu 
> > > 
> > > > Also tried PG1 and does not works. 
> > > > Tried PH18, PH21 and it works. 
> > > > Tried PB14 and it works. 
> > > > Another ports i did not tried. 
> > > > 
> > > > Interesting part is that because i enegled gpio debug in kernel 
> setup i 
> > > always get message "gpio gpiochip0: Persistence not supported for GPIO 
> XXX" 
> > > does not matter if if it is PE port which does not work or PH port 
> which 
> > > works. 
> > > > 
> > > > Can someone check this issue or check my dts files? 
> > > > 
> > > > Thank you, 
> > > > Milos Ladicorbic 
> 

Re: [linux-sunxi] A20 mainline kernel 5.8.0 - some GPIO ports does not works

2020-07-09 Thread Milos Ladni
Hi, thank you very much!

It works now. I totally forgot to enable ldo3 and ldo4:)
I am using my custom board and i want to migrate from legacy 3.4 to 
mainline.

Thanks,
Milos

четвртак, 09. јул 2020. 19.06.05 UTC+2, Chen-Yu Tsai је написао/ла:
>
> Hi, 
>
> On Fri, Jul 10, 2020 at 12:51 AM Milos Ladni  > wrote: 
> > 
> > Hi, 
> > 
> > I am using mainline kernel on my A20 board and can not get GPIO working 
> for some ports. 
> > I tested them through standard sysfs and for pin number id i used next : 
> (position of letter in alphabet - 1) * 32 + pin number 
> > I tried with PE0, PE1, PE2, and PE4, i think that whole PE port does not 
> work. Pin is exported in /sys/class/gpioX and direction is set to 'out' but 
> when i write 1 or 0 to value nothing happens (actually it changed value for 
> 0.2~0.4V between logical 0 and 1). Pin numbers for that port was 
> (5-1)*32+pinNumber => 128 + pinNumber. 
> > In dtsi for A20 port E is by default intendent for CSI0 but CSI0 is not 
> enabled in my case and i also tried to completly remove SCI0 from linux 
> kernel and comment pin confiruration for CSI0 in dtsi file but it still 
> does not works. 
> > I noticed this issue because i use LVDS display and my display standby 
> pin is connected to PE2. 
> > After system is started i can login normally. After ~10 seconds i can 
> see only this message in dmesg: 
> > 
> > [   27.180481] random: crng init done 
> > [   31.896048] vcc3v0: disabling 
> > [   31.899038] vcc5v0: disabling 
> > [   31.902015] ldo3: disabling 
> > [   31.905150] ldo4: disabling 
> > [   31.908346] ahci-5v: disabling 
> > [   31.911416] usb0-vbus: disabling 
> > [   31.914644] usb1-vbus: disabling 
> > 
> > After this message PE2 goes to LOW and never come back to HIGH level. 
> > I also tried to completelly remove my LVDS display and i got the same 
> behavior for all pins on PE port. 
> > I also tried to connect PE2 to pull-up 3V3 through 10k resistor but 
> without success. After ~30 seconds after i turn on device PE2 goes LOW 
> forever. 
> > Interesting part is that when it is HIGH it is 2.8, not 3.3V. Maybe i 
> missed some configuration in dts file. 
>
> What board are you using? 
>
> Any board based on Allwinner's reference design will use one of the 
> LDOs at 2.8V to power the 
> PE and PG pin groups. This is because the two pingroups are almost 
> exclusively used for camera 
> sensors, which a lot of use 2.8V I/O levels. Now if you don't have 
> power for the pingroups, 
> i.e. the LDOs are off, then of course the pins don't work. 
>
> First check your schematics to see if that's the case. Then you need 
> to properly wire up 
> pin power supplies using the vcc-pX-supply properties in the pinctrl 
> node. See other newer 
> boards for how that works. 
>
> ChenYu 
>
> > Also tried PG1 and does not works. 
> > Tried PH18, PH21 and it works. 
> > Tried PB14 and it works. 
> > Another ports i did not tried. 
> > 
> > Interesting part is that because i enegled gpio debug in kernel setup i 
> always get message "gpio gpiochip0: Persistence not supported for GPIO XXX" 
> does not matter if if it is PE port which does not work or PH port which 
> works. 
> > 
> > Can someone check this issue or check my dts files? 
> > 
> > Thank you, 
> > Milos Ladicorbic 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "linux-sunxi" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to linux...@googlegroups.com . 
> > To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/linux-sunxi/3526d3a3-64ae-403c-9fa1-8507bfd693f1o%40googlegroups.com.
>  
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/da353c0a-2623-401e-816d-d1956b866aa5o%40googlegroups.com.


[linux-sunxi] A20 mainline kernel 5.8.0 - some GPIO ports does not works

2020-07-09 Thread Milos Ladni
Hi,

I am using mainline kernel on my A20 board and can not get GPIO working for 
some ports.
I tested them through standard sysfs and for pin number id i used next : 
(position of letter in alphabet - 1) * 32 + pin number
I tried with PE0, PE1, PE2, and PE4, i think that whole PE port does not 
work. Pin is exported in /sys/class/gpioX and direction is set to 'out' but 
when i write 1 or 0 to value nothing happens (actually it changed value for 
0.2~0.4V between logical 0 and 1). Pin numbers for that port was 
(5-1)*32+pinNumber => 128 + pinNumber.
In dtsi for A20 port E is by default intendent for CSI0 but CSI0 is not 
enabled in my case and i also tried to completly remove SCI0 from linux 
kernel and comment pin confiruration for CSI0 in dtsi file but it still 
does not works.
I noticed this issue because i use LVDS display and my display standby pin 
is connected to PE2.
After system is started i can login normally. After ~10 seconds i can see 
only this message in dmesg:

[   27.180481] random: crng init done
[   31.896048] vcc3v0: disabling
[   31.899038] vcc5v0: disabling
[   31.902015] ldo3: disabling
[   31.905150] ldo4: disabling
[   31.908346] ahci-5v: disabling
[   31.911416] usb0-vbus: disabling
[   31.914644] usb1-vbus: disabling

After this message PE2 goes to LOW and never come back to HIGH level.
I also tried to completelly remove my LVDS display and i got the same 
behavior for all pins on PE port.
I also tried to connect PE2 to pull-up 3V3 through 10k resistor but without 
success. After ~30 seconds after i turn on device PE2 goes LOW forever.
Interesting part is that when it is HIGH it is 2.8, not 3.3V. Maybe i 
missed some configuration in dts file.

Also tried PG1 and does not works.
Tried PH18, PH21 and it works.
Tried PB14 and it works.
Another ports i did not tried.

Interesting part is that because i enegled gpio debug in kernel setup i 
always get message "gpio gpiochip0: Persistence not supported for GPIO XXX" 
does not matter if if it is PE port which does not work or PH port which 
works.

Can someone check this issue or check my dts files?

Thank you,
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/3526d3a3-64ae-403c-9fa1-8507bfd693f1o%40googlegroups.com.
/*
 * Copyright 2015 Chen-Yu Tsai
 *
 * Chen-Yu Tsai 
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This file is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

/*
 * AXP202/209 Integrated Power Management Chip
 * http://www.x-powers.com/product/AXP20X.php
 * http://dl.linux-sunxi.org/AXP/AXP209%20Datasheet%20v1.0_cn.pdf
 */

 {
compatible = "x-powers,axp209";
interrupt-controller;
#interrupt-cells = <1>;

ac_power_supply: ac-power-supply {
compatible = "x-powers,axp202-ac-power-supply";
status = "disabled";
};

axp_adc: adc {
compatible = 

[linux-sunxi] Re: OV5640 1080@30FPS on CSI

2019-06-03 Thread Milos Ladni
Hi,

thank you for your update status. Finally, I also got 720P at ~25 fps. 
So, if someone needs info, OV5640 works with A20 at ~25 fps, the output 
resolution is 1280x720 (input resolution 2560x1440 and pixel binning are 
turned on, so sensor give to me half of the input). The CPU load is ~5% 
with simultaneous h.264 and mjpeg encoding with CEDAR engine. Kernel 
version sunxi-3.4.75.
The CPU load was in two places, the first one was in kernel space when CSI 
and OV5640 debug is enabled a lot of printk() messages rise CPU load to 50%.
The second one was in the part where I copy output buffers from CSI to 
CEDAR video engine by memcpy(). I rewrite this part and now I am using 
'V4L2_MEMORY_USERPTR' instead 'V4L2_MEMORY_MMAP', so v4l2 DMA copy this 
buffers directly to CEDRUS  for me...

Best regards,
Milos 

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/582d158d-41bd-4e08-bb43-9e7ee396c82f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: OV5640 1080@30FPS on CSI

2019-05-24 Thread Milos Ladni
Hi @lex,

sorry for wake up the topic but I am in similar problem with ov5640.
I am using A20 SoC and sunxi kernel 3.4. My goal is HD resolution 720p and 
25 fps.
Currently, I can get max 15fps (although on oscilloscope VSYNC has 30 Hz, 
HREF 22kHz, MCLK 24MHz, and PCLK 84MHz).
I am not sure why VSYNC is 30 Hz and SCI driver give to me only 15 fps. I 
can print debug message from CSI driver which tell me that 'frame interval' 
is 66 ms (~15fps). It looks like that CSI driver detects every second 
frame. On my application or gstreamer, I can get max 15 fps.
- Another issue is CPU load. When I start capturing frames form CSI sensor 
CPU in kernel space goes very high 60-70% on average for both cores.
It looks like SCI driver consumes CPU for something. I know that CPU load 
is from kernel space because I use 'mpstat -P ALL 2 5' and system column 
tell you CPU load for kernel space.
Did you manage to get ov5640 working properly or you give up?
Any help is welcome.

Best regards,
Milos Ladni

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/1e82b574-0485-42ae-8673-584ee997ed17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2 1/3] media: V3s: Add support for Allwinner CSI.

2017-10-16 Thread Milos Ladni
 Hello Yong,

Did you test CPU load during capture frames from CSI and now many fps did 
you get?
Recently i noticed problem with CPU load which is related to fps not to 
resolution on old 3.4.75 kernel on A20 platform.
I opened new topic few weeks ago but i did not get any answer yet..
Maybe you can give me some advice where to look for the problem.
Here is link of my topic: 
https://groups.google.com/forum/?hl=sr#!topic/linux-sunxi/3Vov9zGiSHk
On this link the problem is described in detail. 

Best regards,
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: tool to generate NAND image for LiveSuit usage

2017-10-16 Thread Milos Ladni
Hi,

First, i have never used  LiveSuit, i use PhoenixSuit..
Packing/Unpacking image for phoenixsuit have to be done with with 
imgRePacker tool.
Link: https://forum.xda-developers.com/showthread.php?t=1753473

My advice is to find already ready image which work with phoenixsuite for 
cubieboard2 and than try to modify it with imgRepacker.
I do not recommend  to start from scratch if you do not have experience 
with phoenix..

--- There are my short instruction how to do this ---
Assuming that your ready image has name like this 'debian_wheezy_7.4_.img'
Unpack image:
$ imgrepacker /noiso debian_wheezy_7.4_.img 
$ cd debian_wheezy_7.4_.img.dump 
Make 3 new directories where you will mount boot, root and user file 
systems.
Maybe you will do not have separated user file system and in that case 
mount only bootfs and rootfs.
$ mkdir bootfs
$ mkdir rootfs
$ mkdir userfs
Convert rootfs and userfs Android sparse images to raw images:
$ simg2img rootfs.fex rootfs.ext4.img
$ simg2img userfs.fex userfs.ext4.img
Mount images:
$ sudo mount -t vfat -o loop bootloader.fex bootfs
$ sudo mount -t ext4 -o loop rootfs.ext4.img rootfs
$ sudo mount -t ext4 -o loop userfs.ext4.img userfs
Now you can access to whole filesystem and change what you want.
After you're done with the changes you have to pack back user and root 
filesystems again.
$ sudo make_ext4fs -s -l 2432MB rootfs.fex ./rootfs 
$ sudo chown -R milos:milos userfs 
$ make_ext4fs -s -l 1024MB userfs.fex ./userfs 
Do not omit -s because you need sparse filesistem.
$ sudo chown milos:milos rootfs.fex
$ cd ../
$ sync
$ imgrepacker /noiso debian_wheezy_7.4_.img.dump
This is it.. Now you can try to flash your customized filesystem..

Good luck!
Milos,

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: A20 and CSI high load CPU

2017-10-10 Thread Milos Ladni
 Hi again,

Does anyone played with CSI recently?

I tried to change camera sensor from ov5642 to ov7670 and results are very 
similar.
640x480 15 fps 60% CPU. Just trigger frames from CSI nothing more.

In meanwhile i found out that after epoll wake up for reading VIDIOC_DQBUF 
execute fast and without errors but VIDIOC_QBUF new request for same buffer 
takes to long, between 4-15 ms.
I make some comparison with TVD which i mentioned in my first post and 
ioctl request for new buffer 'VIDIOC_QBUF' does not take more than 100-200 
us.
So, one of the problems are retention in ioctl(VIDIOC_QBUF) funftion .
I am very familiar with hardware generally and all this makes no sense for 
me..
I am willing to fix driver, but i need guidance and help from someone who 
is more familiar with SCI driver on A20 platform.

I also tried to use USERPTR instead of MMAP in V4L2 API and results are 
again similar.
With USERPTR you can get one important advantage when you planning to 
process image with Video Engine http://linux-sunxi.org/VE_Register_guide and 
there are no additional copy needed from CSI to VE.
First you need to allocate memory from VE and then tell to CSI to copy 
input frame over DMA directly to VideoEngine for further processing (in my 
case jpeg and h264 encoding).

It would be helpful to at least refer me to a person who might be able to 
understand the problem.

Best regards,
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] A20 and CSI high load CPU

2017-10-04 Thread Milos Ladni
 Hello,
 
I have connected ov5642 camera sensor to csi0 of custom board using A20 
with kernel linux-sunxi 3.4.75.sun7i+.

I have problem with high CPU load.
My goal is to encode 1280x720 25fps from ov5642 or similar CSI sensor to 
h264 and mjpeg.
For start i just read RAW YUV 422 frames from /dev/video1 and this cause 
high CPU load, for example:

QSXGA: 2592x1944 5 fps => 15% load CPU for that process.
UXGA: 1600x1200 10 fps => 30%
UXGA: 1600x1200 5 fps => 10-15%
720p: 1280x720 25 fps => 70-80%
720p: 1280x720 15 fps => 40%
720p: 1280x720 10 fps => 20%
720p: 1280x720 5fps => 10-15%
PAL: 720x576 25 fps => 85%
PAL: 720x576 15fps => 40-50%
VGA: 640x480 25 fps => 80%
VGA: 640x480 15 fps => 40%
QVGA: 320x240 15fps => 40-50%

I am using mmap() and currently i do not copy any frame anywhere, just 
trigger frames with QBUF and DQBUF from video device using v4l2 API. 
I saw that SCI driver support conversion from 422 to 420, so i tryed both 
combination and results are similar, it is little less CPU load without 
conversion from 422 to 420.
The same application i am using for read and encode analogue CVBS-TVIN 
/dev/video0 device 720x576 25fps and i do not have this kind of problem, 
CPU load is very low (<1%) for camera get frame thread process.
So, as far as i know if CSI use DMA for copy frame to his memory area which 
i later map with mmap() CPU load should be very low..
It looks like that CPU load depends from number of fps and not so much from 
bandwidth, how is it possible and does anyone know what is going on here?

I also tried test application which came from linux kernel source: 
/linux-sunxi_3.4/drivers/media/video/sunxi_csi/test/app_test.c but the 
results are same, very high CPU load for 1280x720 and for any another 25fps 
resolution.

--
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: Video Inputs for A20

2017-06-07 Thread Milos Ladni
It depends on what are your requirements, i tested analogue CVBS and it 
works ok with 4 channels simultaneous..
You can combine how do you want this tv inputs.. tvin0..4
I also tested long time ago CSI digital port with ov7670 but i do not 
remember which one CSI0 or CSI1.. And i think that i had some glitches from 
sensor but as i sad that was long time ago..

петак, 21. април 2017. 17.17.20 UTC+2, Monzer Darwish је написао/ла:
>
> Hello,
>
> I need to connect two cameras to A20 SOC, which type I should to use, CVBS 
> using analog video inputs or digital port like BT.656.
>
> Best Regards,
> Monzer
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Flashing NAND A20 from command line

2017-06-07 Thread Milos Ladni
Hello,

Is it possible to flash nand from linux command line?
I tried Phoenixsuite, PhoenixUSBPro and Livesuite on Win7, livesuit for 
linux but it is also graphical..

Thanks,
Milos

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: A20 - Get temperature and Serial

2017-05-15 Thread Milos Ladni
Hi,
1 - As far as i know A20 does not have temperature sensor that is user 
readable.
2 - I am not sure which PMU you are using but i suppose that it is axp209. 
It only have over temperature protection. 
But i am not sure, it has support for battery temperature monitoring but i 
have not used so far.
3 - For CPU serial port is not problem. You have to set fex file ant 
nothing else. Which pins you plan to use the serial port? If you have any 
problems i can help you with that.

All the best and good luck,
Milos

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: PoC tvin2jpeg_h264 with veisp scaling

2017-03-07 Thread Milos Ladni
 I'm glad to hear that.
I hope that you will find out what the cause is.

However, before ioctl reset, sometimes i had some strange glitches in h264 
decoded picture when work simultaneous with h264enc.
Some small blocks in the picture was wrong (usually upper left part of 
picture) color or something like that.

Milos Ladicorbic,

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: PoC tvin2jpeg_h264 with veisp scaling

2017-03-06 Thread Milos Ladni
 Hi,

> What i can suggest you to do is to make an experience, to check if the
> hardware is been correctly configured for each task.
>
> Before selecting the subengine for each task change, to do a hardware
> reset first. (In your tvin2jpeg.c, in function ve_selectsubengine put a
> call to the reset ioctl before selecting the subengine)
>
> This experience will allow us to arrive to this conclusions.
>
> * If things will break in all cases, is because the hardware is not been
> cleanly configured.
>
> * If this will fix, then congratulations you helped in finding what the
> hardware can or not can do. And this means that we have to keep track
> of the hardware state and reset it when things go off hand.

Thank you Manuel,
I resolve the issue by reset ioctl every time before select next 
subengine,  as you suggested.

Thank you very much!

Milos Ladicorbic,

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: PoC tvin2jpeg_h264 with veisp scaling

2017-03-02 Thread Milos Ladni
 Hi,

>  The application crashs(segfault?), and running under a debugger doesn't
> give any clues about what could be?

The app works fine and then in some arbitrary moment when need to decode 
new frame which consisting from few slices it stuck on first slice in this 
frame while first_mb_in_slice=0.
The h264Dec return 0x60017000 status code which means 'irec_busy', 
'intra_pred_busy' and 'mcri_busy'. What this flags means?
After that i can not clear this flags anymore and party begins.  It's look 
like whole h264 engine (Enc and Dec) go crazy.
When try to parse slice header from VLD i get incorrect data, whole slice 
header is filled with wrong data which of course cause segfault. Segfault 
happen because of wrong parsed data..
Like VLD memory buffer is out of order, some mess happened..
I tried to put h264Enc and h264Dec in same execute thread but  the same is 
happening.
When 0x60017000 status code once happen on h264Dec, h264Enc also stop 
working ant return some error status code when try to encode. It should be 
different subengines, is not?
It does not always happen in the same frame, even if i always play same 
source, there are no rules..
I know that you do not have time, do you know someone who can help me..?
How can I find out what happens to VLD?

I can play source with 'num_ref_frames=3' simultaneous with jpegEnc and 
jpegDec without problem but when i do not use h264Enc simultaneous.
I can play source with 'num_ref_frames=1' simultaneous with h264Enc, 
jpegEnc and jpegDec.

So close, yet so far..

Milos,

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: PoC tvin2jpeg_h264 with veisp scaling

2017-02-24 Thread Milos Ladni
Thank you Manuel!

I managed to make a H264 decoder and it works fine.
Now i can run all four operation simultaneous but...

Known bug:
For now the app can play source with 'num_ref_frames' greater or equal to 1 
but if i try to play source with 'num_ref_frames: 3' simultaneous with 
264Enc the app crash for unknown reasons.
If i play source with 'num_ref_frames: 1' it works ok..
If i play source with 'num_ref_frames: 3' it works ok..
If i run simultaneous only jpegEnc jpegDec and h264Dec all works no matter what 
the value of 'num_ref_frames' is.
But when i want simultaneous h264Enc and h264Dec with source for decoder 
with 'num_ref_frames: 3' the app crash..
There is no problem if  'num_ref_frames: 1'..
Very strange.. I am no sure why, h264Enc and h264Dec even do not use the 
same subengine..
Which is the best time to lock the hardware? 

Best regards,
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: PoC tvin2jpeg_h264 with veisp scaling

2017-01-10 Thread Milos Ladni
 Hi again,

I just wanted to make PoC test simultaneous tasks for my future project and 
to show others how much this platform is powerful.
I need tvin, h264-jpeg encoder+scaler and decoder. Maybe i do not need all 
four operation simultaneous, but for now i have two cases:
- tvin+h264Enc+jpegEnc+scaler + jpegDec (this i have already finished in my 
PoC app)
- tvin+h264Enc+jpegEnc+scaler + h264Dec (i am working on this)
Currently the major problem is vdpau, because i can not use any other 
feature od VE while vdpau is working.
I do not need low level app, just  opportunity to do simultaneous tasks.
Do you have suggestion how to do that?

> With this codecs, things get more complex and is more easy to just try
> to use an existent media api with already media application support,
> than have to write everything for scratch.

On which api you specifically thinking?

Milos,

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: PoC tvin2jpeg_h264 with veisp scaling

2017-01-09 Thread Milos Ladni
 Hello Manuel,
I just added  hw JPEG decoder in my apps.
Now i can do simultaneous h264 encoding, jpeg encoding and jpeg decoding 
with just ~20% CPU and 25 fps.
How app works:
Take frame from camera tv-in CVBS 720x576, show it on display by sunxi 
display engine in smaller resolution 542x359
position x30y121 (use display scaler mode), encode raw frame to jpeg 
(VGA-QVGA) /tmp/jpegTestXXX.jpg, after that decode
the same frame from previous encoded jpeg /tmp/jpegTestXXX.jpg to raw, show 
decodec frame on display (right up position 200x150 x580y121),
encode raw frame from camera to h264 /tmp/tvin.h264 and mux it to mkv 
container /tmp/tvin.mkv.

Do you know for any simple PoC example for h264 decoder? 
I would like to add all four operation jpeg-h264 encoder-decoder to my 
example app.
I know for vdpau but i think that it's a little more complicated. I need 
simple PoC h264 decoder app.

Best regards,
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] PoC tvin2jpeg_h264 with veisp scaling

2016-12-02 Thread Milos Ladni
Hi,
I'm sorry for the delay.
I added this to my example and it works..
Thank you Manuel.

Best regards,
Milos Ladicorbic

On Friday, November 25, 2016 at 10:37:24 PM UTC+1, Manuel Braga wrote:
>
> On Thu, 24 Nov 2016 23:14:21 -0800 (PST) Milos Ladni 
> <milosla...@gmail.com > wrote: 
> > 
> > It would be nice to implement this. 
> > If you have a time to find example please send me. 
>
> This is what i did 2years ago to learn how to use libavformat to do 
> muxing, was almost perfect expect for some needed fixes. 
>
> This was only done to learn and not to be used, and was made to be very 
> minimal as can be seen by the definition of global static context. 
> But if this facilitates in any way, then great. 
>
> http://dl.linux-sunxi.org/users/nove/testmux.tar.gz 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] PoC tvin2jpeg_h264 with veisp scaling

2016-11-24 Thread Milos Ladni
Hi,

>  last time maybe wasn't very clear explained what this
> >  "divide scaler" really is.
>

You are right, i did not understand what divide scaler is.
I do not really need raw pictures when i have arbitrary scaler for encoding,
this was just for test, i'll fix it.

> Another thing were you speak about muxing into video containers, if you
> > have interest to implement this. I have somewhere a very simple example
> > of using ffmpeg libavformat to do this, much more easy to understand
> > that any of ffmpeg examples or test cases.
> > Just tell, i have to go find where is, first.
>

It would be nice to implement this. 
If you have a time to find example please send me.

--
Milos Ladicorbic


-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: PoC tvin2jpeg_h264 with veisp scaling

2016-11-24 Thread Milos Ladni
Sorry i do not have H3, only A10, A10s, A13, A20

On Thursday, November 24, 2016 at 2:36:53 PM UTC+1, @lex wrote:
>
> Have you tried to port it (JPEG encoder) to H3?
>
> On Thursday, November 24, 2016 at 10:20:38 AM UTC-2, Milos Ladni wrote:
>>
>> Hello,
>>
>> This is yet another Proof of Concept analogue TV decoder (TV-IN) and 
>> hardware accelerated H264-JPEG encoder with VEISP scaling for sunxi.
>> This example capture frames from tvin (CVBS) scale it to VGA or QVGA and 
>> simultaneous encode frame to jpeg image and h264 stream.
>> sunxi-tvin2jpeg_h264 <https://github.com/milosladni/sunxi-tvin2jpeg_h264>
>>
>> --
>> Milos Ladicorbic
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] ISP scaling A20

2016-11-24 Thread Milos Ladni

If anybody else is interesting there is my project:
https://groups.google.com/forum/#!topic/linux-sunxi/pI0orsfdh_U

--
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] PoC tvin2jpeg_h264 with veisp scaling

2016-11-24 Thread Milos Ladni
Hello,

This is yet another Proof of Concept analogue TV decoder (TV-IN) and 
hardware accelerated H264-JPEG encoder with VEISP scaling for sunxi.
This example capture frames from tvin (CVBS) scale it to VGA or QVGA and 
simultaneous encode frame to jpeg image and h264 stream.
sunxi-tvin2jpeg_h264 

--
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] ISP scaling A20

2016-10-28 Thread Milos Ladni
It works now.
I forgot to set MACC_ISP_OUTPIC_STRIDE, just MACC_ISP_PIC_STRIDE. 
I do not know how i did not see that, sorry and thank you very much again.

--
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] ISP scaling A20

2016-10-27 Thread Milos Ladni
Cool, arbitrary scaler is working now..:)
Thank you a lot Manuel!

By the way, divide-scaler is not working properly yet, maybe i do not need 
it anymore but It would be nice if i can contribute to the development of 
VE.
These days i will try to merge tvin and hw jpeg encoder in simple 
application and i will push it on github. Maybe one day someone needs it..

> This looks familiar, but i can't remember what. 
> Are you flushing the cache for the buffers? 

Yes, i am flushing the buffers. 
I am think that hardware has some bugs or there are missing documentation 
how to do that.
--
Milos Ladicorbic

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] ISP scaling A20

2016-10-26 Thread Milos Ladni
Hi.

Today i have made some modifications according to your instructions.
So, jpeg encoding without dividing is working well.
But when i try to add divider in encode chain there are some problems (i 
tried to divide source image by 2). 
It looks like it fill just first 360 bytes (half of 720 in my case) for 
both output raw buffers Y and C and nothing else.
I added in attache my output picture, you can see that it looks like last 
line in source image.
My chain is look like this:
- select VEISP subengine (MACC_VE_CTRL_ENGINE 0:3 = 0xa)
- set buffers VEISP. VE_ISP_PIC_LUMA , VE_ISP_PIC_CHROMA to source buffers 
and VE_ISP_OUTPUT_LUMA, VE_ISP_OUTPUT_CHROMA to output buffers.
- set VE_ISP_PIC_SIZE, VE_ISP_PIC_STRIDE size to original source size 
720x576 to match macroblocks 16x16 size.
- from VE_ISP_CTRL set MACC_ISP_CTRL_OUTPUT_EN bit19, division factor Bits 
[27:25]  to 0x2 and MACC_ISP_CTRL_IRQ_EN bit0.
- run veisp -> set  VE_ISP_TRIG
- wait VE IOCTL_WAIT_VE
- now select AVC subengine (MACC_VE_CTRL_ENGINE 0:3 = 0xb)
- set buffers VEISP. VE_ISP_PIC_LUMA , VE_ISP_PIC_CHROMA to output buffers 
which was used for VE_ISP_OUTPUT_LUMA-CHROMA.
- set VE_ISP_PIC_SIZE, VE_ISP_PIC_STRIDE size to scaled buffer size (half  
of original source frame 360x288) to match macroblocks 16x16 size.
Other procedures are same as in simple encoding without dividing.

--
Milos Ladicorbic,

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


veisp.7z
Description: application/7z-compressed


Re: [linux-sunxi] ISP scaling A20

2016-10-25 Thread Milos Ladni
Hi Manuel,

thanks for your reply, your e-mails encouraging me.
I think that in first step this can be quick and more simpler solution.
At first i will try this scale down with VEISP scaler-divider (size divided 
by 1, 2 and 4 factors) and then if this is done and if you can get me some 
instructions i can write more flexible solution from your first proposal.
For me, the best solution would be standard VGA and QVGA resolutions. Okay, 
i can crop image from 720x576 to 640x480 by software and than scale down 
with VEISP divider if i need but this is rough solution with unnecessary 
copying. 
For simpler solution i suppose that i need to set MACC_ISP_SCALER_FACTOR as 
you mentioned to 1, 2 or 4 but i am not sure what else should be done? This 
registers are not described in detail.
This days i am locking in your PoC jpeg encoder as you mentioned before and 
i hope that i will succeed to scale down source image by VEISP divider.

Best regards,
Milos


On Monday, October 24, 2016 at 7:38:56 PM UTC+2, Manuel Braga wrote:
>
> Hi. 
>
> On Fri, 21 Oct 2016 03:19:46 -0700 (PDT) Milos Ladni 
> <milosla...@gmail.com > wrote: 
> > Hi everyone, 
> > 
> > Because there are PoC of hardware JPEG encoding and decoding, i am 
> > now interesting of hw scaling.. 
> > Does does anyone tried to scale image (raw yuv 4:2:2 4:2:0 or rgb) 
> > with A20 hardware? 
> > How can i do this? I need scaler to scale image from one resolution 
> > to another. 
> > Concretely i read frame from tvin 720x576 4:2:0 and convert it to 
> > jpeg with libjpegturbo, but i want to switch to hw scaler-encoder 
>
> I forgot last time, there is another way from what was writing in the 
> previous email, but is only better if what is need is only a scale down 
> image at multiple of image sizes (size divided by 1, 2 and 4 factors) 
>
> As said, the VEISP has a scaler that can use arbitrary scale factors 
> (within a min/max), but doesn't need to use it, because when configured 
> to (also) output raw pixels is possible to choose the outputted size. 
> For your example of a source of 720x576, it can output (simultaneous 
> when encoding) the sizes 720x576 or 360x288 or 180x144. 
>
> If this isn't what you are looking or instead also wants to correct 
> the aspect ratio to get square pixels, then the only option is to use 
> the arbitrary scale factor scaler, as talked in the other email. 
>
>
> > conversion now. The best solution would be 
> > {[raw image] -> [scaler] -> [raw image]} 
> >  but alternative solution can be 
> > {[raw image] -> [scaler -> encoder (jpeg-h264)] -> [compressed 
> > image-stream]} 
> > Can i use ISP as separated block or i need to use it as part of 
> > jpeg-h264 encoder? 
> > Can i utilize G2D for this purpose for example? 
> > Does anyone tried anything similar with A20? 
> > 
>
> -- 
> Manuel Braga 
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] ISP scaling A20

2016-10-21 Thread Milos Ladni
Hi everyone,

Because there are PoC of hardware JPEG encoding and decoding, i am now 
interesting of hw scaling..
Does does anyone tried to scale image (raw yuv 4:2:2 4:2:0 or rgb) with A20 
hardware?
How can i do this? I need scaler to scale image from one resolution to 
another.
Concretely i read frame from tvin 720x576 4:2:0 and convert it to jpeg with 
libjpegturbo, but i want to switch to hw scaler-encoder conversion now.
The best solution would be 
{[raw image] -> [scaler] -> [raw image]}
 but alternative solution can be 
{[raw image] -> [scaler -> encoder (jpeg-h264)] -> [compressed 
image-stream]}
Can i use ISP as separated block or i need to use it as part of jpeg-h264 
encoder?
Can i utilize G2D for this purpose for example?
Does anyone tried anything similar with A20?

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.