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


Go to solution Solved by yam1,

Recommended Posts

Hello to everyone! : ) I've made a lot of digging around but I haven't found a final reply to my questions because all the informations I've found are quite old and probably outdated. I own an OPi PC which I was using with Libreelec but unfortunately the HDMI output broke because of the missing protections. By what I know, there isn't any mean of getting AV out working on Libreelec so I switched to Armbian for which it seems to be possible instead. I've installed it with no issues at all (version as per title) but all the guides I've found on this forum to enable AV out seem not to apply, probably because they're intended for much older Armbian versions nor I couldn't find other threads and/or guides online on the subject.

I've also read the AV out at some point have been disabled because it drawed electricity with no use for it in the most of the cases but also another thread where it seems that for H3 it is enabled and working out of the box so, overall, a lot of contrasting answers.

I don't know what to think and I'm COMPLETELY clueless. It could well be that it doesn't work not because it is missing all the necessary background but maybe 'just' the X11 environment given that I've just written the image to an sdcard, completed the first run wizard, enabled wifi and then installed the kodi package (which, indeed, I can't start because it complains about the inability to create a GUI).

I know I'm making a dumb effort actually shooting in the dark but, in spite of my many attempts, I couldn't find conclusive answers nor any documentation in the forum or anywhere else. I hope to get at least an hint from someone and I thank you all in advance.

Link to post
Share on other sites

Armbian is a community driven open source project. Do you like to contribute your code?

@JMCC

 

Thanks for your suggestion. I would write the image to another sdcard ASAP and would get back with the results. So, do you confirm to me that AV out doesn't work on the newest versions? That's a pity... Maybe it's necessary to compile a kernel with the support for it but I don't know from where to begin should this be the case! :(

Just another confirmation. I've found some discordant AV out cable pinouts, the most common to be found being this one:

 

https://descubriendolaorangepi.wordpress.com/2017/01/10/salidas-de-audio-y-video-hdmi-y-rca/

 

Is it actually the right one? I'd like to rule out issues with the cable otherwise it could well be that everything could be up and running while misleaded by just a wrong cable. Thanks again and have a nice day! :)

Edited by guybrushthreepwood
Link to post
Share on other sites

2 hours ago, guybrushthreepwood said:

AV out doesn't work on the newest versions? That's a pity... Maybe it's necessary to compile a kernel with the support

This thread seems to give a working solution for recent kernels (pay attention to the post from jernej dating of today, 2021/01/18):

 

You can try the old image, which should work easily with a small modification in the boot files. Use this method: https://docs.armbian.com/Hardware_Allwinner/#fex-outdatedunsupported-informational-only

If it works, then you can try to make an image with a patched current kernel.

 

2 hours ago, guybrushthreepwood said:

I've found some discordant AV out cable pinouts

No idea, I've never used AV out on my OPi+2e. However, I remember some reports that in certain OPi models the image is too bright/washed out, because of a missing filter in the schematics. That can be solved by adding a 50 ohm resistor in your cable. Not sure if it applies also to your board. Reference: http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=3404

Link to post
Share on other sites

I apologize for not coming back before but downgrading back to 5.90 has caused me issues with the WiFi connection (discussed in another thread I've recently started) and I couldn't go on with the 'quest' about tv out. I've made all the modifications suggested here to script.bin with the aid of bin2fex and fex2bin:

 

[disp_init]
disp_init_enable = 1
disp_mode = 1
screen0_output_type = 3
screen0_output_mode = 5
screen1_output_type = 2
screen1_output_mode = 14
fb0_format = 0
fb0_width = 0
fb0_height = 0
fb1_format = 0
fb1_width = 0
fb1_height = 0

[hdmi_para]
hdmi_used = 0
hdmi_power = "vcc-hdmi-18"

[tv_para]
tv_used = 1
tv_dac_used = 1
tv_dac_src0 = 0

 

I've then rebooted but nothing. I've also added (as still suggested in that thread) a line with

 

tv

 

at the end of /etc/modules but still no signal on tv out. Now, maybe I'm missing something or the pinout I'm using (this one) isn't the right one. I don't know. Please note that I haven't installed any additional package: I just expect to get the CLI on my television and it could well be I'm being misleaded by this assumption. Have a nice day! :)

Link to post
Share on other sites

1 hour ago, guybrushthreepwood said:

downgrading back to 5.90

I would try two things:

  1. Manually insert the module with "modprobe tv", just ot see it it there.
  2. In the thread you link, the user mentions that his TV out works with jernej's OpenELEC, by doing these modifications to the fex file. You can try that, just to make sure your cable works.
  3. For last, you can try directly with our current Mainline kernel, using the suggestions in the thread linked above
Link to post
Share on other sites

I've tried the

 

modprobe tv

 

command and it ran fine so I've started to think about a wrong pinout and I can definitively confirm that the one given here is wrong while the right one is given here.

Using that pinout everything went fine (at least for video output, I haven't still had the chance to check audio but I would come back with a confirmation about it too) so I can also confirm that all the changes outlined in my previous post (got from that other thread I've mentioned, not my own findings) are just enough to get tv-out working on an OPi PC on Armbian 5.90 Ubuntu Xenial 3.4.113-sun8i. The only 'issue' is that, as already reported by others, the image goes beyond the screen area, probably because the right resolution is 720x480 (I recall having read something like that but I don't remember where). I need to study the necessary modifications and apply them too. It may also be that I just need to set

 

screen1_output_mode = 11

 

as said here. If I recall well from my extensive research, 14 is NTSC while PAL is 11 so the problem could just reside there.

I'd also like to apply jernej's patch to be able to get back to Armbian Focal 5.10.4-sunxi still with a working tv-out but I really don't know from where to start. I need to read back (and maybe elsewhere too) and see what to do. Still a lot of work to do for me but in the meantime I wanted to get back to avoid someone else using that wrong pinout and scrambling his mind without reason.

A slight off topic to say that I couldn't succeed in finding any downloadable OpenElec image indeed all the links given here are dead including this one on MEGA wich contains only empty folders but it doesn't matter now. A nice day to all of you! :)

Link to post
Share on other sites

Small update: changing screen1_output_mode to 11 (indeed PAL as I recalled) didn't solve the problem with the screen margins. I've also tried to apply the other workaround suggested by many (here for example but even in the thread linked above by jernej) adding the kernel parameter:

 

video=Composite-1:720x480

 

at the end of /etc/sysctl.conf (the only way I'm aware to do it but I may be wrong), still to no avail. No changes at all, even minimal, the reason probably being the fact that it seems my modification isn't just taken into account given that checking the resolution I still get 720x576.

Better to leave this alone for the moment and check how to apply jernej's patch and get a latest image with tv-out (in spite of the fact I don't think it would be that easy, probably involving setting up a whole toolchain).

Link to post
Share on other sites

16 hours ago, guybrushthreepwood said:

I don't think it would be that easy, probably involving setting up a whole toolchain

What? Why don't you use the Armbian Build Script? That is what all this project is about! :)

 

Applying a patch is as easy as putting it on the corresponding folder under "userpatches", or either use the command line option "CREATE_PATCHES=yes" in case you want to apply it manually.

Link to post
Share on other sites

@JMCC

 

Thanks as always! Your help is precious... :) Following the very well laid down guides, I could easily set everything up. I've immediately tried to build an image but it failed when downloading two packages, them being https://redirect.armbian.com/_toolchain/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz and https://redirect.armbian.com/_toolchain/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz.

Probably it was just a problem linked with my connection but those two errors were regularly repeating. I've manually downloaded the both of them by wget (from exactly the same addresses which were constantly failing inside the script) inside the folder cache/toolchains and this was just enough to get round the problem. It has taken a while (more than four hours on a 3rd gen i7, not exactly an up to date configuration!) but I've then been able to successfully build an image (not tried to flash it though).

Now the only problem that remains is that I really don't know how to apply jernej's modifications. I'm not a programmer so it's my fault but I don't really know where to start from. Usually, I search and learn but I don't even know what to search for... :( I've made a couple of educate guesses and I've found something about "cherry picking" a commit but I couldn't go on: it goes beyond my knowledge. Thanks again and have a nice day! :)

Link to post
Share on other sites

13 hours ago, jernej said:

first generate patch from that commit like this and then put it in appropriate folder according to documentation.

 

Hi and first of all thanks for your help. :) I've downloaded the .patch file by wget inside userpatches/kernel/sunxi-current. It should be the right place but it is only my guess because I haven't understood what the documentation says about that. It seems that the patching process should be something separate than what's being done by the compile.sh script or by the way I couldn't get the output shown in the documentation in any way nor I've found other scripts, maybe one purposedly intended for patching. I've also tried to check the compile.sh script in search for an hint but I haven't found anything relevant there. Before starting another four hours build process, I'd like to be certain about what I'm doing.

Thanks for giving me the direct link to the patch but, if I can ask, how can I generate that .patch file by myself? I've made a lot of research and it seems that what's needed is git format-patch using the commit-sha which in our case should be ad153ef6ee5be33531187f97d5fa0c07455dc795 but I'm still missing a lot and I'm not going anywhere. Still my fault. When it is only a matter of downloading some sources and compile them then I'm quite fine but this is too much for me, at least by now.

 

EDIT: I've tried to build again with the modifications said above. In the end, I've thought that with just a few modifications, the compilation should have taken a lot less so I've tried but I've got this error:

 

[ error ] ERROR in function compile_kernel [ compilation.sh:413 ]
[ error ] Kernel was not built [ @host ]
[ o.k. ] Process terminated

 

I've checked the script compilation.sh (found in lib/) and at line 413 there is just the error printing but the conditional check that arises it is just at the line before:

 

if [[ ${PIPESTATUS[0]} -ne 0 || ! -f arch/$ARCHITECTURE/boot/$KERNEL_IMAGE_TYPE ]]; then
                exit_with_error "Kernel was not built" "@host"

 

I'm surely on the wrong path and I haven't applied that patch as I should have done.

Link to post
Share on other sites

17 minutes ago, guybrushthreepwood said:

the patching process

The build script, after git checking out the kernel sources, will apply the patches. All of the applied patches will appear in order, with a green indicator when they are applied OK and yellow or red when there is some problem. Though, since the text moves so fast, you probably didn't notice it.

 

The easiest way to check how the patches are applied is to add the option CREATE_PATCHES=yes to compile.sh. It will make the script pause twice, first after applying the u-boot patches and then after the kernel patches. You can see if your patch was applied correctly, and troubleshoot if not.

 

23 minutes ago, guybrushthreepwood said:

how can I generate that .patch file by myself?

Simply open the commit in GitHub, and then at the address bar add ".patch" at the end.

Link to post
Share on other sites

10 hours ago, JMCC said:

Simply open the commit in GitHub, and then at the address bar add ".patch" at the end.

 

Great! You're teaching me a lot. So plain simple while I was trying to shoot an ant with a shotgun! ;)

 

10 hours ago, JMCC said:

The easiest way to check how the patches are applied is to add the option CREATE_PATCHES=yes to compile.sh. It will make the script pause twice, first after applying the u-boot patches and then after the kernel patches. You can see if your patch was applied correctly, and troubleshoot if not.

 

As above, thanks!

 

10 hours ago, Werner said:

A little more detailed explanation about CREATE_PATCHES: https://zuckerbude.org/armbian-using-create-patches/

 

Thanks!

 

You all are helping me a lot. I would try to understand better what's going on with the error described in my previous post and how to handle everything better. I really appreciate the efforts of you all! :)

 

EDIT: adding CREATE_PATCHES=yes has given better control indeed. Previously I've put the patch inside userpatches/kernel/sunxi-current getting the error described above. Now, according to what seems to be suggested by the compile.sh script, I've moved it inside cache/sources/linux-mainline/orange-pi-5.10 getting exactly the same error. What is even stranger if possible is the fact that after hitting enter to resume the script execution it says (both cases) that there isn't anything to patch like if the patch is ignored but this shouldn't be the case given that as soon as I've deleted it the build ended successfully. I don't know.

Link to post
Share on other sites

Hello again. Reading the guide suggested by Werner, I've understood that my assumptions were somewhat (let's say totally) wrong. The CREATE_PATCHES=yes switch has something to do only when I've actually modified the code and eventually it generates all the necessary .patch files inside output/patch. The fact it says there isn't anything to patch doesn't mean it is ignoring jernej's patch but it hasn't anything to do because there isn't any modification to the code.

If I continue reading that guide, it says that the right place to put the patch I'm trying to apply is actually userpatches/kernel/sunxi-current/ as I've already done. I don't know why it fails with the error described above then, it seems I'm not doing anything wrong...

Link to post
Share on other sites

Hello again. Reading the guide suggested by Werner, I've understood that my assumptions were somewhat (let's say totally) wrong. The CREATE_PATCHES=yes switch has something to do only when I've actually modified the code and eventually it generates all the necessary .patch files inside output/patch. The fact it says there isn't anything to patch doesn't mean it is ignoring jernej's patch but it hasn't anything to do because there isn't any modification to the code.
If I continue reading that guide, it says that the right place to put the patch I'm trying to apply is actually userpatches/kernel/sunxi-current/ as I've already done. I don't know why it fails with the error described above then, it seems I'm not doing anything wrong...
As I said above, you must look at the list of applied patches, and see jernej's patch at the end, if it applied OK or failed. Patches from the userpatches directory are applied at the end, and the script marks them with a "u" in the output.

The message you read later is simply saying that you did not make any additional changes after applying the provided patches, and therefore it will continue. On the contrary, when you make some additional changes, it will create a new patch with the changes you made.

Enviado desde mi moto g(6) plus mediante Tapatalk

Link to post
Share on other sites

@JMCC

 

Yes, exactly. What I had already understood thanks to the guide suggested by Werner and tried to explain in my previous post. Everything seems in its place but it keeps failing, certainly because I'm doing something wrong but I can't even imagine what.

Here is the full log of my last build attempt but jernej's patch is applied fine according to this line:

 

[ o.k. ] * [u][c] ad153ef6ee5be33531187f97d5fa0c07455dc795.patch

 

In the end I get this:

 

[ error ] ERROR in function compile_kernel [ compilation.sh:413 ]
[ error ] Kernel was not built [ @host ]
[ o.k. ] Process terminated

 

and I can't achieve a successful build while if I just delete the patch everything goes fine. My compile.sh parameters are these:

 

/compile.sh  BOARD=orangepipc BRANCH=current RELEASE=focal BUILD_MINIMAL=no BUILD_DESKTOP=yes KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,gpg,img

 

I don't know what I'm still missing and I apologize for all the time lost on this.

Link to post
Share on other sites

48 minutes ago, guybrushthreepwood said:

I don't know what I'm still missing

You are not missing anything. That is the normal process for kernel developing, things don't work at the first try normally.

 

You already saw that the patch applied correctly, but the changes made by the patch are causing some compilation error. It worked when jernej applied it, but now there is something causing trouble.  So the next step is look at the logs under output/debug, see what failed, and try to fix it. Have fun!

Link to post
Share on other sites

On 1/28/2021 at 5:02 PM, jernej said:

first generate patch from that commit like this and then put it in appropriate folder according to documentation.

Thanks for your effort on this, I got it working on 5.10.12 using pi-zero; the only changes needed were to remove the other definition of sun8i_h3_mixer1_cfg,  added back the tve.dts file from the original patch, as well add it to armbianEnv.txt for invocation as described in the original patch.

 

It is running in dual screen pi-zero; the top screen is a 4.3 inch car monitor, the bottom is a 3.2" ili9341. I haven't tried the PanFrost bit - shouldn't it work on the top screen? Kodi does come up on the top screen.

 

_1310376.JPG

Link to post
Share on other sites

H3 doesn't use panfrost but lima. If you want to run Kodi efficiently, you'll need to pick a lot of kernel and ffmpeg patches from LibreELEC, manually compile ffmpeg and use Kodi without desktop. Oh, and you need Kodi 19 RC1, that probably means compiling Kodi too.

Link to post
Share on other sites

4 hours ago, jernej said:

H3 doesn't use panfrost but lima. If you want to run Kodi efficiently, you'll need to pick a lot of kernel and ffmpeg patches from LibreELEC, manually compile ffmpeg and use Kodi without desktop. Oh, and you need Kodi 19 RC1, that probably means compiling Kodi too.

 

What a mess! I really fear all of this is beyond my knowledge but I don't give up... I was using LibreELEC before (your work too) with great satisfaction but, at least by what I've understood from my extensive research, tv out is impossible to get working there and my HDMI is gone because of the design flaw with the OPi PC. :(

I would try to apply yam1 advices (though I don't still get the whole of them because of my aforementioned limits) at least to get a succesful build with working av out (though it seems I wouldn't ever get Kodi working again). Maybe I could also succeed in compiling Kodi and FFMpeg but I really don't know what patches to pick so I don't even dare to start on that. Isn't OPi zero H2 based? Maybe I recall it wrong...

Link to post
Share on other sites

On 1/30/2021 at 11:18 PM, JMCC said:

You are not missing anything. That is the normal process for kernel developing, things don't work at the first try normally.

 

You already saw that the patch applied correctly, but the changes made by the patch are causing some compilation error. It worked when jernej applied it, but now there is something causing trouble.  So the next step is look at the logs under output/debug, see what failed, and try to fix it. Have fun!

 

Thanks for your teaching as always! :) I've checked under output/debug and I've found what I thought to be a descriptive name: patching.log. I've started from there but unfortunately it just gives confirmation that the patch has been applied successfully. I've checked also output.log which doesn't make me gain any better insight. The relevant file is the .tgz with the timestamp in its name. I've extracted it and found a file called compilation.log. The answers (if I can find them), are almost certainly there... I'll search for them at my best (not that much unfortunately!) bearing in mind the modifications inside jernej's patch and yam1 advices and I'll get back should I succeed in finding anything relevant.

 

EDIT: nothing relevant in the logs (at least not to me). I've also tried to follow yam1's hints but I couldn't get anywhere. I'm starting to think that, considering that Kodi wouldn't work well anyway, it isn't worth the effort. I give up: I would keep my OPi PC in a drawer for an unlikely to happen future project, no use for it under the current conditions. I'd like to thank all of you for your help and advices. I've learnt a lot! :)

Link to post
Share on other sites

That would be great! Thank you! In spite of the fact that by what you've explained I've understood that it is almost impossible to have a satisfactory Kodi experience on Armbian, I still can't accept the defeat... While waiting for let's say LibreELEC 'tv-out capable', I would keep scrambling my mind on the reason why I can't succeed building Armbian. Have a nice day! :)

Link to post
Share on other sites

11 minutes ago, guybrushthreepwood said:

it is almost impossible to have a satisfactory Kodi experience on Armbian

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.

Link to post
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

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

1 1