v17 arch / kodi with omxplayer / not sure if activated, audio sync issues
#1
Hello everyone,

just registered here after using kodi for a while, thanks to all of you for your help.


So I'm running a Rpi 3 with Kernel 4.9 arch and the yaourt package kodi-rbp (kodi 17.1
Quite recently I changed my TV signal to a rtmp stream and now use IPTV simple.
This works quite well but some channels have audio sync problems.

I've found this issue from last year already and my problem should be fixed by now (thanks popcornmix! I love omxplayer, did so many projects already!!), but it's obviously not.

So I tried to look for running processes, but found no omxplayer running.
Now I decided to ask here before I continue. I'm not sure what that means - is Kodi not even using omxplayer?
I disabled mmal in the kodi settings (unchecked the use hardware acceleration for mmal box)

Now I see 2 options;
  • Kodi doesn't use omxplayer
  • My omxplayer is out of date

When looking for an installed omxplayer, I didn't find it.
That's why I suspect my Kodi not use omxplayer at all, although I'm not sure if it's maybe compiled into kodi (but why would you do that? serious question!)

So now I just installed omxplayer with pacman, opened an RTMP stream directly from the terminal and voilà - the audio is sync!
But when I start kodi again, play the same stream - the problem persists.

That's where I am stuck - is Kodi using an integrated omxplayer? Is it not using omxplayer at all?
Can I enforce it? Is the package kodi-rbp maybe wrongly compiled, with omxplayer disabled?
How can I fix that?

Thanks for your help in advance!

Cheers!
Reply
#2
The command line omxplayer from here is not used by kodi.
There is similar code internal to kodi.

First question - are you definitely using omxplayer?
By default omxplayer is disabled in video/acceleration settings and mmal is enabled.
omxplayer is only enabled by default on Pi0/Pi1 which don't really have the cpu necessary for running kodi's VideoPlayer
and isn't recommended for Pi2/Pi3.
Reply
#3
yes, I'm using omxplayer. I disabled mmal because of the sync issues, they stayed the same.
After that I tried the omxplayer from command line.

But I'm testing with mmal now, omxplayer disabled. Give me 3 minutes.
Reply
#4
ok, so it looks sync now with mmal. not sure why omxplayer was switched on. thanks for that.

but still - omxplayer in kodi has those sync issues.
as you said that only the code base of omxplayer is used in kodi - could it be that this patch has not yet made it to kodi on arch (17.1 at the moment)?

https://github.com/popcornmix/omxplayer/...1c656ea3c7
Reply
#5
Kodi includes the omxplayer fix you linked to:
https://github.com/xbmc/xbmc/commit/d548...320005c784

If you can provide a sample file or public stream that exhibits the problem I can take a look.
Reply
#6
I would provide a link but the stream is the multicast Entertain from Deutsche Telekom, which you only can access if you use them.
If you have access, 2 examples stream are:
rtp://@239.35.10.1:10000
rtp://@239.35.10.2:10000

If that's ok for you I will try to reproduce the behaviour the next days and will also try to provide a record if I manage to do it correctly, then PM you.

Thanks again!
Reply
#7
I've noticed these kind of desync issues myself for a while with Kodi 17.1 and they happen only on live streams - in my case tvheadend on the same host as Kodi.
Sometimes I leave my Pi running and playing some Satellite Radio stream in the background for hours and after at least 3-4 hours I start to hear some constant delays, pops and volume changes in the sound. The spectrum visualization plugin also starts to spin with short delays. If I change the channel on some TV stream I notice the picture/sound delay and the only way I can get rid of this is to restart Kodi.

I'm runing Kodi 17.1 on Raspberry Pi2B on 4.4.48-v7+ official kernel, with omxplayer and analog audio.
Kodi Settings:
Player settings: sync playback to display - disabled
Audio Settings: Nr. channels: Fixed; Output conf: Fixed; Resample Q: GPU Accel; Sammple rate: 44.1
In the contextual live playing menu I configured to prefer the DVB Stereo Audio stream instead of AC3 5.1 & co

This audio or audio/video desync doesn't happen really often, but when it does I usually find a few DVB Stream discontinuities reported by tvheadend in syslog - like MPEG2AUDIO @ #336 Continuity counter error (total 1) or in the period before this desync happened I might have copied some big files on my Pi / did some package actualization (pushed a little bit the USB/Ethernet to its limits) while Kodi was running.

I don't remember (maybe I'm wrong) these desyncs before the kernel 4.4.48-v7+ and I'm considering this kernel flawed as it has some weird softIRQ management - someone at Raspberry Foundation or kernel.org might have played with the deferred interrupts settings. Sometimes I just need to restart my Pi because the amount of softIRQs piles up to several thousand for a simple copy through ethernet operation. And there are lucky reboots and unlucky ones, sometimes I need to reboot it twice to have proper functionality restored.
Unfortunately I wasn't able to upgrade to the latest 4.4.50-v7+ kernel because I need to patch my DVB-Tuner module and I'm not able to do it anymore ATM:
https://www.raspberrypi.org/forums/viewt...3&t=182116


popcornmix:

Why are you not recommending omxplayer on Pi 2B? If you're using analog audio, as I am on a wide monitor without embedded speakers, and you are enabling higher quality audio sampling in bootconfig.txt with audio_pwm_mode=2, which does create some consistent overhead on the GPU, then in order to have a smooth play on HD with MMAL BOB deinterlacing (the only one that works without audio pops and crackles) your only option is to use omxplayer.

MMAL works too but without deinterlacing. If you enable whatever deinterlacing under MMAL you'll get pops & crackles in the sound stream and green macroblocks on almost every video frame and finally Kodi GUI runs so slow you can't even use it anymore. CPU stays always constant between 10-15% usage in any case, it's the GPU that gets overwhelmed by MMAL and audio decoding.

Thanks for all the hard work until now - still waiting for a popcornmix Kodi release as it was your 17.03 beta, the only one I was able to compile and use - my first Kodi experience Wink
Reply
#8
(2017-05-03, 03:33)abga Wrote: Why are you not recommending omxplayer on Pi 2B? If you're using analog audio, as I am on a wide monitor without embedded speakers, and you are enabling higher quality audio sampling in bootconfig.txt with audio_pwm_mode=2, which does create some consistent overhead on the GPU, then in order to have a smooth play on HD with MMAL BOB deinterlacing (the only one that works without audio pops and crackles) your only option is to use omxplayer.

MMAL works too but without deinterlacing. If you enable whatever deinterlacing under MMAL you'll get pops & crackles in the sound stream and green macroblocks on almost every video frame and finally Kodi GUI runs so slow you can't even use it anymore. CPU stays always constant between 10-15% usage in any case, it's the GPU that gets overwhelmed by MMAL and audio decoding.

Thanks for all the hard work until now - still waiting for a popcornmix Kodi release as it was your 17.03 beta, the only one I was able to compile and use - my first Kodi experience Wink

Do the mmal problems go away with audio_pwm_mode=2 removed? (I know you may not want to do that, but I want to confirm that is the only issue).
Reply
#9
I just noticed I had an omission in my previous post - just to clear things out for some other users, when I was referring to MMAL I was meaning MMAL accelerated Video Player instead of omxplayer (KODI - Player Settings).

@popcornmix

I got some time to play with the settings you requested and here are the results for DVB HD streams through tvheadend PVR plugin (BTW, it's the first time I saw the H264 core at 300MHz - I thought I had a configuration/firmware issue before):

1.
OMXPlayer without audio_pwm_mode=2
MMAL Full Advanced deinterlacing
CPU 20-25% @ 900 MHz @ 68-71 C
H264 300 MHz
- stable HD play without any image/sound issues - fast play start
- Kodi GUI laggy

MMAL Videoplayer without audio_pwm_mode=2
MMAL Full Advanced deinterlacing
CPU 30-50% @ 900 MHz @ 68-71 C
H264 300 MHz
- stable HD play without any image/sound issues but with some delays and framedrops when starting playing (1 sec)
- Kodi GUI laggy - almost unusable

MMAL Videoplayer without audio_pwm_mode=2
MMAL BOB deinterlacing
CPU 20-40% @ 900 MHz @ 68-71 C
H264 300 MHz
- stable HD play without any image/sound issues fast play start
- Kodi GUI laggy

- some stats, consistent for all the above scenarios:
bcmstat.sh A
Config: v0.4.4, args "A", priority lowest (+19)
Board: 4 x ARMv7 cores available, ondemand governor (Pi2 Model B rev 1.1, BCM2836 SoC with 1GB RAM by Sony)
Memory: 1008MB (split 752MB ARM, 256MB GPU) plus 200MB Swap
HW Block: | ARM | Core | H264 | SDRAM |
Min Freq: | 600MHz | 250MHz | 0MHz | 450MHz |
Max Freq: | 900MHz | 300MHz | 300MHz | 450MHz |
Voltages: | 0, 1.3125V | +1, 1.2250V |
Other: temp_limit=85
Firmware: Feb 15 2017 17:14:25, version b53088af3eae5f17d809e37578f1cb40dd555ed8 (clean) (release)
Codecs: H264 H263 MPG4 MPG2 MJPG PCM
Booted: Wed May 3 19:52:08 2017

Time ARM Core H264 Core Temp (Max) IRQ/s RX B/s TX B/s GPUMem Free Memory Free/Used(SwUse) Accum GPU B Mem kB
======== ======= ======= ======= =============== ====== ========== ========== =========== ======================= =======================
20:14:29 900Mhz 400Mhz 300Mhz 69.14C (70.21C) 1,573 1,319 4,096 147M ( 62%) 763,040 kB/20.3%( 0.0%) 0 -216
20:14:31 900Mhz 400Mhz 300Mhz 69.14C (70.21C) 1,600 104 523 147M ( 62%) 763,368 kB/20.3%( 0.0%) 0 +112
20:14:33 900Mhz 400Mhz 300Mhz 69.14C (70.21C) 1,622 2,972 3,819 147M ( 62%) 762,532 kB/20.4%( 0.0%) 0 -724
20:14:35 900Mhz 400Mhz 300Mhz 68.60C (70.21C) 1,619 82 357 147M ( 62%) 762,316 kB/20.4%( 0.0%) 0 -940
20:14:37 900Mhz 400Mhz 300Mhz 69.14C (70.21C) 1,601 104 257 147M ( 62%) 762,828 kB/20.3%( 0.0%) 0 -428
20:14:39 900Mhz 400Mhz 300Mhz 69.67C (70.21C) 1,605 81 231 147M ( 62%) 762,816 kB/20.3%( 0.0%) 0 -440
20:14:41 900Mhz 400Mhz 300Mhz 69.14C (70.21C) 1,631 81 229 147M ( 62%) 762,968 kB/20.3%( 0.0%) 0 -288

____________________________________________________________________________

Just for comparison - the fastest/optimal configuration I could come up with and which I'm currently using. Worth to mention that I'm using my Pi for a lot of other things, including a PostgreSQL DB, and with this configuration I don't even feel that Kodi is running (apart from some extra 1,5K softIRQs).

2.
OMXPlayer with audio_pwm_mode=2
BOB Full deinterlacing
CPU 10-15% @ 600MHz @ 55-58 C
H264 250 MHz
- stable HD play without any image/sound issues - fast play start
- Kodi GUI fast-responsive

- some stats for this configuration/scenario
/kit/bcmstat.sh A
Config: v0.4.4, args "A", priority lowest (+19)
Board: 4 x ARMv7 cores available, ondemand governor (Pi2 Model B rev 1.1, BCM2836 SoC with 1GB RAM by Sony)
Memory: 1008MB (split 752MB ARM, 256MB GPU) plus 200MB Swap
HW Block: | ARM | Core | H264 | SDRAM |
Min Freq: | 600MHz | 250MHz | 0MHz | 400MHz |
Max Freq: | 900MHz | 300MHz | 300MHz | 400MHz |
Voltages: | 0, 1.3125V | +1, 1.2250V |
Other: temp_limit=85
Firmware: Feb 15 2017 17:14:25, version b53088af3eae5f17d809e37578f1cb40dd555ed8 (clean) (release)
Codecs: H264 H263 MPG4 MPG2 MJPG PCM
Booted: Wed May 3 20:19:09 2017

Time ARM Core H264 Core Temp (Max) IRQ/s RX B/s TX B/s GPUMem Free Memory Free/Used(SwUse) Accum GPU B Mem kB
======== ======= ======= ======= =============== ====== ========== ========== =========== ======================= =======================
20:24:40 600Mhz 250Mhz 250Mhz 56.76C (56.76C) 1,558 942 4,362 154M ( 65%) 759,088 kB/20.7%( 0.0%) 0 +420
20:24:42 600Mhz 250Mhz 250Mhz 56.22C (56.76C) 1,599 354 228 154M ( 65%) 758,536 kB/20.8%( 0.0%) 0 -132
20:24:44 600Mhz 250Mhz 250Mhz 55.69C (56.76C) 1,608 355 229 154M ( 65%) 758,696 kB/20.8%( 0.0%) 0 +28
20:24:46 600Mhz 250Mhz 250Mhz 56.22C (56.76C) 1,604 81 352 154M ( 65%) 758,516 kB/20.8%( 0.0%) 0 -152
20:24:48 600Mhz 250Mhz 250Mhz 55.69C (56.76C) 1,610 80 351 154M ( 65%) 758,436 kB/20.8%( 0.0%) 0 -232
20:24:50 600Mhz 250Mhz 250Mhz 56.22C (56.76C) 1,611 80 227 154M ( 65%) 758,292 kB/20.8%( 0.0%) 0 -376

I'm sorry but I'm not able to resist the horrible sound quality without audio_pwm_mode=2 for a longer time in order to test if I get desyncs on MMAL Videoplayer.
Sad
Reply
#10
@popcornmix

I come with some interesting news based on my latest observations.
1. The audio desync issues on live Satellite TV (DVB adapter) are happening only if I listen on Satellite Radio for a while and switch to Satellite TV, without pressing the stop button in the Radio section before I switch to TV.
2. The reported audio issues while playing Satellite Radio for an extended period are, after a more carefully done analysis, mainly volume changes and are apparently caused by the Volume amplification - 20dB that I am using. Disabling this setting makes the audio issues also disappear.

The only errors I can see in the debug log are:
18:00:38.734 T:1652548592 ERROR: OMXPlayerVideo: Got MSGQ_IS_ERROR(-1) Aborting
21:01:05.546 T:1894142512 ERROR: Control 602 in window 12901 has been asked to focus, but it can't
21:11:03.692 T:1894142512 ERROR: Control 602 in window 12901 has been asked to focus, but it can't
21:11:13.131 T:1644159984 ERROR: OMXPlayerVideo: Got MSGQ_IS_ERROR(-1) Aborting
21:11:54.683 T:1644159984 ERROR: OMXPlayerVideo: Got MSGQ_IS_ERROR(-1) Aborting

And there are a few warnings:
- at the beginning - after Kodi launch
17:57:49.075 T:1894142512 WARNING: CSettingInt: unknown options filler "audiocdactions" of "audiocds.autoaction"
17:57:52.600 T:1894142512 WARNING: JSONRPC: Could not parse type "Setting.Details.SettingList"
17:58:05.609 T:1894142512 WARNING: CPlayerCoreFactory::GetPlayer(videodefaultplayer): no such player: omxplayer
17:58:05.627 T:1894142512 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
17:58:08.716 T:1652548592 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
17:58:09.601 T:1734194160 WARNING: Previous line repeats 3 times.

- then while changing play (TV/TV, Radio/TV) I get some of these:
21:11:49.599 T:1644159984 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
21:11:55.733 T:1894142512 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED

- and there are some, apparently every time I switch the channel
21:01:01.607 T:1652548592 WARNING: CreateLoader - unsupported protocol(pvr) in pvr://channels/tv/All channels/pvr.hts_1584662143.tbn
21:01:01.609 T:1652548592 WARNING: CreateLoader - unsupported protocol(pvr) in pvr://channels/tv/All channels/pvr.hts_318342901.tbn
21:01:01.610 T:1652548592 WARNING: CreateLoader - unsupported protocol(pvr) in pvr://channels/tv/All channels/pvr.hts_472233883.tbn
....
Reply

Logout Mark Read Team Forum Stats Members Help
arch / kodi with omxplayer / not sure if activated, audio sync issues0