Audio passthrough interrupted periodically
#1
Bug 
Hello Guys,

I'm trying to setup linux audio passthrough using alsa from my hdmi output to receiver in 5.1 configuration, but found some issues with Kodi When DTS/AC3 media is played:
* Video is started, but audio delayed by ~2sec. Every change position - the same thing. After that video & audio are ok in sync.
* Video played smooth, but audio sometimes dropped and restored in ~2sec. There is ~2sec of silence.

I prepared the debug log based on "DTS:X Out of the Box (Long) 1080p H.264 (MKV)DTS:X / DTS 5.1" - used 5.1 DTS audio stream and a clean kodi config (just configured passthrough audio) with some components debug enabled - when I hear that audio drops or restoring - I hit "g" on keyboard.
* With most important info and slightly cut around "HandleKey: g" +1 sec before (lines marked with "--->8---CUT---8<---"): kodi-cut.log
* Full gzipped debug log in base64: kodi.log.gz.b64

Useful observations:
* For 1min of test video I get ~4-5 audio drops, they are not related to video position and looks like happening randomly
* Drops are not happening on non-passthrough audio (checked with aac stream of Blender Cosmos Laundromat)
* IMPORTANT: Drops are not happening if home menu / audio settings is opened during mediafile is played. I just need to press esc while file is playing - and no drops here anymore! But yeah, it's hard to watch movie as a semi-transparent background)
* If I will switch the workspace to some other application, the previous workaround will not work - it's working only when the kodi window is displayed. I can move it to the second screen (always displayed) and work in firefox on the first screen, no audio issues in this case.
* Tried with kodi-x11 on xwayland - the same behavior.

Env Info:
* OS: Ubuntu 18.04.3
* Kernel: Linux workstation-1 5.0.21-050021-generic #201906040731 SMP Tue Jun 4 07:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
* Wayland (Sway 1.2), 1920x1080
* Source: amdgpu XFX R9-FURY-4QFA RADEON R9 FURY X
* Destination: Onkyo TX-NR676 (5.1)
* Kodi: 18.4 (ubuntu packages: kodi 2:18.4+git20190831.2224-final-0bionic, kodi-wayland 2:18.4+git20190831.2224-final-0bionic)

Hopefully you can help with this issue or at least guide how to make the UI active when media is played.
Reply
#2
Try with weston and report back, please.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
Hi @fritsch,

Hmmm, when I started Weston first time - it used my 4k resolution of the main screen (limited 30fps), and when I started kodi and the same example DTS video: tried a number of times with full kodi restart, but results is 50/50:
* 1,3,5 run - audio init delay, like before, but no issues in the middle: kodi.log.gz.b64
* 2,4 - no issues with audio: kodi.log.gz.b64

On configured Weston with 1920x1080 screen 60fps I reproduced the same results as on sway (kodi.log.gz.b64).
Also I tried to use Weston on 1920x1080@30 - but saw the same issues as on 60fps and on sway (kodi.log.gz.b64), but workaround with going back to menu is not working and audio continues to be interrupted

Here I need to add more details about my setup, since seems it's important: I'm use 2 outputs from the Radeon card, both outputs are configured to 1920x1080 60fps:
* DP-3 (through dp-hdmi adapter going to 4k Samsung u24e590d) - main screen
* HDMI-A-1 (going to onkyo receiver and after that to projector LG PF1500) - second screen, projector is powered off to make sure it will not interrupt anything.
Reply
#4
Then open a bug with the AMD people, looks like the CTS values are not correct, means the audio runs too fast.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#5
(2019-11-12, 11:10)fritsch Wrote: Then open a bug with the AMD people, looks like the CTS values are not correct, means the audio runs too fast.

I will for sure check on Intel videocard too, but later and if it's working correctly will dig in AMD direction.

But still I don't understand - why workaround (pressing esc to get menu) is working? That's bugging me - why if the main kodi interface is here - audio passthrough is working correctly on 1920x1080x60? Are you sure it's not some kodi bug?
Reply
#6
We never tested nor support a two screen setup, especially with different display clocks. Bug are likely in every part :-)

What you could try: LibreELEC from USB-Stick. This at least reduces your specialities. LE is used by several thousand AMD users without such a report yet.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#7
I checked on the new libreelec 9.2 with Kodi 18.5 and kernel 5.1.x (just released) - same thing (with just one HDMI -> Onkyo -> projector connected).

Tried the same on the intel system I have - the same libreelec and passthrough working well. So it's definitely something wrong with the workstation hardware.

Rebooted my workstation to 5.4 kernel - but the same issue here. One thing I found that audio drops now ~1-2 times per minute, not like before ~5-6 times.

Next steps is to contact the guys - but I'm not sure which one... Probably it's not the manufacturer, but the amdgpu driver developers, right?
Reply
#8
You know PT is always wallclock. If you want PT audio, you also need to enable "Adjust Refreshrate to match video", then kodi will switch the refreshrate to video's. That is not possible with wayland. On kodi's X11 you can check if that fixes your issue.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#9
I don't think it's a good solution, not just because I don't want to switch back to X11 - but also because on intel there is no need to do that to get a smooth passthrough audio.
So I'd prefer to start a conversation with the driver developers to fix the issue once and for all. I crated an issue on the freedesktop gitlab tracker: drm/amdgpu#980
Reply
#10
Try it - never the less. The wallclock fact won't change.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
Audio passthrough interrupted periodically0