Jump to content

Orange Pi Zero LTS TV-OUT in 2022?


John998

Recommended Posts

Hello. I have a problem with Orange Pi Zero LTS.

I also have an expansion board and the required 3.5-jack cable.

I have read many different forums and sites where people have described problems with video signal output.

 

Often there are solutions such as:
1. Editing the file /boot/script.bin
But this file does not exist.
2. They also talk about the launch of "tv".

You need to add an entry to /etc/modules. But that doesn't work either, since ./tvout doesn't exist.

 

As I understand it, in new versions there is no TV support, but there is no way to download old versions either.

The latest version that can be downloaded is 5.59, but it also does not support TV.


Some people since ~2019-2020 are wondering when this ability will be returned.
I have the following questions:
1. Where can I download a version like 5.25 or older?

2. Or is there another way for Armbian to turn on the video signal?

3. Why did the developers remove this function?
4. And why haven't they brought this function back yet?


P.S. Sorry for my english :D

Link to comment
Share on other sites

Hi

 

3 minutes ago, John998 said:

1. Where can I download a version like 5.25 or older?

If you cannot find it in archives then it does not exist anymore or someone else keeps very old stuff.

 

4 minutes ago, John998 said:

2. Or is there another way for Armbian to turn on the video signal?

No idea, sorry

 

4 minutes ago, John998 said:

3. Why did the developers remove this function?

It was never removed by Armbian. It worked on outdated vendor sources (make sure to readhttps://docs.armbian.com/User-Guide_FAQ/#why-does-hardware-feature-xy-work-in-old-kernel-but-not-in-more-recent-one) and stuff has probably never been mainlined.

5 minutes ago, John998 said:

4. And why haven't they brought this function back yet?

Also read https://docs.armbian.com/User-Guide_FAQ/#why-does-hardware-feature-xy-work-in-old-kernel-but-not-in-more-recent-one

Link to comment
Share on other sites

There is an ongoing work-in-progress to add mainline Linux kernel support for composite video (aka TV Out) for the Allwinner H3/H5 SoC, and by extension also the H2+. If/When this work is complete, that would serve as a reasonable starting point for making the feature available in armbian as well. But it's not finished yet.

 

https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/Allwinner/patches/linux/0036-wip-h3-h5-cvbs.patch

Link to comment
Share on other sites

I finally got around to following up on this: The patches maintained in LibreELEC do function to enable composite video on the Orange Pi Zero using a mainline Linux 5.10 kernel.

 

It took a bit of work to actually try it out, because LiberELEC doesn't officially support devices with less than 1GB of RAM so I needed to create some of my own patches to tell the build system about the existence of the board, and then to create a suitable device tree overlay to activate the features embodied on the I/O expansion board. But the result seems perfectly functional. Even with just 512 MB of RAM, Kodi is able to playback locally hosted h.264 videos (at least, 480i and 720p, haven't tried anything else) without hiccuping. Of course the composite video standard requires that everything will be down sampled to 480i for display no matter what the source material was.

 

Having said that, I'm not really sure that the composite video signal is suitable for a modern desktop environment. The analog signal is quite noisy when it comes to fine detail such as small text; and 480 lines of vertical resolution really doesn't provide much space for most modern windowing systems to present much beyond a very basic user interface.

 

So, using it in a general purpose operating system like Armbian might lead to disappointing results.

Link to comment
Share on other sites

I had to read your comment again... I understand that you made the current LibreElec to work on the OrangePi Zero. :)

 

But I need armbian to accept that patch in the Armbian build directory.

 

I just created a Jammy VM, and installed the armbian build directory and browsed through the linux kernel source. The effected files seem like they are going to accept the hunks with no problem.

 

Now I am going to learn how to apply the patch in the current armbian

Edited by robertoj
Link to comment
Share on other sites

So I was able to apply the cvbs tve patch in armbian, Linux 5.15.93. The tv signal is being generated by the orange pi zero.

 

however, when I start lxde, all the pixels below the mouse cursor become “washed down”… best if I show you

 

also I have another orangepi zero running LibreElec, with Linux 5.10 (orange pi 2 image works well with the opi-zero)… what settings should I look in LibreElec or Kodi, to make improve my situation in Armbian?

91348ECF-89D7-4603-BA7B-4AF0455152B9.jpeg

Link to comment
Share on other sites

Instead of fixing based on the patch I updated, I decided I need to make this patch:

https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/Allwinner/patches/linux/0036-wip-h3-h5-cvbs.patch

Be applicable in the armbian userpatches folder

 

I created the folder build/userpatches/kernel/archive/sunxi-6.1 and put the patch there (I knew the path because I looked at the destination of build/patch/kernel/sunxi-current symbolic link :) )

 

Now compile.sh is "Preparing bare kernel git tree" taking a long time... I will let it do its thing :)

 

update: I am getting  improved_git try 1 failed... several times... is it something transitory with the github server?

update: now using a token as required by github... but it cant find repo https://github.com/morrownr/8821cu-20210118/

I can see https://github.com/morrownr/8821cu-20210916

Exists... how can I try it?

update: i ran "git pull" and the script had a fix for this problem :)

 

update: I see that the libreelec tv patch was applied with no complaints... but is there a "output/debug/patching.log" in the new compile.sh? (23.05-trunk)

 

update: compilation error... so I will need to correct this patch for use in linux 6.1

 

drivers/gpu/drm/sun4i/sun8i_mixer.c:754:37: error: redefinition of 'sun8i_h3_mixer1_cfg'
[🔨]     754 | static const struct sun8i_mixer_cfg sun8i_h3_mixer1_cfg = {
[🔨]         |                                     ^~~~~~~~~~~~~~~~~~~
[🔨]   drivers/gpu/drm/sun4i/sun8i_mixer.c:746:37: note: previous definition of 'sun8i_h3_mixer1_cfg' with type 'const struct sun8i_mixer_cfg'
[🔨]     746 | static const struct sun8i_mixer_cfg sun8i_h3_mixer1_cfg = {
[🔨]         |                                     ^~~~~~~~~~~~~~~~~~~

Edited by robertoj
Link to comment
Share on other sites

update: there was an un-needed hunk in this patch, for Linux 6.1... one declaration was being done again, but mainline already had it

 

It compiled 100% and created the armbian filesystem img... :) so I tried it... but the h3-tve.dtbo (device tree blob overlay) was not created.

 

I remembered that I added another patch that was only to build the "dtbo" (see in my response in the other thread about CVBS)

 

The patch applied correctly, BUT it failed during compilation:

 

make[3]: *** No rule to make target 'arch/arm/boot/dts/overlay/sun8i-h3-tve.dtbo', needed by 'arch/arm/boot/dts/overlay/'.  Stop.

 

I investigated why the zzzz-tv-cvbs.patch worked and this libreelec patch did not...

 

There are some hunks in the zzzz patch that do not exist in the librelec patch, for example this new file:

 

diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-tve.dts b/arch/arm/boot/dts/overlay/sun8i-h3-tve.dts
new file mode 100644
index 000000000..07ba7ba71
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-tve.dts

...

 

While I do this work... maybe someone will comment, if they have experience... maybe LibreElec has another patch that adds this file?

Link to comment
Share on other sites

Ok there's more progress: I took the zzz-tv-cvbs.patch and copied 3 hunks: the new file sun8i-h3-tve.dts, the orangepizero dts patch, and the orangepi-pc.dts patch, into a new additional patch.

 

Then the compilation finished 100%.

 

I was able to connect with ssh, run armbian-config, system, hardware. And I saw the tve dtb overlay option :)

 

I selected it, rebooted, and after a while I saw the login prompt in my composite TV :) (with overscan and ghosting problem)

 

I tried "apt install lxde". Reboot. But I only had the text console

 

"startlxde"

 

Gtk-WARNING **: {time}: cannot open display:

 

Maybe I am very close... but maybe I am very far.

 

update: "apt install task-lxde-desktop", reboot... and I was welcomed by the lxde login screen

 

BUT it was the same "smeared down from the mouse cursor" experience as I had before trying the LibreElec patch.

 

Perhaps the zzzz-tv-cvbs.patch's DTS is different from the libreelec dts... since it was the only part that wasn't sourced from the libreelec patch.

Edited by robertoj
Link to comment
Share on other sites

The only other thing I haven't tried is to match all the linux compilation options found in the LibreElec Allwinner folder...

 

for example, compile the lima.ko and gpu_sched.ko, which are present in LibreElec (seen in lsmod)

 

As a reminder for myself: lima is under menuconfig/device drivers/graphics support/

 

And gpu_sched doesn't show up anywhere... but I found here that it probably gets compiled automatically with lima

https://www.librehat.com/building-linux-kernel-on-odroid-u3/

 

 

Edited by robertoj
Link to comment
Share on other sites

no difference with the lima and gpu_schedule kernel modules.

 

Still scraped-down pixels

 

… but…

 

I installed kodi… and it works (and crashes after 5 minutes)


remember to “modprobe Lima” first

 

It doesn't really crash... it just gets hung-up for a while. Fortunately, I can also start it from the ssh session, and it starts on the composite output.

 

However, when I control-C and kill it, I get back to working on SSH, but the composite doesn't get the bash prompt... anyone knows how to return the bash to the composite console?

 

update: I tihnk I need to fix the libreelec patch to actually apply this hunk, because it has 2 very important settings that are not being applied:

 

@@ -600,6 +625,15 @@ static const struct sun8i_mixer_cfg sun8i_h3_mixer0_cfg = {
        .vi_num         = 1,
 };
 
+static const struct sun8i_mixer_cfg sun8i_h3_mixer1_cfg = {
+       .ccsc           = 1, <--- mainline linux shows "CCSC_MIXER1_LAYOUT", which equates to the same thing: "1"
+       .mod_rate       = 432000000,
+       .scaler_mask    = 0x3,   <--- this is 0xf in mainline linux 6.1 after armbian.patch*, but the libreelec patch indicates 0x3, and add scanline_yuv element... I need to follow libreelec's decision
+       .scanline_yuv   = 2048,
+       .ui_num         = 1,
+       .vi_num         = 1,
+};
+

 

*patch/kernel/sunxi-current/patches.armbian/drv-gpu-drm-sun4i-sun8i_mixer.c-add-h3-mixer1.patch

2283A498-FC25-4811-AB49-C426DF908ECD.jpeg

59876160-6E37-4A34-AA26-17C17556C008.jpeg

Edited by robertoj
Link to comment
Share on other sites

I found that the armbian patch

 

patch/kernel/sunxi-current/patches.armbian/drv-gpu-drm-sun4i-sun8i_mixer.c-add-h3-mixer1.patch

 

Pre-modifies the mainline's sun8i_mixer.c, making the libreelec's patch hunk be redundant... so I need to use the userpatch instructions to try making it like LibreElec's patch.

 

(I used the power of grep -nr "sun8i_h3_mixer1_cfg*" . 😆)

 

Please help....

If i put a copy of patch/kernel/sunxi-current/drv-gpu-drm-sun4i-sun8i_mixer.c-add-h3-mixer1.patch

in userpatches/kernel/archive/sunxi-6.1/

and make a single edit, would it skip the application of the original armbian patch?

 

Or do I need to move it to another folder?

 

(I see now that both patches are applied) 😆

 

update: I edited the LibreElec patch again, to only fix 3 parameters in the mixer config struct

result: same instability in Kodi… I have not tested lxde yet.

 

i need more ideas to fix the video output in lxde

Edited by robertoj
Link to comment
Share on other sites

https://forum.armbian.com/topic/22226-orange-pi-zero-lts-tv-out-in-2022/

There’s been work in the armbian community to re-enable composite, aka: CVBS or yellow analog video cable.

If you have an orange pi zero, and want this feature, you should join in suggesting changes and testing alternatives. There are steps to recreate the work in progress… and if anyone needs help learning the armbian building process, I will be happy to help.

Link to comment
Share on other sites

Hi, i'm new on this forum. So i recently bought an Orange Pi 3 LTS. I'm able to get CVBS tv out via the android image which came preinstalled on the pi, but I can't get tv out using Armbian. I understand that this functionality may have been deprecated in the newer kernels. my question is:

1: Am I able to apply the CVBS patches mentioned above for the Orange Pi Zero to to my Orange Pi 3 LTS? Is this possible at all given the differences in hardware? I am comfortable with linux and can follow build instructions and guides like the one robertoj made.
 

Link to comment
Share on other sites

3 hours ago, analogue_enthusiast said:

1: Am I able to apply the CVBS patches mentioned above for the Orange Pi Zero to to my Orange Pi 3 LTS?

Without taking a deeper look my best guess is no. armhf vs arm64 architecture, H2+ vs H6 SoC...

Link to comment
Share on other sites

thank you all for your replies:

 

there is a version of Ubuntu (with 4.9.118 kernel) for the Orange Pi 3 LTS from the OrangePi website listed here: http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-pi-3-LTS.html

 

I'm going to try my luck with this image and report back if it works.

 

How do I enable TV out from within linux, what file or config do I have to edit to enable this functionality? Sorry if this is a broad question.

Link to comment
Share on other sites

hey guys! nice to meet y'all

the reason that brought me here is Zero 2W and tv-out issue ;)

 

any recommendations how can I adapt these patches to h618? or maybe someone is already working on that?  or maybe there are other options how to turn on tv-out for Zero 2W?

 

I've tried different distros with 6.1 & 6.6 kernels and no luck with tv ;(

 

many thanks in advance!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines