Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 2465|Reply: 4

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

[Copy link]

3

Threads

11

Posts

83

Credits

Registered member

Rank: 2

Credits
83
Post time 2018-2-26 21:18:58 | Show all posts |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 the Code
If you want copious amounts of DRM debug info in your logs, add this as well:
  1. extraargs=drm.debug=0xF
Copy the 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 the 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 the Code

2

Threads

4

Posts

22

Credits

Novice

Rank: 1

Credits
22
Post time 2018-2-28 07:12:49 | Show all posts
thanks

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

3

Threads

11

Posts

83

Credits

Registered member

Rank: 2

Credits
83
 Author| Post time 2018-2-28 10:36:58 | Show all posts
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 the 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 the 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
Post time 2018-3-30 16:15:37 | Show all posts
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
Post time 2018-4-3 22:05:12 | Show all posts
if anyone is interested, for NTSC at startup, add this to the kernel parameters:
  1. video=Composite-1:720x480
Copy the 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 the Code
I can't seem to get fbset working to fix the overscan for the console, however.
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-5-27 17:03 GMT+8 , Processed in 0.029231 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list