• Announcements

    • 1. Check power supply, check SD card and check other people experiences

      Power supply issues are one of the three biggest issues you'll face when starting with Single Board Computers (SBCs). SD card issues, whether fake or faulty, are another and issues resulting from poor board design is the other common issues you can encounter.   Power supply issues can be tricky. You might have a noisy power supply that works with one board because it has extra filtering, but won't work with another. Or you're using that cheap phone charger because your board has a microUSB connector, and it is either erratic, or doesn't start up, or even becomes the cause of some SD card issues.    Some tips to avoid the most common causes of problems reported:   Don't power via micro USB  - unless you have optimised your setup for low power requirements. Micro USB is great for mobile phones because they are simply charging a battery. It's bad for SBCs. Yes, it does work for a lot of people, but it also causes more problems and headaches over time than it is worth, unless you know exactly what you are doing. If you have a barrel jack power connector on your SBC, use it instead! If there is an option for powering via header connections, use that option!
        Don't use mobile phone chargers. They might be convenient and cheap, but this is because they are meant for charging phones, not powering your SBC which has particular power requirements.
        When you are evaluating a power supply, make sure you run some stress tests on your system to ensure that it will not cause issues down the path.   (Micro) SD card issues can be sneaky. They might appear right at the start causing strange boot and login errors, or they might cause problems over time. It is best to run a test on any new SD card you use, to ensure that it really is what it is, and to ensure that isn't faulty. Armbian provides you a simple way to do this   --   armbianmonitor -c /path/to/device/to/test  
    • 2. Make sure to collect and provide all necessary information

      We can only help if you provide quality information for us to work with. All stable images from the download section are tested, most stable upgrades are tested and we have tens of thousands of users. Even with regular and extensive testings, bugs sometimes do slip through. This is a voluntary support service and is unrelated to board makers, and is not obligated to provide you any answers. Repeated asking the same questions because you're not happy with the answers will result in you being ignored.

      Before you post a question, use the forum search as someone else might have already had the same problem and resolved it. And make sure you've read the Armbian documentation. If you still haven't found an answer, make sure you include the following in your post:   1. Logs when you can boot the board: armbianmonitor -u (paste URL to your forum post)   2. If your board does not boot, provide a log from serial console or at least make a picture, where it stops.   3. Describe the problem the best you can and provide all necessary info that we can reproduce the problem. We are not clairvoyant or mind readers. Please describe your setup as best as possible so we know what your operating environment is like.     We will not help in cases you are not using stable official Armbian builds, you have a problem with 3rd party hardware or reported problem would not be able to reproduced.

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

26 posts in this topic

Recommended Posts

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 the overscanning issue!  (Credits go to this guy here for pointing me to the right direction!).

 

All in all my Picture was Overscanning 20 px on every edge.

 

At first I changed my resolution from the detected 720x576 to 680x536 (2 * -20 px = -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!).

$ bin2fex /boot/script.bin ~/script.fex
$ nano ~/script.fex

find these lines:
fb0_width = 0
fb0_height = 0

and change them to:
fb0_width = 680
fb0_height = 536

then:
$ fex2bin ~/script.fex ~/script.bin
$ sudo cp ~/script.bin /boot
$ sudo reboot

 

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

 

Next I needed to manipulate TV ENCODER RE-SYNC PARAMETERS REGISTER of the 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!

 

devmem2 can be installed by 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, this may differ depending on your SoC, check the Datasheet!)

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 according to the R40 Datasheet: 

 

TV ENCODER RE-SYNC PARAMETERS REGISTER Datasheet entry:

Spoiler

Re-Sync.png

 

Here is how I calculated this value with the help of the Datasheet:

31 ... Re-Sync Field => 0b 

30 ... Re-Sync Disable => 0b

29:27 ... not used => 000b

26:16 ... Vertical => 40d px => 0000101000b

15:11 ... not used => 00000b

10:0 ... Horizontal => 40d px => 0000101000b

 

All in All: 000000000101000000000000101000b => 0x00140028

So I used this command to set my display:

$ sudo devmem2 0x01E00130 w 0x00140028

EDIT: I created a small tool which does the work above for you ;)

 

Finally I saved the command above in my rc.local file to shift the picture during boot.

$ sudo nano /etc/rc.local

paste following line:
devmem2 0x01E00130 w 0x00140028

This is a dirty workaround and should be 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 also work with many other Allwinner based Boards. I read that some Bananapi users had a pretty similar problem with overscanning on AV out.

kutysam, RagnerBG, StuxNet and 1 other like 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

giri@nwrk.biz likes this

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
On 30. Mai 2017 at 7:39 AM, 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 Document. I found the register description! This picture describes the register flags in binary format from 31 downto 0:

Spoiler

Re-Sync.png

 

 

 

The obove gathered info should make it possible to hack together an bash script to correct the overscanning issue.
I may get my hands dirty when I have enough spare time.

 

Quote

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

 

 Would not say so! Just unflexible coded driver.

Share this post


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

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

As I said, only descriptions of TVE unit can be found in A10 and R40 manual. H3/H2+ TVE unit is something in between by functionality, but most of the registers are the same.

Share this post


Link to post
Share on other sites
Just now, jernej said:

As I said, only descriptions of TVE unit can be found in A10 and R40 manual. H3/H2+ TVE unit is something in between by functionality, but most of the registers are the same.

Check my Edit ;)

Share this post


Link to post
Share on other sites
On 2017-5-29 at 2:17 PM, giri@nwrk.biz said:

At first I changed my resolution from the detected 720x576 to 680x536 (2 * -20 px = -40 px) in the script.bin.

 

 

How i do that?

 

Can you say where in the script.bin?

 

Share this post


Link to post
Share on other sites
8 hours ago, fredjedimaster said:

 

 

How i do that?

 

Can you say where in the script.bin?

The script.bin filr is located at /boot/

 

You have to convert this file into .fex to make it editable. 

 

$ bin2fex /boot/script.bin ~/script.fex

 

After setting the resolution (somewhere near 'disp') you have to convert it back to .bin.

$ fex2bin ~/script.fex ~/script.bin
$ sudo cp ~/script.bin /boot/

 

Be wise, make a backup before editing ;)

Share this post


Link to post
Share on other sites
On 29/05/2017 at 2:17 PM, giri@nwrk.biz said:

Finally I saved the command above in my rc.local file to shift the picture during boot.

 

Another question, how did you do this?

 

I did everything, but the position of the screen didnt save. I guess its missing do save the command. Can you say how save the command in the rc.local?

Share this post


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

Another question, how did you do this?

 

I did everything, but the position of the screen didnt save. I guess its missing do save the command. Can you say how save the command in the rc.local?

 

$ sudo nano /etc/rc.local

 

Paste your devmem2 or tvout command into this file. (without sudo)

Share this post


Link to post
Share on other sites

Hi. Thanks for the rapid answers.

 

I'm using retrorange pi zero...After doing the first step, the screen gets the right size, but the system does not boot. What could it be?

 

 

Share this post


Link to post
Share on other sites
13 hours ago, fredjedimaster said:

Hi. Thanks for the rapid answers.

 

I'm using retrorange pi zero...After doing the first step, the screen gets the right size, but the system does not boot. What could it be?

 

 

You need to provide more informations!

 

Steps you did, logfiles, screenshots, errormessages etc.

 

 

Share this post


Link to post
Share on other sites
On 2017-6-4 at 4:49 AM, giri@nwrk.biz said:

$ fex2bin ~/script.fex ~/script.bin $ sudo cp ~/script.bin /boot/

Hi. Thanks for the rapid answers.

 

I'm using retrorange pi zero...After doing the first step, the screen gets the right size, but the system does not boot. What could it be?

Share this post


Link to post
Share on other sites

I have the same issue. I follow the steps to a T but then after reboot (per instructions) I get no video. I am using RetrOrangepi 3.01 (OrangePiZero) as well. NTSC (on an old CRT TV).

 

Share this post


Link to post
Share on other sites
On 10. Juni 2017 at 9:44 PM, Charley said:

I have the same issue. I follow the steps to a T but then after reboot (per instructions) I get no video. I am using RetrOrangepi 3.01 (OrangePiZero) as well. NTSC (on an old CRT TV).

 

What resolution did you set?

Did you try it with armbian too?

 

I don't know how much retrorangepie differs from armbian.

 

You can also try to set the resolution using fbset, but that did not work for me (not really supported by the driver).

Share this post


Link to post
Share on other sites

I like to share my experiences with the orangepi zero with the expansion board.  First big thanks to giri@nwrk.biz for screen resolution fixes. 

 

I have an old 13" NTSC TV (640x440).  My Value at address 0x1E00130 (0xb6f85130): 0x30050368. 

To fit the xfce4 desktop on this TV, I had too set fb0_width = 620, fb0_height = 440, and tvout -m -x 100 -y 20 to center it.  This works on armbian Jessie, DietPi, and RetrOrangePi.

 

I had problems with tvout on DietPi and RetrOrangePi not producing the desired effect but devmem2 0x01E00130 w 0x300F03CC always worked.  (Once using tvout to center on armbian I use devmem2 0x01E00130 to get  0x300F03CC on DietPi and RetrOrangePi)

 

I had to set screen1_output_mode = 14 for NTSC in script.bin  I found, as did the OP, RaspberryPi video cable does not work.  But I had a Roku LT video cable that was fine,  The ground has to be on the sleeve not ring 2. I made no mods to the expansion board.

 

Unfortunately, I got orangepi zero v1.4 board that has a defect that causes it to run 50% hotter than the other versions of the orangepi zero.  Mine idles around 70C and goes to 80C when doing anything.  Armbian constantly throttles opi down to 240Mhz to get to 68C.  I ordered a heat sink if the opizero lasts that long.

Starting kernel ...
[sun8i_fixup]: From boot, get meminfo:
        Start:  0x40000000
        Size:   512MB
ion_carveout reserve: 160m@0 256m@0 130m@1 200m@1
ion_reserve_select: ion chipid  [0x2c00042!
ion_reserve_common: ion reserve: [0x57e00000, 0x60000000]!
Loading, please wait...
[    2.488304] thermal_sys: Critical temperature reached(110 C),shutting down
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... Scanning for Btrfs filesystems
[    3.022033] thermal_sys: Critical temperature reached(110 C),shutting down
[    3.145328] Power down.


 

giri@nwrk.biz likes this

Share this post


Link to post
Share on other sites

Nice to hear it worked for you :D!

 

17 hours ago, rickgtx said:

I had problems with tvout on DietPi and RetrOrangePi not producing the desired effect but devmem2 0x01E00130 w 0x300F03CC always worked.

tvout is moving the picture relative to its actual position. If you do not want this behavior you should call tvout -r first to reset your position.

 

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

2 2

  • 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.