View: 17570|Reply: 10

TVout for Orange PI Zero and other H2/H3 boards, Mainline Kernel, WORKING

[Copy link]

3

threads

10

posts

83

credits

Registered member

Rank: 2

credits
83
Published in 2018-2-26 21:18:58 | Show all floors |Read mode
Cross posted from Armbian forums, in case people don't read it over there:

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:
  1. overlays=usbhost2 usbhost3 tve
Copy code
If you want copious amounts of DRM debug info in your logs, add this as well:
  1. extraargs=drm.debug=0xF
Copy code
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 :
  1. # apt-get install fbterm
  2. ...
  3. $ fbterm -s 20
Copy code
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.

Its easy enough to build your own image, just follow the guides on how to rebuild armbian.

I also 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:
  1. https://github.com/Icenowy/linux/tree/tve-v2
Copy code

2

threads

4

posts

22

credits

Novice

Rank: 1

credits
22
Published in 2018-2-28 07:12:49 | Show all floors
thanks

One question,  With this I can see the ubuntu desktop?

3

threads

10

posts

83

credits

Registered member

Rank: 2

credits
83
 Author| Published in 2018-2-28 10:36:58 | Show all floors
Edited by strontium at 2018-2-28 10:38

Note: I am using Debian Stretch, not Ubuntu.  However, my patch is just for the kernel, so you can apply it and build an Ubuntu image if you like, it will work similarly.

The answer is YES.

Install a desktop using
  1. sudo tasksel
Copy code

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:
  1. DISPLAY=:0 xrandr --output Composite-1 --mode NTSC
  2. DISPLAY=:0 xrandr --output Composite-1 --mode PAL
Copy code
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.

0

threads

2

posts

32

credits

Novice

Rank: 1

credits
32
Published in 2018-3-30 16:15:37 | Show all floors
Thanks for the patch.
It works with NTSC, I just tried it, the resolution is 720x640 in this mode, with a 640x430 displayed window.

For the overscan however, it is not possible to usexrandr to solve the issue to my knowledge. Normally a xrandr --mode 640x430 --panning 720x640 but this mode is not available...

If you find how to enable NTSC at boot, I would be interested !

0

threads

2

posts

32

credits

Novice

Rank: 1

credits
32
Published in 2018-4-3 22:05:12 | Show all floors
if anyone is interested, for NTSC at startup, add this to the kernel parameters:
  1. video=Composite-1:720x480
Copy code
Although it doesn't seem to be possible to fix the overscan issue with xrandr, a possible workaround is to scale the image and declare a panning inside of it so that it is at least 720x{576,480}
For NTSC, I have something like 680x460 with 31x28margins (although my tv is probably not a reference), giving:
  1. xrandr --output Composite-1 --mode NTSC --scale 1.1x1.04 --panning 720x480+34+29
Copy code
I can't seem to get fbset working to fix the overscan for the console, however.

0

threads

1

posts

14

credits

Novice

Rank: 1

credits
14
Published in 2020-6-25 23:47:28 | Show all floors
Is this going to be in the official kernel repo?

0

threads

12

posts

60

credits

Registered member

Rank: 2

credits
60
Published in 2022-12-14 14:53:42 | Show all floors
Simply add the patch to the sunxi-next kernel's userpatches trap the cat and la times crossword build. It must be applied precisely. For H2+/H3 alone. Although I've only tested it on an Orange Pi Zero, all H2+/H3 boards should be compatible.

0

threads

13

posts

64

credits

Registered member

Rank: 2

credits
64
Published in 2023-3-13 16:29:07 | Show all floors
I think making a website like you is an advantage for you, I'm happy to share my feelings with everyone, I am very passionate about the game because it is very interesting. Please take the time to experience with me here: foodle

0

threads

4

posts

14

credits

Novice

Rank: 1

credits
14
Published in 2023-5-23 11:18:57 | Show all floors
This may involve editing the device tree configuration rankdle or kernel command line parameters to enable TVout support and configure the specific video mode or resolution.

0

threads

26

posts

70

credits

Registered member

Rank: 2

credits
70
Published in 2023-7-13 10:59:53 | Show all floors
Thank you for sharing the information about forwarding port icenowy's code for TVE on the H2+/H3 to mainline Armbian. It's great to see that you have successfully implemented it and provided a detailed guide for others to follow. pge outage map
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list