[Linux] AC3/DTS passthrough + intel_iommu=on => no audio + hangs
#1
Hello all,

I think I've already solved my problem. I thought I'd post it here in case some other poor soul ran across the same thing. I was also curious about WHY this problem exists and I wonder if anyone can add some information -- specifically where I should file a bug report (kodi? alsa? Linux kernel?)

Problem: If I enable audio passthrough over HDMI to my receiver and play an AC3 or DTS audio track, I get no audio, and jerky video which eventually grinds to a freeze-frame halt.

The problem is NOT triggered when passthrough is disabled. The problem is also NOT triggered when doing passthrough with DTS-HD MA or TrueHD audio. Only AC3 and DTS seem vulnerable. I don't have any EAC3 tracks to test.

On first playing a problem track I see the following in kodi.log:

Code:
12:49:45 T:140451512305408   ERROR: CDVDAudio::AddPacketsRenderer - timeout adding data to renderer
12:49:46 T:140453665691392   ERROR: ActiveAE::UnconfigureSink - failed to unconfigure
12:49:48 T:140453665691392   ERROR: ActiveAE::FlushEngine - failed to flush
12:49:50 T:140453665691392   ERROR: ActiveAE::UnconfigureSink - failed to unconfigure

Activating the problem once seems to put the sound hardware into a bad state. I'm unable to play any other videos after triggering the bug once. I get a mix of ActiveAE-related error messages in kodi.log, like the following:

Code:
12:50:09 T:140453665691392   ERROR: ActiveAE::InitSink - failed to init
12:50:24 T:140453657298688   ERROR: Previous line repeats 2 times.
12:50:24 T:140453657298688   ERROR: CAESinkALSA - snd_pcm_writei(-5) Input/output error - trying to recover
12:50:24 T:140453657298688   ERROR: CAESinkALSA::HandleError(snd_pcm_writei(1)) - snd_pcm_writei returned -5 (Input/output error)
12:50:25 T:140453665691392   ERROR: ActiveAE::InitSink - failed to init
12:50:34 T:140453657298688   ERROR: Previous line repeats 1 times.
12:50:34 T:140453657298688   ERROR: CAESinkALSA::HandleError(snd_pcm_writei(2)) - snd_pcm_writei returned -5 (Input/output error)
12:50:36 T:140453665691392   ERROR: ActiveAE::InitSink - failed to init

After blind experimentation I discovered the problem is only triggered with "intel_iommu=on" on the kernel command line (or CONFIG_INTEL_IOMMU_DEFAULT_ON=y in the kernel config). This option seems to be recommended for enabling Intel VT-d. My solution was to remove both of these.

I also noticed that with "intel_iommu=on", I see the following in dmesg shortly after boot:

Code:
[   35.168233] snd_hda_intel 0000:00:03.0: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj.

I am using Kodi 14.1 on Gentoo on an Intel Haswell NUC D54250WYK1. I can provide more hardware info or software config reports if it helps anybody.
Reply
#2
Kernel bug, absolutely nothing we can do about this.

To my knowledge this was long fixed in a recent kernel.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
I have been experiencing a similar (if not the same) problem.

I am running Intel NUC nuc5i3ryh Kodi v16 (also happened on v15) Windows 10 with passthrough (AC3 and DTS) enabled.

I will try disabling passthrough and see if that helps.

Do you know where I can learn more about editing the Kernel.

Thanks so much,
Ricky
Reply
#4
I guess it would be helpful to know what kernels you guys are using, and whether fritsch can tell us when it was fixed?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
Hey Nickr, So I finally worked out how to discover the kernel.

I'm running Windows 10 (Kernel: Windows NT 10.0)

I am getting the issues just about every day now.


Here is a sample of the error log: (apologies i'm not sure how to attach it to the msg)

Code:
18:05:02 T:5220   ERROR: CAESinkDirectSound::UpdateCacheStatus: GetCurrentPosition failed. Unable to determine buffer status. HRESULT = 0x88780096
18:05:02 T:5220   ERROR: CActiveAESink::OutputSamples - sink returned error
...
19:20:14 T:5220   ERROR: CAESinkDirectSound::UpdateCacheStatus: GetCurrentPosition failed. Unable to determine buffer status. HRESULT = 0x88780096
19:20:14 T:5220   ERROR: CActiveAESink::OutputSamples - sink returned error
19:20:15 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:15 T:5216  NOTICE: No Devices found - retry: 4
19:20:16 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:16 T:5216  NOTICE: No Devices found - retry: 3
19:20:18 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:18 T:5216  NOTICE: No Devices found - retry: 2
19:20:19 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:19 T:5216  NOTICE: No Devices found - retry: 1
19:20:21 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:21 T:5216  NOTICE: Found 0 Lists of Devices
19:20:21 T:5220   ERROR: CAESinkDirectSound::Initialize: Failed to create the DirectSound device  with error DSERR_NODRIVER, trying the default device.
19:20:21 T:5220   ERROR: CAESinkDirectSound::Initialize: Failed to create the default DirectSound device with error DSERR_NODRIVER.
Reply
#6
(2016-04-13, 02:25)Ralex Wrote: Hey Nickr, So I finally worked out how to discover the kernel.

I'm running Windows 10 (Kernel: Windows NT 10.0)

I am getting the issues just about every day now.


Here is a sample of the error log: (apologies i'm not sure how to attach it to the msg)

Code:
18:05:02 T:5220   ERROR: CAESinkDirectSound::UpdateCacheStatus: GetCurrentPosition failed. Unable to determine buffer status. HRESULT = 0x88780096
18:05:02 T:5220   ERROR: CActiveAESink::OutputSamples - sink returned error
...
19:20:14 T:5220   ERROR: CAESinkDirectSound::UpdateCacheStatus: GetCurrentPosition failed. Unable to determine buffer status. HRESULT = 0x88780096
19:20:14 T:5220   ERROR: CActiveAESink::OutputSamples - sink returned error
19:20:15 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:15 T:5216  NOTICE: No Devices found - retry: 4
19:20:16 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:16 T:5216  NOTICE: No Devices found - retry: 3
19:20:18 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:18 T:5216  NOTICE: No Devices found - retry: 2
19:20:19 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:19 T:5216  NOTICE: No Devices found - retry: 1
19:20:21 T:5216   ERROR: CAESinkDirectSound::GetDefaultDevice: Retrieval of audio endpoint enumeration failed.
19:20:21 T:5216  NOTICE: Found 0 Lists of Devices
19:20:21 T:5220   ERROR: CAESinkDirectSound::Initialize: Failed to create the DirectSound device  with error DSERR_NODRIVER, trying the default device.
19:20:21 T:5220   ERROR: CAESinkDirectSound::Initialize: Failed to create the default DirectSound device with error DSERR_NODRIVER.

Wrong forum. Mods, please move this post to Windows.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#7
Can someone please post a URL once the thread is moved?
Thanks heaps. R
Reply
#8
(2016-03-08, 07:43)nickr Wrote: I guess it would be helpful to know what kernels you guys are using, and whether fritsch can tell us when it was fixed?

Having this issue using xbian on a raspi 4.


Code:
2020-12-11 07:45:42.115 T:2946412752   ERROR: CAESinkALSA - snd_pcm_writei(-5) Input/output error - trying to recover
2020-12-11 07:45:42.116 T:2946412752   ERROR: CAESinkALSA::HandleError(snd_pcm_writei(1)) - snd_pcm_writei returned -5 (Input/output error)


Linux version 5.4.75+ (jenkins@vps01) (gcc version 4.9.2 ( 4.9.2-10)) #1 SMP PREEMPT Wed Nov 11 14:55:50 CET 2020
Starting Kodi (18.9 (18.9.0) Git:20201027-6d9d93e-dirty). Platform: Linux ARM 32-bit
Reply
#9
all my audio formats work except dts and DD+ unless i disable passthrough that what does that mean? does that mean im not hearing the formats? the audio sounds decent enough with PT disabled? sorry im a newbie
Reply

Logout Mark Read Team Forum Stats Members Help
[Linux] AC3/DTS passthrough + intel_iommu=on => no audio + hangs0