PSA: Orange Pi Zero expansion board tv-out not working solution
0

10 posts in this topic

Having invested many, many hours getting the video out to work on my recently purchased Orange Pi Zero kit, I'd like to leave this heads up for the next person having trouble with video out.  In my case, none of the advice I could find in this forum or elsewhere seemed to make any difference.  If you find yourself in a similar situation, here are some things you should know.

  1. The latest Armbian images for the OrangePi Zero enable composite video out by default.  It should just work.  (Well at least the Ubuntu image -- I never actually verified Debian Jesse worked after I fixed my expansion board.)  You should NOT need to fiddle with /etc/modules or .fex files.  Although that bit of information can be found in other posts on this forum, it took me a while to stumble across it, so I'm calling it out here.
  2. Don't trust the expansion board or your AV cable.  If you hook everything up and don't get video right away, the first thing to try is connecting your monitor directly to the GND and TV-OUT pins on the 13-pin connector.  Regretfully, I only resorted to this after much time spent futzing with other things.  In my case, not only was my expansion board borked, but the supposedly Zune/RaspberryPi compatible AV cable I got from Amazon actually had the ground and video swapped on the yellow RCA plug.
  3. The expansion board adds a bit of circuitry to the tv-out line, an inductor, two capacitors and a resistor, which I'm guessing is some sort of filter that attempts to "clean up" the video signal.  Being that you can hook up video directly to the OrangePi Zero without an expansion board, it would seem this filtering is entirely optional.
  4. I happened to notice (while checking continuity with a multitester) that the resistance between the GND and TV-OUT pins on the bare, unpowered OrangePi Zero board was effectively an open circuit, but when the expansion board was installed, it changed to approximately 50 ohms.  It seemed to me that all this would accomplish is to pull the composite video signal very close to ground and hold it there.  On a hunch, I took an Xacto knife and carefully scraped R359 from the filter circuit off of the expansion board.  This did the trick.  Now, with a proper AV cable,  my monitor could pick up a signal on its CVBS port.  I've attached a picture of the expansion board with the location of this resistor circled in red.  Maybe I just had a bad resistor, but if you've tried everything else, it may be worth knowing that removing this resistor can't hurt and is worth trying.

 

opi0-expansion.jpg

Share this post


Link to post
Share on other sites

To add to this: The problem with the TRRS plug is that there exist a few pin/tip definitions so you can never trust any cable and the one Xunlong sells seems to use unusual color coding.

 

And if you solved this problem wasting a few hours of your live then most probably you run in huge overscan issues with your TV that can not be solved on OPi Zero side but only on TV's side (if at all):

 

In other words: consider CVBS broken by design and OPi Zero a headless device :) 

Share this post


Link to post
Share on other sites
9 hours ago, davedsbca said:

I happened to notice (while checking continuity with a multitester) that the resistance between the GND and TV-OUT pins on the bare, unpowered OrangePi Zero board was effectively an open circuit, but when the expansion board was installed, it changed to approximately 50 ohms.  It seemed to me that all this would accomplish is to pull the composite video signal very close to ground and hold it there.  On a hunch, I took an Xacto knife and carefully scraped R359 from the filter circuit off of the expansion board.  This did the trick.  Now, with a proper AV cable,  my monitor could pick up a signal on its CVBS port.  I've attached a picture of the expansion board with the location of this resistor circled in red.  Maybe I just had a bad resistor, but if you've tried everything else, it may be worth knowing that removing this resistor can't hurt and is worth trying.

This should implement a basic impedance matching (though it should be closer to 75 Ohms than to 50 if I understand it correctly). All other Orange Pi boards that have CVBS output on the 3.5mm jack have this circuit on the main board.

Share this post


Link to post
Share on other sites
On 20. 3. 2017 at 1:20 AM, davedsbca said:

supposedly Zune/RaspberryPi compatible AV cable I got from Amazon actually had the ground and video swapped on the yellow RCA plug.

 

On 20. 3. 2017 at 7:22 AM, tkaiser said:

The problem with the TRRS plug is that there exist a few pin/tip definitions so you can never trust any cable

 

Fortunatelly, most cables/wirings are either OMTP or CTIA compliant. For that reason, I bought cheap OMTP to CTIA adapter from ebay, which solves many annoyances and now I don't need to worry anymore about pinout.

Share this post


Link to post
Share on other sites
On 20. März 2017 at 7:22 AM, tkaiser said:

To add to this: The problem with the TRRS plug is that there exist a few pin/tip definitions so you can never trust any cable and the one Xunlong sells seems to use unusual color coding.

 

And if you solved this problem wasting a few hours of your live then most probably you run in huge overscan issues with your TV that can not be solved on OPi Zero side but only on TV's side (if at all):

 

In other words: consider CVBS broken by design and OPi Zero a headless device :) 

 

 

Hey folks,

just registered to let you know it is possible to adjust the resolution of the Orange pi Zero by editing the framebuffer resolution in the script.fex file!

Share this post


Link to post
Share on other sites

Yeah!! I managed to fix my overscanning!  (Credits go to this guy here for pointing me to the right direction!).

 

At first I changed my resolution from the detected 720x576 to 680x536 (-40 px) in the script.bin. This results in an visible edge at the bottom of the screen and an visible edge on the right hand side (with a small black border!).

Now the picture needs to be moved down and to the right to be fully visible!

 

Next I needed to manipulate TV ENCODER RE-SYNC PARAMETERS REGISTER of our H2+ SoC. For this I used a little tool called devmem2 which helped me to directly read and write to the memory, and thus allowed me to manipulate the H2+ registers!

 

 

You can install devmem2 using following commands:

wget http://free-electrons.com/pub/mirror/devmem2.c
gcc ./devmem2.c
sudo mv ./a.out /usr/local/bin/devmem2

 

After Installing devmem2 I was able to shift the picture by manipulating the value on following Address: 0x01E00130! (=TV ENCODER RE-SYNC PARAMETERS REGISTER)

First I read back the actual value (so I could revert back changes in case I messed anything up!):

 

$ sudo devmem2 0x01E00130 
/dev/mem opened.
Memory mapped at address 0xb6f0d000.
Value at address 0x1E00130 (0xb6f0d130): 0x3005000A

Now I was able to move the picture by writing a custom value to the register:

0xAXHH?VVV

H... are used for Horizontal Offset

V... are used for Vertical Offset

X... does some weird random sh*t

A... is set by CPU

 

(I found this out on a trial and error basis, this information may be incorrect! A H2+ Datasheet would be nice, this would help us understanding this register and its flags..) EDIT: I found the Correct register description in the R40 Datasheet: 

 

 

So I used this command to set my display:

$ sudo devmem2 0x01E00130 w 0x00130025

Finally I saved the command above in my rc.local file.

 

This is a dirty workaround and should obivously fixed within the driver!

 

Pictures:

 

Spoiler

 

IMG_20170529_211717.jpg

IMG_20170529_211734.jpg

IMG_20170529_211806.jpg

 

 

Hope this helps to correct your overscanning issues! This should work with all Allwinner based Boards. I read that some Bananapi users had a pretty similar problem with overscanning on AV out.

Igor likes this

Share this post


Link to post
Share on other sites
1 hour ago, giri@nwrk.biz said:

I found this out on a trial and error basis, this information may be incorrect! A H2+ Datasheet would be nice, this would help us understanding this register and its flags..

 

TV unit is described only in A10 and R40 datasheet. Even in those two datasheets some register descriptions are missing, but they should be enough. You can find them through linux-sunxi.org

Share this post


Link to post
Share on other sites
11 hours ago, jernej said:

 

TV unit is described only in A10 and R40 datasheet. Even in those two datasheets some register descriptions are missing, but they should be enough. You can find them through linux-sunxi.org

 

But CPU  H2+ registers and flags are not described in these datasheets.

Share this post


Link to post
Share on other sites
2 minutes ago, giri@nwrk.biz said:

But CPU registers and flags are not described in these datasheets.

 

Which ones exactly? H2+ is actually H3, so you can take a look there. If you need ARM CPU registers, you can take a look at Cortex A7 user manual on ARM site.

Share this post


Link to post
Share on other sites
1 hour ago, jernej said:

 

Which ones exactly? H2+ is actually H3, so you can take a look there. If you need ARM CPU registers, you can take a look at Cortex A7 user manual on ARM site.

 

Sorry I have to correct myself, this is a peripheral register, I am sure this is not documented in the Cortex A7 manual because it is H3 specific. (SoC are built with arm cores + peripherals added by the SoC producer using a System Integration Tool [for example Intel Qsys]. These Componets are connected using a special Bus [Intel: Avalon Bus]).

 

I just checked the H3 Datasheet, but the only reference I found is in the memory mapping

TVE		0x01E0 0000---0x01E0 FFFF

 

The datasheet itself ony describes the TVE_Clock_Register which is located at offset 0x120.

 

 

 

EDIT:

Seems like I got my hands on the wrong R40 Datasheet. I found the register description! This picture describes the register flags in binary format from 31 downto 0:

 

 

Re-Sync.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
0

  • Support the project

    We need your help to stay focused on the project.

    Choose the amount and currency you would like to donate in below.