pila
Posts: 14
Joined: Fri Jan 06, 2017 9:11 pm

Are RPi4 composite video and audio fully functional and where this bug lies?

Mon Aug 24, 2020 2:47 pm

I have 4 pieces of RPi4 which should be used for watching video/TV. But, video and audio seem not to work on analog plug alone!

RPi4 with LE 9.2.4 are used with video and audio over analog out. Neither sound nor h265 video works correctly! I have posted this in LE forum, but I need confirmation from RPi4 side is that an RPi4 analog video bug or not and can LE team fix this!

Sound on analogue out (amp or headphones, the same), sound is completely useless. I can hear it somewhat but it is stuttering, words can not be understood at all. So, it is not that there is no sound, something can be heard but is unrecognizable - like a robot distorted voice.

At the same time, the analog video h.265 1024p is skipping over like it is being read off from a slow source. But, if I use another RPi4 to display HDMI picture and sound served from this first RPi4 (DVB-T2 USB tuner + TVh) all is well. Cables and amp are all OK since they are normally used daily with RPi2 and RPi3.

If RPi4 is connected to TV with HDMI, analogue output has normal sound. If I unplug HDMI cable, I still have normal sound on analogue output.

But, as soon as I activate analogue composite video out in LE and reboot, sound it is broken, h265 FullHD video too.

> mount -o remount,rw /flash
> nano /flash/config.txt

sdtv_mode=2
enable_tvout=1

> mount -o remount,ro /flash
> reboot

So, the problem is with enable_tvout and how it changes RPi4 clocks! Now, my question: is this a hardware bug in RPi4 related to analogue composite video output or can LE team fix this issue?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 30436
Joined: Sat Jul 30, 2011 7:41 pm

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Mon Aug 24, 2020 3:31 pm

It does sound like a clocking problem. Very unlikely to be a HW fault. Will pass it on to someone who may know more.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5955
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Mon Aug 24, 2020 3:48 pm

enable_tvout limits the core clock to 432 (from default of 500) as the vec hardware needs 108MHz and shares a PLL channel.

Generally that has minimal effect on arm code, but does have some effect on analogue audio (whose sigma-delta resampling runs off the core clock).

You could try replacing sigma-delta resampling with a more basic form with audio_pwm_mode=1

Or you could try overclocking. This isn't something I've tried, so no guarantees (and backing up first is advisable). But this would be my guess.

Code: Select all

core_freq=540
over_voltage=2

pila
Posts: 14
Joined: Fri Jan 06, 2017 9:11 pm

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Tue Aug 25, 2020 1:48 pm

adding audio_pwm_mode=1 enabled analogue sound to work. Now, my parents would likely never notice anything is wrong.

There are some small hiccups with the sound every 10 or 15 seconds or so and the sound is bit out of sync when watching h264 mpeg2 sound. DVB-T2 FullHD h265 aac stream - it seems picture is not skipping any more. But, sound had no hiccups and the sync problem was smaller when a DVB-T2 tuner was on another RPi4.

I think this means we can rule hardware problem out. Thanks for the pointer. I will report a bug with the LE.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5955
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Tue Aug 25, 2020 4:01 pm

I've tried to reproduce using kodi with

Code: Select all

enable_tvout=1
sdtv_mode=2
and without audio_pwm_mode=1 and audio is good for me when playing a 1080p24 hevc file (and even a 4kp24 video file).

It would be useful if I can reproduce the same issue you have (e.g. without the USB tuner).

Are you seeing the same issue when playing video files and not using PVR?

I'm also curious if "force_turbo=1" in config.txt (and without audio_pwm_mode=1) is good or bad for you.

pila
Posts: 14
Joined: Fri Jan 06, 2017 9:11 pm

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Wed Aug 26, 2020 8:05 am

For me, regardless of the video/audio type, analog sound does not work. My RPi4's were all bought October 2019.

force_turbo=1 does not change anything for me.

My TV T2 h265 stream was just what I was testing since that was a reason why I had to buy RPi4 and change LE versions. And that video (picture) is skipping due to the same issue. Sound was completely useless.

Only audio_pwm_mode=1 makes a change and mostly fixes issue.

LE info says my screen is @49,95Hz instead of 50 Hz. It may (or may not) be related to this clock change by enable_tvout.

When in the LE menus I change "Adjust display referesh rate" to "Always" and "Sync playback to display" to on, sound skipping is less obvious but still present. My parents would not notice problem.

In any case, h265 picture skipping is not existing when I use audio_pwm_mode=1

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5955
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Wed Aug 26, 2020 10:57 am

Can you provide a sample file (e.g. 1 min long) that demonstrates the issue? Upload to a site like dropbox or google drive.

pila
Posts: 14
Joined: Fri Jan 06, 2017 9:11 pm

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Wed Aug 26, 2020 6:42 pm

I could but there is no point. When the analogue sound works, any file works. When it does not work, not a single file or TV stream nor GUI sounds work.

I tried many different saved files and TV streams. When the sound is broken, it is the same if I pull Live TV from its own T2 tuner or from another RPi with DVB-T tuners, SD or HD, nothing matters.

It is not related to the format of the picture nor the sound. I am using several RPis and LE to watch TV and video for many years now.

As soon as I save:

sdtv_mode=2
enable_tvout=1

and reboot LE, sound is broken. Here I have 2 different RPi4 and both behave the same. As soon as I enable_tvout=1 and reboot the same file or stream which otherwise works - breaks. Regardless of the source! That same file(s) or stream(s) work(s) with either audio_pwm_mode=1 or without enable_tvout=1.

This is disconcerting for me that you can not duplicate the issue. Adding audio_pwm_mode=1 makes it work very well but not perfectly normal.

I did not clone LE from one card to another. Completely fresh install to a new card. One card is Noobs with dual boot another is LE alone.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5955
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Thu Aug 27, 2020 1:58 pm

Good news for you is I have eventually seen what may be your issue.
I've got it in a state where audio appears to be output at about half speed.
Because of this the audio/video sync drifts and clock needs to be reset (so making video less smooth).

However I've only got it into this state by setting system/audio/audio output device to HDMI (which makes no sense).
Once that has been done setting it to correct setting "PI: Analogue" still has slow audio until you reboot.

Can you confirm audio is set to "Pi: Analogue" and you have rebooted. For me that has correct audio.

I'll look into why choosing the invalid "PI: HDMI" output causes issues.

pila
Posts: 14
Joined: Fri Jan 06, 2017 9:11 pm

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Fri Aug 28, 2020 9:03 am

Slow audio may be a proper description. Plus - it is very quiet compared to normal. Picture may skip after 15-20 seconds of playing well.

I am not certain I understand you well. When I add:
sdtv_mode=2
enable_tvout=1

and reboot, I have a broken sound on analog out. If I change LE output to HDMI, HDMI+Analogue or Analogue only does not matter. Broken.

Among these three settings, there is some small change in the sound. But I still hear something even when it is set to HDMI only! But, when it is set to Analogue only, it is more legible and somewhat louder - stil useless, but when the LE sound is set to analogue, I can understand speaker is talking instead of it being just some changing noise, but I can understand almost no words being said.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5955
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Fri Aug 28, 2020 11:07 am

You need to set audio output to analogue and then reboot. Never set it to hdmi or both as that breaks audio until next reboot.
The hardware cannot support hdmi audio with composite video (they share the same clock).
Requesting hdmi audio with composite video is supposed to be ignored (and remain with analogue) but that wasn't working (I have an internal fix for this now).

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5955
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Thu Sep 03, 2020 5:34 pm

Latest rpi-update firmware contains a fix for the issue of audio breaking until next reboot after choosing hdmi audio output when using composite display.

pila
Posts: 14
Joined: Fri Jan 06, 2017 9:11 pm

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Thu Sep 17, 2020 2:59 pm

As I am running LE, can I run independent rpi-update or should I wait for them to include it in an LE update?

fruitoftheloom
Posts: 27226
Joined: Tue Mar 25, 2014 12:40 pm

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Thu Sep 17, 2020 3:09 pm

pila wrote:
Thu Sep 17, 2020 2:59 pm
As I am running LE, can I run independent rpi-update or should I wait for them to include it in an LE update?

rpi-update is for Raspberry Pi OS which is the RPF / RPT supported Operating System.


LibreElec is an independent Operating System and the Stable release is still using Kernel 4.19, you will need the Testing Release if you want newer:

https://forum.kodi.tv/showthread.php?tid=343068
Take what I advise as advice not the utopian holy grail, and it is gratis !!

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5955
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Are RPi4 composite video and audio fully functional and where this bug lies?

Thu Sep 17, 2020 5:23 pm

pila wrote:
Thu Sep 17, 2020 2:59 pm
As I am running LE, can I run independent rpi-update or should I wait for them to include it in an LE update?
rpi-update won't run. In theory you can download the firmware files and copy them to sdcard.
But waiting for an official update is best.

The issue described here is completely avoided as long as you have audio output device set to analogue (not hdmi or both) in audio settings.

Return to “Troubleshooting”