Jump to content

[SOLVED] Orange Pi PC H3 Armbian Focal 5.10.4-sunxi av tv out cvbs enable


guybrushthreepwood
Go to solution Solved by yam1,

Recommended Posts

12 minutes ago, JMCC said:

Incorrect. You can have an excellent Kodi experience on Armbian, if it is compiled properly. We have it working for Rockchip and Odroid XU4 so far with the Legacy kernels. Sunxi Mainline is in the to-do list.

 

I apologize. Yes, jernej hasn't actually said what I've instead said but just that there is a lot of work (optimizations) to do. I've said it my way which is the wrong way because linked with my very very limited knowledge, not Armbian fault nor its developers. You're absolutely right and I can only apologize.

Link to comment
Share on other sites

The thing is that everything is in state of flux. Cedrus driver was first one which introduced new kernel API for video decoding, which is now also supported with rkvdec and hantro. You can imagine that a lot of stuff needed to be written. Only now interface is becoming stable and thus we can now start upstreaming changes. But that takes time...

 

It's certainly possible to have great Kodi experience on Armbian, if you know what to patch. But currently it takes a couple dozens of patches at least for kernel and ffmpeg to achieve that, so I wouldn't recommend to do it yourself, except if you really want to learn how things work. Good thing is that with every kernel iteration, amount of patches is lowered.

Link to comment
Share on other sites

45 minutes ago, jernej said:

Cedrus driver was first one which introduced new kernel API for video decoding, which is now also supported with rkvdec and hantro

...and a different api than Amlogic meson vdec, correct? And all the developers that were working on the meson driver are off the grid since early 2020, is that correct too?

 

I'm asking this just to evaluate the challenges I'll have to face before moving on to create a unified Kodi for Armbian mainline, which was my original idea once I brush up the last details for the legacy Kodi's.

 

BTW, you mentioned it is necessary to use Kodi patches too. I was aware of the FFmpeg and kernel patches, but thought that vanilla Matrix would work. What are these patches related to?

 

(Sorry for hijacking the thread, I can move these posts to a different one if it gets too messy)

 

Link to comment
Share on other sites

10 minutes ago, JMCC said:

...and a different api than Amlogic meson vdec, correct?

Yes, meson uses stateful whereas Cedrus and rkvdec use stateless (request api).

11 minutes ago, JMCC said:

And all the developers that were working on the meson driver are off the grid since early 2020, is that correct too?

Actually only one really worked on this driver but stopped working on most (all?) things due to real-life issues.

12 minutes ago, JMCC said:

BTW, you mentioned it is necessary to use Kodi patches too. I was aware of the FFmpeg and kernel patches, but thought that vanilla Matrix would work. What are these patches related to?

Vanilla Kodi will work for video decoding, but if you want HW deinterlacing, that will need Kodi patch and additional one for ffmpeg.

Link to comment
Share on other sites

15 hours ago, jernej said:

I wouldn't recommend to do it yourself, except if you really want to learn how things work.

 

I'd really like to, a lot! Unfortunately, I fear there aren't guides to be found online on this, just books which need to be studied from the beginning to the end and they're still not enough. What really matters is a lot of experience, the one you both have.

You both aren't hijacking anything. Seeing people who know what they're talking about sharing their thoughts to find solutions is a pleasure. Gaining just one thousandth of your knowledge would make me pride. What I think is that you and all the developers are doing a great work which deserves to be praised.

Link to comment
Share on other sites

Hello again. I've made some very little progress... I've tried to undestand at my best the advices given by yam1 here. What I've done is removing these lines from jernej's patch:

 

static const struct regmap_config sun8i_mixer_regmap_config = {
@@ -560,6 +585,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,
+	.mod_rate	= 432000000,
+	.scaler_mask	= 0x3,
+	.scanline_yuv	= 2048,
+	.ui_num		= 1,
+	.vi_num		= 1,
+};
+

 

which is downloadable here. What I believe to be the original patch yam1 is talking about should be this one but honestly speaking I haven't understood what to do with it so I've tried to build again with just the aforementioned modification. To my surprise, this time the build has gone fine and I've got an image (without desktop as adviced by jernej given that my purpose is using Kodi). I've had some issues transferring the image from my vagrant VM to the host but finally I've solved it thanks to the guide I've found here (something more learnt!). I haven't still had the chance to test that image so I can't say anything more than this but I'm quite doubtful it would work. At least, this way the patch has been taken up fine without causing an unsuccessful build like before, a small achievement!

Link to comment
Share on other sites

I need to admit I hadn't bet a penny on this but I can confirm that just making that modification to jernej's patch was enough to get a working tv out on my OPi PC, currently on Armbian_21.02.0-trunk_focal_current with kernel 5.10.13-sunxi. The video is washed out (while it was perfect before with the ancient Armbian 5.90 Xenial, I don't know why) and the resolution is wrong so there is still plenty of work to do and even much more to come to get Kodi working in a satisfactory way (probably I wouldn't ever be able to achieve that goal) but by now at least a little result gained!

 

EDIT: I attach a picture of the image. The quality is really bad while it was fine before as already said. Maybe it has something to do with the lines I've removed from the patch, I don't know. I've also tried to modify the resolution editing /boot/armbianEnv.txt setting disp_mode=576x480p60 but it seems the change isn't even taken into account.

 

IMG_20210207_170635 - Copia.jpg

Link to comment
Share on other sites

  • Solution

Attached is jernej's patch, slightly modified to work with 5.10.13, sorry for posting it here. The overscan issue can be fixed with this tool, https://projects.nwrk.biz/projects/allwinner-tvout/wiki, this was described in this forum but I don't have the link. The washed out (hardware) issue has also been described here and can be easily fixed with a resistor. There are also DRM properties for dealing with TV offsets and sizing issues but I have not figured out where to put them in the user level device tree, does anyone know? (I tried put them under the tve node but didn't work.) The properties are described here: https://www.kernel.org/doc/html/v4.12/gpu/drm-kms.html?highlight=drm tv#existing-kms-properties

zzzz-tv-cvbs.patch

 

Patch was tested to work with zero, and neo...

Link to comment
Share on other sites

@yam1

 

Thanks for the modified version of the patch along with all the other advices. I knew the resistor thing (JMCC had already told me that in this thread) but what made me think was the fact that, maybe I hadn't noticed it being under X11 instead of CLI, it seemed to me the issue wasn't present while I was under Armbian 5.90 Xenial. I repeat, probably I haven't just noticed it.

 

In the meantime, just to 'play' a bit, here is what I've done (everything made as root user):

 

apt-get update && apt-get install kodi xorg xterm

 

then, following this very well done guide, I've issued:

 

xinit kodi $* -- :1

 

and I've seen the Kodi interface again on my OPi PC! Just a quick and dirty approach, I know. There is much more work to do... Thanks to the all of you! :)

Link to comment
Share on other sites

1 hour ago, yam1 said:

There are also DRM properties for dealing with TV offsets and sizing issues but I have not figured out where to put them in the user level device tree

DRM properties are not meant to be used in device tree. First, driver must register them and use them(which sun4i_tv driver does not) and then user space app must set them via drm ioctl, but that usually goes through libdrm. Useful tool for DRM properties is modetest app, which is part of libdrm test tools.

 

@guybrushthreepwood you'll be limited to SW decoding approach that way...

Link to comment
Share on other sites

I can confirm that allwinner_tvout_manipulator works like a charm. I've downloaded the latest version, built it and solved the overlay issue. Thanks to yam1 for pointing it out! This should be the thread on the forum where it was mentioned with a detailed usage explanation too.

Unfortunately, I can also confirm that the resolution can't be changed by just editing disp_mode in /boot/armbianEnv.txt because, no matter what value I input there, I get no changes at all nor the .fex approach which was valid for the older kernels applies (but I knew that since the opening post of this thread). I need to go deeper on that.

 

@jernej

 

Yes, you're completely right and this was the reason why I've written I was just playing. Bearing in mind what you've already told me in the previous posts, this is the fartest thing from an enjoyable Kodi experience and unfortunately I know that. Still a lot to do...

'Just' a question... You've talked about the heavy need for patching, both on kernel side and on the sources for Kodi and ffmpeg and this has already been done for LibreELEC: does this mean that digging on the forum there I could scour some hints? I'm not asking for the links to the threads, just if it is actually the right place to search. If, instead, the answers are inside the sources for LibreELEC, then it is definitively beyond my knowledge unfortunately.

Link to comment
Share on other sites

1 hour ago, guybrushthreepwood said:

does this mean that digging on the forum there I could scour some hints?

Probably, but even more by looking at the Libreelec sources on GitHub. Documentation is minimal, but the sources are very intuitive.

 

But, before that, you must read the docs about kodi compilation at the xbmc GitHub.

Link to comment
Share on other sites

3 hours ago, guybrushthreepwood said:

does this mean that digging on the forum there I could scour some hints?

Not sure what kind of hints you want, but yes, I think I mentioned already which patches needs to be taken and which ffmpeg config options needs to be used. but as JMCC said, it's best if you check LE sources on GH directly. Patches are regularly updated.

Link to comment
Share on other sites

@JMCC@jernej

 

Thanks to the both of you! :)

 

14 hours ago, JMCC said:

But, before that, you must read the docs about kodi compilation at the xbmc GitHub.

 

Already done! ;) I'm a bit familiar with that stuff, the problem is what comes before having something to compile... Have a nice day.

 

  

12 hours ago, jernej said:

Not sure what kind of hints you want

 

Mainly on what does need to be patched but, as you both confirm to me, the answers are inside the sources. A nice day to you too.

 

Link to comment
Share on other sites

I created Kodi packages for v4l2-request, tested on Orange Pi+2e (Allwinner H3) running Armbian Bullseye with the current 5.10.y kernel.

 

So far, HW video playing works fine with MPEG2 and h.264 up to 1080p. Kernel patches are needed to improve resolution and codec support. GUI performance is just enough, but it can probably be also improved with kernel patches.

 

So the userspace part is now working, the kernel improvements remain in the TO-DO list.

 

Packages can be found here: https://users.armbian.com/jmcc/packages/kodi-mainline/

 

These should still be considered WIP, although fully functional already. Instructions:

  1. Download the packages for your architecture, and install them with "dpkg -i".
    • Only kodi-mainline and kodi-mainline-bin are essential, the others are optional.
  2. Run "apt -f install"
  3. Make sure there is no X server running, and start kodi from console typing "kodi"

@balbes150 you may be interested in this. They should also work in Rockchip, but I haven't tested yet.

Link to comment
Share on other sites

@JMCC

 

Thanks for your great effort! It has taken me a while to come back because my image was Ubuntu based and, at least by what I know, installing Debian packages on Ubuntu isn't a good practice. I've therefore built a new image based on Ubuntu Buster (I don't know why Bullseye isn't an option: maybe it's still the testing branch and there is another way I'm not aware of to build it), still with tv-out enabled, just applying the same changes discussed before. I've then added the repositories for Debian Bullseye and this way I've been able to install all the needed dependencies for the two 'base' packages kodi-mainline and kodi-mainline-bin.

Here come the issues, probably if not certainly due to my dirty approach of creating an 'hybrid' Buster/Bullseye system. As a remote I use my smartphone with Yatse: I can configure and connect it to my OPi PC just fine but then it works erratically: sometimes I can control it, sometimes not in spite of the fact the connection is always reported as being fine. With Kore, no issues at all.

Another issue is tvheadend server. If I try to just install the kodi-pvr-hts package by apt-get it replaces JMCC's Kodi with the Matrix version from the repositories so I've tried to build it by myself but I've failed because of issues related to ffmpeg as anticipated both by JMCC and jernej. I could easily add support for my xBox One Tuner but without tvheadend it's just pointless.

The worst problem so far is that, in spite of the fact that Kodi reports a successful connection to the Internet, I can't manage to install anything from the repositories, not the Official one nor the Kodi Nerds one I've tried to add. No connection to either of them. We're completely going off topic here though, I know and I apologize.

Link to comment
Share on other sites

  • JMCC changed the title to [SOLVED] Orange Pi PC H3 Armbian Focal 5.10.4-sunxi av tv out cvbs enable
37 minutes ago, gleam2003 said:

I can't make it working with orangepi zero and kernel 5.10.92, can anyone help me

"I can't make it work" does not give any information. If you want somebody to help you, then you need to take the work to describe in detail your problem, what you have tried already, etc. And also, provide the basic information as specified in forum rules.

Link to comment
Share on other sites

I use the patch and compile the image with the armbian.

Compilation is ok.

There isn't tve overlay to use, i don't know if it's necessary.

I power on the board with the image builded and Image work and I  can connect via SSH but no image output.

I also test to add tve overlay to image, add tve to dts overlay Make file. I now have the dtbo tve file but adding it to overlay don't give me the solution, no image output.

If I use old kernel (with fex) image output via CVBS works.

 

UPDATE: add the patch for enable tve overlays kernel-sunxi-current.patch

Link to comment
Share on other sites

On 2/7/2021 at 7:47 PM, guybrushthreepwood said:

I can confirm that allwinner_tvout_manipulator works like a charm. I've downloaded the latest version, built it and solved the overlay issue. Thanks to yam1 for pointing it out! This should be the thread on the forum where it was mentioned with a detailed usage explanation too.

Unfortunately, I can also confirm that the resolution can't be changed by just editing disp_mode in /boot/armbianEnv.txt because, no matter what value I input there, I get no changes at all nor the .fex approach which was valid for the older kernels applies (but I knew that since the opening post of this thread). I need to go deeper on that.

 

@jernej

 

Yes, you're completely right and this was the reason why I've written I was just playing. Bearing in mind what you've already told me in the previous posts, this is the fartest thing from an enjoyable Kodi experience and unfortunately I know that. Still a lot to do...

'Just' a question... You've talked about the heavy need for patching, both on kernel side and on the sources for Kodi and ffmpeg and this has already been done for LibreELEC: does this mean that digging on the forum there I could scour some hints? I'm not asking for the links to the threads, just if it is actually the right place to search. If, instead, the answers are inside the sources for LibreELEC, then it is definitively beyond my knowledge unfortunately.

 

The tool envolved from here:

 

forum.armbian.com/topic/3837-psa-orange-pi-zero-expansion-board-tv-out-not-working-solution/

Link to comment
Share on other sites

I am trying to apply this zzzz-tv-cvbs.patch in the armbian build system...

 

Should I copy it to the userpatches directory? to userpatches/sunxi-current? to userpatches/sunxi-current/5.15?

It seems like ./compile.sh has ignored the patch file in the 3 places I have put it in.

 

Guybrush: have you tried "DISPLAY=:0 xrandr --output Composite-1 --mode NTSC"?

Link to comment
Share on other sites

I just updated the zzzz.tv-cvbs.patch to be applied correctly in Armbian 23.02.0, Linux 5.15.93.

 

Only the last hunk needed to be corrected :)

 

You need to copy this patch file in ~/build/userpatches/kernel/archive/sunxi-5.15 so that the Armbian build script uses the patch

 

zzzz-tv-cvbs-5.15.93-sunxi.patch

 

I added the additional patch that gleam2003 posted on january 2022...

 

Then, armbian-config, system, hardware finally shows "tve"

 

Activate it and reboot. Composite out works :)

 

Now onto fixing the resolution

Edited by robertoj
Link to comment
Share on other sites

On 3/4/2023 at 6:38 AM, robertoj said:

Then, armbian-config, system, hardware finally shows "tve"

I added a patch in kernel 5.15.93, put together an image, but it armbian-config, system-> hardware no shows "tve".

 

Since the 6.1.30 kernel, TV is working, but wi-fi is not working

 

Edited by Energokom
Link to comment
Share on other sites

Hi @Robertoj,

 

could you please share some details? I am considering to get one orange pi zero 3, and need composite video output. Which debian image did you use? And the analog TV works straight, or do you still need to patch? Or it works after activation from config?  

Link to comment
Share on other sites

13 hours ago, Bedo said:

orange pi zero 3

Zero 3 is a completely different board. Besides the "Zero" in the name they have literally nothing in common.  Therefore this question cannot be answered in this topic since it would be off-topic.

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