Strontium Posted February 24, 2018 Share Posted February 24, 2018 (edited) Well it took me longer than i hoped but i have managed to forward port icenowys code for TVE on the H2+/H3 to mainline armbian. It seems to work totally fine, with a few caveats. First: Sample images of it in action -> https://imgur.com/a/vXQEM Second: the patch itself -> https://github.com/stevenj/h3-tve/tree/v0.0.11 Third a prebuilt image for Orange Pi Zero: -> https://github.com/stevenj/h3-tve/releases/tag/v0.0.11 Howto: just put the patch into userpatches for the sunxi-next kernel, and build. it should apply cleanly. Its for H2+/H3. I have only tried it on a orange pi zero, but it should work on all H2+/H3 boards. You then need to edit /boot/armbianEnv.txt add tve to overlays to enable it. the driver will only run and enable tv out when the tv out devices are specifically enabled, so i created an overlay which does this. If you want to turn TV out off, just remove tve from the overlays line. My armbianEnv.txt overlays looks like this: overlays=usbhost2 usbhost3 tve If you want copious amounts of DRM debug info in your logs, add this as well: extraargs=drm.debug=0xF Its not needed, unless you really want the debug info. Notes: 1. The default mode is PAL, with 720x576 resolution. Thats outside of normal PAL displayable area, and so the screen overscans. I dont know how to correct this, although its mostly just annoying with terminals. I also don't know how to change the video mode to NTSC. 2. The standard font is a bit thin for composite video, and causes slight strobing and color impurity. Its because PAL needs pixels to be a certain MINIMUM width or color information can not be properly encoded. A way to resolve this is use : # apt-get install fbterm ... $ fbterm -s 20 This will run a terminal which is easy to change the font, and pick a bigger one. its much easier to read. Look at the help for fbterm to work out everything it can do. 3. I used the program "fim" to display the test images. there are others for doing stuff on the terminal. 4. I haven't tried X. I am not interested in running an X terminal on a TV, but it should probably work fine. Other than that it all seems good. I originally tested my hardware with the legacy kernel, and the image quality from this patch seems superior to what the legacy kernel produces. (legacy was noisy) The only other thing you need to know is Orange Pi Zero is missing filter circuity from its Composite Output, the most important thing you need to do is put a 50 ohm resistor between the signal and GND. i soldered one inside my RCA connector, it fits fine and isn't too difficult. IF you don't do this the image will bloom and look like total crap, so you have been warned. As this patch allows TVE to be enabled/disabled through use of the Device Tree overlays, i think it should be fine if the Armbian devs want to include it. I am happy to clean out some of the debug messages i added if they are interested in making a standard part of the build. If not, its easy enough to build your own image, just follow the guides on how to rebuild armbian. EDIT: I need to mention, all props go to Icenowy Zheng who wrote the original driver. I just tweaked the device tree stuff and got it in a state where it can apply cleanly to the armbian mainline kernel and build system. Original code is here: https://github.com/Icenowy/linux/tree/tve-v2 Edited February 26, 2018 by Strontium Add reference and attribution to original code. 6 Quote Link to comment Share on other sites More sharing options...
Strontium Posted February 28, 2018 Author Share Posted February 28, 2018 Just an update, X installs and runs fine on the Orange PI Zero using my patch. HOWTO: Install a desktop using sudo tasksel after its all finished properly, reboot. You will then get this:https://imgur.com/a/seu9t if you want to change video mode, you can do it with xrandr like this: DISPLAY=:0 xrandr --output Composite-1 --mode NTSC DISPLAY=:0 xrandr --output Composite-1 --mode PAL You only need the "DISPLAY=:0" if you are doing the mode setting from a ssh terminal. Supposedly xrandr can scale the desktop and move it around (which could help with the overcan problem) but i couldn't get it to work in the 5 minutes I allocated to testing it. 1 Quote Link to comment Share on other sites More sharing options...
giri@nwrk.biz Posted November 20, 2018 Share Posted November 20, 2018 Hint on how to maybe fix overscanning: set a smaller resolution by kernel parameter (example): video=Composite-1:720x480 Move the picture using this tool: https://projects.nwrk.biz/projects/allwinner-tvout This is a similar approach like I did on legacy kernel (read here) 0 Quote Link to comment Share on other sites More sharing options...
dony71 Posted December 4, 2018 Share Posted December 4, 2018 I have this in dmesg ... what could it be wrong? sun4i-drm display-engine: No panel or bridge found... RGB output disabled also lsmod should show sun4i_tv? it didn't show in my case attached are debug and kernel log debug kern.log 0 Quote Link to comment Share on other sites More sharing options...
dony71 Posted December 5, 2018 Share Posted December 5, 2018 On 2/27/2018 at 6:41 PM, Strontium said: Just an update, X installs and runs fine on the Orange PI Zero using my patch. HOWTO: Install a desktop using sudo tasksel after its all finished properly, reboot. You will then get this:https://imgur.com/a/seu9t if you want to change video mode, you can do it with xrandr like this: DISPLAY=:0 xrandr --output Composite-1 --mode NTSC DISPLAY=:0 xrandr --output Composite-1 --mode PAL You only need the "DISPLAY=:0" if you are doing the mode setting from a ssh terminal. Supposedly xrandr can scale the desktop and move it around (which could help with the overcan problem) but i couldn't get it to work in the 5 minutes I allocated to testing it. how to set NTSC mode if I don't have X11 ?? 0 Quote Link to comment Share on other sites More sharing options...
dony71 Posted December 6, 2018 Share Posted December 6, 2018 On 12/4/2018 at 2:49 PM, dony71 said: I have this in dmesg ... what could it be wrong? sun4i-drm display-engine: No panel or bridge found... RGB output disabled also lsmod should show sun4i_tv? it didn't show in my case attached are debug and kernel log debug kern.log I don't know why tve overlay is not being recognized in armbianEnv.txt so I decide to change board dts Updated log attached and notice component /soc/tv-encoder@1e00000 being added However why reported component No output to bind?? As a result sun4i_tv not showing in lsmod Anybody has clue? debug kern.log 0 Quote Link to comment Share on other sites More sharing options...
dony71 Posted December 10, 2018 Share Posted December 10, 2018 On 11/20/2018 at 2:55 PM, giri@nwrk.biz said: Hint on how to maybe fix overscanning: set a smaller resolution by kernel parameter (example): video=Composite-1:720x480 Move the picture using this tool: https://projects.nwrk.biz/projects/allwinner-tvout This is a similar approach like I did on legacy kernel (read here) how do you set kernel parameter 'video=Composite-1:720x480' for mainline kernel ? 0 Quote Link to comment Share on other sites More sharing options...
krapows Posted August 23, 2019 Share Posted August 23, 2019 I don't know how to patch, can someone help me? 0 Quote Link to comment Share on other sites More sharing options...
Cesar Berci Posted January 17, 2021 Share Posted January 17, 2021 Hi, I have tried to use this patch with the current version and get this message from compiler: [ warn ] * [c] z01_h3-tve-11.patch [ failed ] The path is in userpatches/kernel/sunxi-current 0 Quote Link to comment Share on other sites More sharing options...
Werner Posted January 18, 2021 Share Posted January 18, 2021 6 hours ago, Cesar Berci said: Hi, I have tried to use this patch with the current version and get this message from compiler: [ warn ] * [c] z01_h3-tve-11.patch [ failed ] The path is in userpatches/kernel/sunxi-current Quote +++ linux-4.14.y-tve/arch/arm/boot/dts/overlay/Makefile 2018-02-20 20:07:56.193893833 +0800 sunxi-current is 5.10.y atm. So patch might either have been upstreamed already or needs adjustments to work again. Check output/debug folder for further details. 0 Quote Link to comment Share on other sites More sharing options...
Cesar Berci Posted January 18, 2021 Share Posted January 18, 2021 Compiler log: Processing file /home/cesar/dev/build/userpatches/kernel/sunxi-current/z01_h3-tve-11.patch 1 out of 1 hunk FAILED -- saving rejects to file arch/arm/boot/dts/overlay/Makefile.rej The text leading up to this was: -------------------------- |diff -Naur -x '*.orig' -x .git -x '.git*' -x '.get*' -x .mailmap -x .cocciconfig --no-dereference linux-4.14.y/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt linux-4.14.y-tve/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt |--- linux-4.14.y/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt 2018-02-20 10:42:18.000000000 +0800 |+++ linux-4.14.y-tve/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt 2018-02-20 18:48:28.344412523 +0800 -------------------------- No file to patch. Skipping patch. What can I change to compile this patch? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
jernej Posted January 18, 2021 Share Posted January 18, 2021 16 minutes ago, Cesar Berci said: What can I change to compile this patch? Just remove parts related sun4i-drm.txt from the patch. It's only documentation which was moved and it's not important for the end goal. 0 Quote Link to comment Share on other sites More sharing options...
Cesar Berci Posted January 20, 2021 Share Posted January 20, 2021 Unfortunately, there are differences in many files from version 4.14 to the current version 5.10, and I could create a new patch to the current version. Modified files: 1 out of 1 hunk FAILED -- saving rejects to file arch/arm/boot/dts/overlay/Makefile.rej 3 out of 6 hunks FAILED -- saving rejects to file drivers/gpu/drm/sun4i/sun4i_drv.c.rej 9 out of 17 hunks FAILED -- saving rejects to file drivers/gpu/drm/sun4i/sun4i_tcon.c.rej 1 out of 1 hunk FAILED -- saving rejects to file drivers/gpu/drm/sun4i/sun4i_tcon.h.rej 3 out of 13 hunks FAILED -- saving rejects to file drivers/gpu/drm/sun4i/sun4i_tv.c.rej 4 out of 8 hunks FAILED -- saving rejects to file drivers/gpu/drm/sun4i/sun8i_mixer.c.rej Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt Someone knows an alternative patch, working with the current version? Thanks for all help! 0 Quote Link to comment Share on other sites More sharing options...
jernej Posted January 20, 2021 Share Posted January 20, 2021 you can go through changes by hand and adapt the code. I do not know newer version. EDIT: now that I'm looking at the patch, I see that some changes are not needed. 0 Quote Link to comment Share on other sites More sharing options...
jernej Posted January 20, 2021 Share Posted January 20, 2021 @Cesar Berci it got me interested enough that I ported changes to v5.10 with cleaner approach. Here you have commit: https://github.com/jernejsk/linux-1/commit/ad153ef6ee5be33531187f97d5fa0c07455dc795 NOTE: You have to enable tve node in DT you want. I did that in OPi PC. 2 Quote Link to comment Share on other sites More sharing options...
JORGETECH Posted July 20, 2021 Share Posted July 20, 2021 On 1/20/2021 at 10:19 PM, jernej said: @Cesar Berci it got me interested enough that I ported changes to v5.10 with cleaner approach. Here you have commit: https://github.com/jernejsk/linux-1/commit/ad153ef6ee5be33531187f97d5fa0c07455dc795 NOTE: You have to enable tve node in DT you want. I did that in OPi PC. Any hopes for mainlining with Armbian/Linux? Now it could be accepted since it's a cleaner DT overlay. 0 Quote Link to comment Share on other sites More sharing options...
vinpwey Posted May 6, 2023 Share Posted May 6, 2023 On 1/20/2021 at 10:19 PM, jernej said: it got me interested enough that I ported changes to v5.10 with cleaner approach. Here you have commit: https://github.com/jernejsk/linux-1/commit/ad153ef6ee5be33531187f97d5fa0c07455dc795 NOTE: You have to enable tve node in DT you want. I did that in OPi PC. hello could you explain to me how to use what you have done or at least how to do so that i finally have a cvbs display on my nanopi duo 2 which also has an allwiner h3 chip. unfortunately I'm French I have to use Google Translate so I struggle a little more. I had succeeded in the past but my SD card dropped... 0 Quote Link to comment Share on other sites More sharing options...
usual user Posted May 6, 2023 Share Posted May 6, 2023 https://github.com/robertojguerra/orangepi-zero-full-setup/blob/main/README2.md 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.