v19 DVDAudioCodecPassthrough.cpp - Audio Frames to HDMI Audio Frame/Packet ratio
#1
Hi All,

I'm trying to investigate the issue I raised here:
https://github.com/xbmc/xbmc/issues/17427

The issue seems to be that many HDMI receivers do continually relock the DD+ bitstream when presented with the current one IEC/DD+ Packet followed by 5 empty IEC packets when a 256SPF EAC3 source is used (Confirmed by AV manufacturer debug). The code that currently combines the EAC3 frames can be seen here:
https://github.com/xbmc/xbmc/blob/49a04c...r.cpp#L311

I'm a C++ amateur but was hoping someone could help me understand this. As far as I can tell the current implementation will passthrough blank audio frames whilst building up the needed 6 frames for 256SPF DD+ which does line up with the diagnosis seen by the the AVR manufacturer. I tried moving the EAC3 buffer to DVDAudioCodecPassthrough.cpp using the recent TrueHD changes as a guide but whilst this did not break it, it did not help either. I think the buffering of DD+ packets needs to happen nearer to the Videoplayer but am struggling to understand the full chain. Should I be looking to buffer these packets in VideoPlayerAudio.cpp?
Reply
#2
I may be able to help you with the code but unfortunately I'm no expert on the specific audio format it self. A working example of a short audio stream might help as a starting point.
Reply
#3
(2021-11-19, 14:14)Boilerplate4U Wrote: I may be able to help you with the code but unfortunately I'm no expert on the specific audio format it self. A working example of a short audio stream might help as a starting point.

Thanks, here is a sample MKV with 256SPF DD+ 5.1 Audio:
https://drive.google.com/file/d/1j77sStX...sp=sharing

If it bitstreams correctly or not will depend on your receiver. Most Denon/Marantz work (But not all) alot of other brands will fail. It all depends if the receiver will tolerate 5 consecutive blank audio packets without trying to re-lock.
Reply
#4
We've got an Onkyo TX-SR608 that support most codecs using pass through up to DTS-X/D and Atmos. I'll test the sample file when I get home sometime early next week. 

EDIT: are you able to create a sample file that fails as well?
Reply
#5
The file provided will work for some receivers and not others. Here is a a compatability list that I got partly from my own hardware and from a lot of people who kindly tested on AVS:
Arcam AV40 - Kodi 18 March 1st - Broken
Arcam AV40 - MPC HC - OK
Onkyo TX-SR805 - Kodi 18.5 - Broken
Onkyo TX-SR805 - PowerDVD 19 - OK
Marantz AV8805 - Kodi 18 - OK
Marantz AV7705 - Kodi 18.5 - OK
Denon AVP-A1HD3D - Kodi 18.2 - OK
Denon AVR-X1300W - Kodi 18.5 - Broken
Denon AVR-X1300W - Kodi 16.1 - OK
Denon AVR-X1300W - Win 10 Media Player - OK
Datasat RS20I - Kodi 18.5 - Broken
Emotiva XMC-2 - Kodi 18.4 - Broken
Anthem MRX750 - Kodi 18.5 - Broken
Arcam AVR750 - Kodi 18.5 - Broken

As you can see the older Onkyo 805 fails but is your newer 608 able to handle that file when bitstreamed? (All receivers work when it is decoded to PCM)
Reply
#6
Hi, fails on my Onkyo TX-SR608 using Kodi 19.3 on Win10 although I'm not sure about the root cause considering all the errors below: "WARNING <general>: ActiveAE - large audio sync error". Do you get the same?  

Maybe OT but a very strange side effect is that this also ruin my WASAPI interface from time to time. When I try to play another video there is no sound at all and the playback freezes after about 10 seconds. I need to restart Kodi to fix it.


kodi:
2021-11-24 13:12:59.313 T:8268     INFO <general>: VideoPlayer::OpenFile: C:\Temp\test.mkv
2021-11-24 13:12:59.318 T:2272     INFO <general>: Creating InputStream
2021-11-24 13:12:59.332 T:2272     INFO <general>: Creating Demuxer
2021-11-24 13:12:59.338 T:2272     INFO <general>: Opening stream: 0 source: 256
2021-11-24 13:12:59.338 T:2272     INFO <general>: Creating video codec with codec id: 70
2021-11-24 13:12:59.338 T:2272     INFO <general>: CDVDVideoCodecFFmpeg::Open() Using codec: SMPTE VC-1
2021-11-24 13:12:59.339 T:2272  WARNING <general>: DXVA::CContext::CreateContext: using app d3d11 device for decoding due extended NV12 shared textures it's not supported.
2021-11-24 13:12:59.339 T:2272     INFO <general>: DXVA::CDecoder::Open: Total video memory available is 1792 MB (dedicated = 64 MB, shared = 1728 MB)
2021-11-24 13:12:59.361 T:2272     INFO <general>: DXVA::CDecoder::Close: closing decoder.
2021-11-24 13:12:59.361 T:2272     INFO <general>: DXVA: closing decoder context.
2021-11-24 13:12:59.362 T:2272  WARNING <general>: DXVA::CContext::CreateContext: using app d3d11 device for decoding due extended NV12 shared textures it's not supported.
2021-11-24 13:12:59.362 T:2272     INFO <general>: DXVA::CDecoder::Open: Total video memory available is 1792 MB (dedicated = 64 MB, shared = 1728 MB)
2021-11-24 13:12:59.394 T:2272     INFO <general>: Creating video thread
2021-11-24 13:12:59.395 T:8020     INFO <general>: running thread: video_thread
2021-11-24 13:12:59.395 T:2272     INFO <general>: Opening stream: 1 source: 256
2021-11-24 13:12:59.395 T:2272     INFO <general>: Finding audio codec for: 86056
2021-11-24 13:12:59.395 T:2272     INFO <general>: Creating audio thread
2021-11-24 13:12:59.396 T:7912     INFO <general>: running thread: CVideoPlayerAudio:Tonguerocess()
2021-11-24 13:12:59.397 T:8020     INFO <general>: DXVA::CDecoder::Close: closing decoder.
2021-11-24 13:12:59.397 T:8020     INFO <general>: DXVA: closing decoder context.
2021-11-24 13:12:59.398 T:8020  WARNING <general>: DXVA::CContext::CreateContext: using app d3d11 device for decoding due extended NV12 shared textures it's not supported.
2021-11-24 13:12:59.398 T:8020     INFO <general>: DXVA::CDecoder::Open: Total video memory available is 1792 MB (dedicated = 64 MB, shared = 1728 MB)
2021-11-24 13:12:59.410 T:7912     INFO <general>: CAEStreamParser::TrySyncAC3 - E-AC3 stream detected (6 channels, 48000Hz)
2021-11-24 13:12:59.410 T:7912     INFO <general>: Creating audio stream (codec id: 86056, channels: 6, sample rate: 48000, pass-through)
2021-11-24 13:12:59.411 T:5656     INFO <general>: CActiveAESink::OpenSink - initialize sink
2021-11-24 13:12:59.416 T:5656     INFO <general>: CAESinkWASAPI::InitializeExclusive: Format is Supported - will attempt to Initialize
2021-11-24 13:12:59.419 T:7912    ERROR <general>: CAEStreamInfo::GetDuration - invalid stream type
2021-11-24 13:12:59.435 T:8268     INFO <general>: Skipped 1 duplicate messages..
2021-11-24 13:12:59.435 T:8268     INFO <general>: DXVA::CProcessorHD::InitProcessor: supported deinterlace methods: blend:yes, bob:yes, adaptive:yes, mocomp:yes.
2021-11-24 13:12:59.441 T:8268  WARNING <general>: CRendererHQ::CheckVideoParameters: chosen scaling method 1 is not supported by renderer
2021-11-24 13:12:59.571 T:5656     INFO <general>: CAESinkWASAPI::InitializeExclusive: WASAPI Exclusive Mode Sink Initialized using: AE_FMT_S16NE, 192000, 2
2021-11-24 13:13:00.055 T:8020     INFO <general>: CDVDVideoCodecFFmpeg::CDropControl: calculated diff time: 41000
2021-11-24 13:13:02.380 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1001.916577
2021-11-24 13:13:02.427 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1007.231377
2021-11-24 13:13:02.428 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1034.949277
2021-11-24 13:13:02.477 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1029.478144
2021-11-24 13:13:02.479 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1017.673577
2021-11-24 13:13:02.480 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1045.192477
2021-11-24 13:13:02.526 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1015.801277
2021-11-24 13:13:02.527 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1043.204777
2021-11-24 13:13:02.527 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1070.549577
2021-11-24 13:13:02.577 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1061.473677
2021-11-24 13:13:02.578 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1024.099677
2021-11-24 13:13:02.579 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1051.892877
2021-11-24 13:13:02.579 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1079.265777
2021-11-24 13:13:02.626 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1024.782177
2021-11-24 13:13:02.627 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1052.190577
2021-11-24 13:13:02.627 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1079.482177
2021-11-24 13:13:02.627 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1106.780577
2021-11-24 13:13:02.679 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1093.275852
2021-11-24 13:13:02.680 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1010.450077
2021-11-24 13:13:02.680 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1036.774477
2021-11-24 13:13:02.681 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1064.080177
2021-11-24 13:13:02.681 T:9080  WARNING <general>: ActiveAE - large audio sync error: -1091.362877

.   .   .
.   .   .
Reply
#7
Thanks for looking at this. I assume it works fine if you do not output bitstream and let it decode to 5.1 PCM?

I will collect another error log tomorrow and see if I get the same sync errors.
Reply
#8
Transcoding using HDMI DIRECTSOUND works. I don't know if it's by design but using passthrough the sound is always delayed with about 2-4 seconds but with transcoding it appears immediately.

Code:
2021-11-24 13:38:41.672 T:8268     INFO <general>: VideoPlayer::OpenFile: C:\Temp\test.mkv
2021-11-24 13:38:41.674 T:1448     INFO <general>: Creating InputStream
2021-11-24 13:38:41.745 T:1448     INFO <general>: Creating Demuxer
2021-11-24 13:38:41.751 T:1448     INFO <general>: Opening stream: 0 source: 256
2021-11-24 13:38:41.751 T:1448     INFO <general>: Creating video codec with codec id: 70
2021-11-24 13:38:41.751 T:1448     INFO <general>: CDVDVideoCodecFFmpeg::Open() Using codec: SMPTE VC-1
2021-11-24 13:38:41.751 T:1448  WARNING <general>: DXVA::CContext::CreateContext: using app d3d11 device for decoding due extended NV12 shared textures it's not supported.
2021-11-24 13:38:41.752 T:1448     INFO <general>: DXVA::CDecoder::Open: Total video memory available is 1792 MB (dedicated = 64 MB, shared = 1728 MB)
2021-11-24 13:38:41.772 T:1448     INFO <general>: DXVA::CDecoder::Close: closing decoder.
2021-11-24 13:38:41.772 T:1448     INFO <general>: DXVA: closing decoder context.
2021-11-24 13:38:41.773 T:1448  WARNING <general>: DXVA::CContext::CreateContext: using app d3d11 device for decoding due extended NV12 shared textures it's not supported.
2021-11-24 13:38:41.773 T:1448     INFO <general>: DXVA::CDecoder::Open: Total video memory available is 1792 MB (dedicated = 64 MB, shared = 1728 MB)
2021-11-24 13:38:41.798 T:1448     INFO <general>: Creating video thread
2021-11-24 13:38:41.798 T:8632     INFO <general>: running thread: video_thread
2021-11-24 13:38:41.799 T:1448     INFO <general>: Opening stream: 1 source: 256
2021-11-24 13:38:41.799 T:1448     INFO <general>: Finding audio codec for: 86056
2021-11-24 13:38:41.800 T:1448     INFO <general>: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder eac3
2021-11-24 13:38:41.800 T:1448     INFO <general>: Creating audio thread
2021-11-24 13:38:41.800 T:5464     INFO <general>: running thread: CVideoPlayerAudio:: Process()
2021-11-24 13:38:41.812 T:8632     INFO <general>: DXVA::CDecoder::Close: closing decoder.
2021-11-24 13:38:41.813 T:8632     INFO <general>: DXVA: closing decoder context.
2021-11-24 13:38:41.813 T:8632  WARNING <general>: DXVA::CContext::CreateContext: using app d3d11 device for decoding due extended NV12 shared textures it's not supported.
2021-11-24 13:38:41.814 T:8632     INFO <general>: DXVA::CDecoder::Open: Total video memory available is 1792 MB (dedicated = 64 MB, shared = 1728 MB)
2021-11-24 13:38:41.815 T:5464     INFO <general>: Creating audio stream (codec id: 86056, channels: 6, sample rate: 48000, no pass-through)
2021-11-24 13:38:41.816 T:5656     INFO <general>: CActiveAESink::OpenSink - initialize sink
2021-11-24 13:38:41.892 T:8268     INFO <general>: DXVA::CProcessorHD::InitProcessor: supported deinterlace methods: blend:yes, bob:yes, adaptive:yes, mocomp:yes.
2021-11-24 13:38:41.908 T:8268  WARNING <general>: CRendererHQ::CheckVideoParameters: chosen scaling method 1 is not supported by renderer
2021-11-24 13:38:42.211 T:8632     INFO <general>: CDVDVideoCodecFFmpeg::CDropControl: calculated diff time: 41000
2021-11-24 13:39:15.891 T:8268     INFO <general>: CVideoPlayer::CloseFile()
2021-11-24 13:39:15.893 T:1448     INFO <general>: CVideoPlayer::OnExit()
2021-11-24 13:39:15.894 T:1448     INFO <general>: Closing stream player 1
2021-11-24 13:39:15.894 T:1448     INFO <general>: Waiting for audio thread to exit
2021-11-24 13:39:15.894 T:8268     INFO <general>: VideoPlayer: waiting for threads to exit
2021-11-24 13:39:15.907 T:5464     INFO <general>: thread end: CVideoPlayerAudio::OnExit()
2021-11-24 13:39:15.908 T:1448     INFO <general>: Closing audio device
2021-11-24 13:39:15.924 T:5656     INFO <general>: CActiveAESink::OpenSink - initialize sink
2021-11-24 13:39:15.926 T:1448     INFO <general>: Deleting audio codec
2021-11-24 13:39:15.927 T:1448     INFO <general>: Closing stream player 2
2021-11-24 13:39:15.927 T:1448     INFO <general>: waiting for video thread to exit
2021-11-24 13:39:15.937 T:8632     INFO <general>: thread end: video_thread
2021-11-24 13:39:15.940 T:1448     INFO <general>: deleting video codec
2021-11-24 13:39:15.944 T:1448     INFO <general>: DXVA::CDecoder::Close: closing decoder.
2021-11-24 13:39:15.944 T:1448     INFO <general>: DXVA: closing decoder context.
2021-11-24 13:39:15.948 T:8268     INFO <general>: VideoPlayer: finished waiting
2021-11-24 13:39:15.949 T:8268     INFO <general>: CVideoPlayer::CloseFile()
2021-11-24 13:39:15.949 T:8268     INFO <general>: VideoPlayer: waiting for threads to exit
2021-11-24 13:39:15.949 T:8268     INFO <general>: VideoPlayer: finished waiting
2021-11-24 13:39:15.965 T:2284     INFO <general>: Deleting settings information for files C:\Temp\test.mkv
Reply
#9
With 19.3 I also get the synch errors when bitstreaming that file (PCM / bit stream disabled is fine):
Code:

2021-11-25 12:03:17.806 T:6760    DEBUG <general>: CEdl::ReadEditDecisionLists - Checking for edit decision lists (EDL) on local drive or remote share for: smb://192.168.0.220/Data2/HDDVD Rips/Liar Liar.mkv
2021-11-25 12:03:17.806 T:6760     INFO <general>: Opening stream: 1 source: 256
2021-11-25 12:03:17.806 T:6760     INFO <general>: Finding audio codec for: 86056
2021-11-25 12:03:17.806 T:6760     INFO <general>: Creating audio thread
2021-11-25 12:03:17.807 T:1876    DEBUG <general>: Thread VideoPlayerAudio start, auto delete: false
2021-11-25 12:03:17.807 T:1876     INFO <general>: running thread: CVideoPlayerAudio:Tonguerocess()
2021-11-25 12:03:17.807 T:1876    DEBUG <general>: CVideoPlayerAudio - CDVDMsg::GENERAL_PAUSE: 0
2021-11-25 12:03:17.807 T:6760    DEBUG <general>: CVideoPlayer::SetCaching - caching state 1
2021-11-25 12:03:17.807 T:6760    DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2021-11-25 12:03:17.807 T:6760    DEBUG <general>: CVideoPlayer::HandleMessages - player 2 reported state: 0
2021-11-25 12:03:17.807 T:6760    DEBUG <general>: CVideoPlayer::HandleMessages - player 1 reported state: 0
2021-11-25 12:03:17.807 T:6760    DEBUG <general>: CVideoPlayer::SetCaching - caching state 1
2021-11-25 12:03:17.807 T:6688    DEBUG <general>: CVideoPlayerVideo - Stillframe left, switching to normal playback
2021-11-25 12:03:17.807 T:6760    DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2021-11-25 12:03:17.807 T:6688    DEBUG <general>: DXVA::CDecoder::~CDecoder: destructing decoder, 0x1f6a3499b30.
2021-11-25 12:03:17.807 T:6760    DEBUG <general>: CVideoPlayer::SetCaching - caching state 2
2021-11-25 12:03:17.807 T:6760    DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2021-11-25 12:03:17.807 T:6688     INFO <general>: DXVA::CDecoder::Close: closing decoder.
2021-11-25 12:03:17.807 T:6688     INFO <general>: DXVA: closing decoder context.
2021-11-25 12:03:17.808 T:6688    DEBUG <general>: DXVA::CVideoBufferPool::~CVideoBufferPool: destructing buffer pool.
2021-11-25 12:03:17.818 T:1876    DEBUG <general>: CDVDAudio:Tongueause - pausing audio stream
2021-11-25 12:03:17.818 T:1876     INFO <general>: Skipped 2 duplicate messages..
2021-11-25 12:03:17.818 T:1876     INFO <general>: CAEStreamParser::TrySyncAC3 - E-AC3 stream detected (6 channels, 48000Hz)
2021-11-25 12:03:17.818 T:1876     INFO <general>: Creating audio stream (codec id: 86056, channels: 6, sample rate: 48000, pass-through)
2021-11-25 12:03:17.818 T:7172     INFO <general>: CActiveAESink::OpenSink - initialize sink
2021-11-25 12:03:17.818 T:7172    DEBUG <general>: CActiveAESink::OpenSink - trying to open device WASAPI:default
2021-11-25 12:03:17.823 T:7172     INFO <general>: CAESinkWASAPI::InitializeExclusive: Format is Supported - will attempt to Initialize
2021-11-25 12:03:17.825 T:1876    DEBUG <general>: CVideoPlayerAudio:: synctype set to 0: clock feedback
2021-11-25 12:03:17.825 T:1876    ERROR <general>: CAEStreamInfo::GetDuration - invalid stream type
2021-11-25 12:03:17.837 T:6688    DEBUG <general>: Skipped 1 duplicate messages..
2021-11-25 12:03:17.837 T:6688    DEBUG <general>: CDVDVideoCodecFFmpeg - Updated codec: ff-vc1
2021-11-25 12:03:17.837 T:6688    DEBUG <general>: DXVA: open decoder.
2021-11-25 12:03:17.837 T:6688     INFO <general>: DXVA::CContext::CreateContext: creating discrete d3d11va device for decoding.
2021-11-25 12:03:17.841 T:6688    DEBUG <general>: HookOpenAdapter10_2: hook into pOpenData->pAdapterFuncs->pfnCreateDevice
2021-11-25 12:03:17.849 T:6688    DEBUG <general>: HookCreateDevice: hook into pCreateData->pDeviceFuncs->pfnCreateResource
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'MPEG2 variable-length decoder'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'MPEG2 inverse discrete cosine transform'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'VC-1 variable-length decoder 2010'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'VC-1 variable-length decoder 2 (Intel)'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'VC-1 variable-length decoder (Intel)'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'Windows Media Video 9 inverse discrete cosine transform'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'VC-1 inverse discrete cosine transform'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'H.264 variable-length decoder, no film grain technology'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'H.264 stereo high profile, mbs flag set'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'H.264 stereo high profile'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'H.264 multi-view high profile'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports C528916C-c0af-4645-8cb2-372b6d4adc2a
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 91CD2D6E-897b-4fa1-b0d7-51dc88010e0a
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 90B899EA-3a62-4705-88b3-8df04b2744e7
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 442B942A-b4d9-4940-bc45-a882e5f919f3
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 97688186-56a8-4094-b543-fc9daaa49f4b
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 1424D4DC-7cf5-4bb1-9cd7-b63717a72a6b
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports C346E8A3-cbed-4d27-87cc-a70eb4dc8c27
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports FFC79924-5eaf-4666-a736-06190f281443
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 2364D06A-f67f-4186-aed0-62b99e1784f1
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 464BDB3C-91c4-4e9b-896f-225496ac4ed6
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 28566328-f041-4466-8b14-8f5831e78f8b
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 6B4A94DB-54fe-4ae1-9be4-7a7dad004600
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 8C56EB1E-2b47-466f-8d33-7dbcd63f3df2
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'HEVC variable-length decoder, main'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 75FC75F7-c589-4a07-a25b-72e03b0383b3
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'HEVC variable-length decoder, main10'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 07CFAFFB-5a2e-4b99-b62a-e4ca53b6d5aa
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'VP9 variable-length decoder, Profile 0'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 'VP9 variable-length decoder, 10bit, profile 2'
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 76988A52-df13-419a-8e64-ffcf4a336cf5
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 80A3A7BD-89d8-4497-a2b8-2126af7e6eb8
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 50925B7B-e931-4978-a12a-586630f095f9
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports B69C20E0-2508-8790-0305-875499e0a2d0
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: supports 49761BEC-4b63-4349-a5ff-87ffdf088466
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: trying 'VC-1 variable-length decoder 2010'.
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: config 0: bitstream type 1.
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: config 1: bitstream type 1.
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: config 2: bitstream type 1.
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: config 3: bitstream type 1, encrypted.
2021-11-25 12:03:17.851 T:6688    DEBUG <general>: DXVA: selected output format: 103.
2021-11-25 12:03:17.852 T:6688    DEBUG <general>: DXVA: source requires 1 references.
2021-11-25 12:03:17.852 T:6688     INFO <general>: DXVA::CDecoder::Open: Total video memory available is 3163 MB (dedicated = 128 MB, shared = 3035 MB)
2021-11-25 12:03:17.852 T:6688    DEBUG <general>: DXVA: allocating 10 surfaces with format 103.
2021-11-25 12:03:17.853 T:7172     INFO <general>: CAESinkWASAPI::InitializeExclusive: WASAPI Exclusive Mode Sink Initialized using: AE_FMT_S16NE, 192000, 2
2021-11-25 12:03:17.853 T:7172    DEBUG <general>: CActiveAESink::OpenSink - WASAPI Initialized:
2021-11-25 12:03:17.853 T:7172    DEBUG <general>:   Output Device : default
2021-11-25 12:03:17.853 T:7172    DEBUG <general>:   Sample Rate   : 192000
2021-11-25 12:03:17.853 T:7172    DEBUG <general>:   Sample Format : AE_FMT_S16NE
2021-11-25 12:03:17.853 T:7172    DEBUG <general>:   Channel Count : 2
2021-11-25 12:03:17.853 T:7172    DEBUG <general>:   Channel Layout: FL, FR
2021-11-25 12:03:17.853 T:7172    DEBUG <general>:   Frames        : 9600
2021-11-25 12:03:17.853 T:7172    DEBUG <general>:   Frame Size    : 4
2021-11-25 12:03:17.856 T:7204    DEBUG <general>: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
2021-11-25 12:03:17.862 T:6760    DEBUG <general>: Skipped 1 duplicate messages..
2021-11-25 12:03:17.862 T:6760    DEBUG <general>: CVideoPlayer::HandleMessages - player started 1
2021-11-25 12:03:17.899 T:6688    DEBUG <general>: CDVDVideoCodecFFmpeg - Updated codec: ff-vc1-d3d11va
2021-11-25 12:03:17.903 T:6688    DEBUG <general>: CRenderManager::Configure - change configuration. 1920x1080. display: 1920x1080. framerate: 29.97.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: CRenderManager:Big GrineleteRenderer - deleting renderer
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: CWinRenderer::SelectRenderer: requested render method: 0
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: CWinRenderer::SelectRenderer: selected render method: DXVA
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: CWIN32Util::GetWindowsHDRStatus: Display is not HDR capable or cannot be detected
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: initing video enumerator with params: 1920x1920.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: video processor has 1 rate conversion.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: video processor has 0xaef feature caps.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: video processor has 0x1e device caps.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: video processor has 0 input format caps.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: video processor has 8 max input streams.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: video processor has 8 max stream states.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: video processor supports HDR10.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: selected video processor index: 0.
2021-11-25 12:03:17.909 T:6936     INFO <general>: DXVA::CProcessorHD::InitProcessor: supported deinterlace methods: blend:yes, bob:yes, adaptive:yes, mocomp:yes.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: selected video processor allows 1 future frames and 1 past frames.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: filter 0 has following params - max: 1000, min: -1000, default: 0
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: filter 1 has following params - max: 1000, min: 0, default: 100
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: filter 2 has following params - max: 1800, min: -1800, default: 0
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: filter 3 has following params - max: 1000, min: 0, default: 100
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: HLG color space conversion is NOT supported.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::InitProcessor: HDR10 RGB limited range output is supported.
2021-11-25 12:03:17.909 T:6936    DEBUG <general>: DXVA::CProcessorHD::OpenProcessor: creating processor.
2021-11-25 12:03:17.913 T:6936    DEBUG <general>: CRenderManager::Configure - 6
2021-11-25 12:03:17.913 T:6936  WARNING <general>: CRendererHQ::CheckVideoParameters: chosen scaling method 1 is not supported by renderer
2021-11-25 12:03:17.913 T:6936    DEBUG <general>: CRendererBase::CreateIntermediateTarget: intermediate target format 87.
2021-11-25 12:03:17.913 T:6936    DEBUG <general>: CWinShader::LoadEffect: loading shader special://xbmc/system/shaders/output_d3d.fx
2021-11-25 12:03:17.917 T:6760    DEBUG <general>: CVideoPlayer::HandleMessages - player started 2
2021-11-25 12:03:17.917 T:6760    DEBUG <general>: CVideoPlayer::SetCaching - caching state 3
2021-11-25 12:03:17.917 T:6760    DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2021-11-25 12:03:17.917 T:6760    DEBUG <general>: CVideoPlayer::SetCaching - caching state 0
2021-11-25 12:03:17.917 T:6760    DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2021-11-25 12:03:17.917 T:6760    DEBUG <general>: VideoPlayer::Sync - Audio - pts: 47000.000000, cache: 352000.022650, totalcache: 699999.988079
2021-11-25 12:03:17.917 T:6760    DEBUG <general>: VideoPlayer::Sync - Video - pts: 30000.000000, cache: 50000.000000, totalcache: 100000.000000
2021-11-25 12:03:17.917 T:1876    DEBUG <general>: CVideoPlayerAudio - CDVDMsg::GENERAL_RESYNC(-305000.022650), level: 100, cache: 352000.022650
2021-11-25 12:03:17.917 T:1876    DEBUG <general>: CDVDAudio::Resume - resume audio stream
2021-11-25 12:03:17.917 T:6688    DEBUG <general>: CVideoPlayerVideo - CDVDMsg::GENERAL_RESYNC(-305000.022650)
2021-11-25 12:03:17.918 T:7204    DEBUG <general>: ActiveAE - start sync of audio stream
2021-11-25 12:03:17.929 T:7984    DEBUG <general>: Thread BackgroundLoader 7984 terminating
2021-11-25 12:03:17.943 T:2304    DEBUG <general>: CApplication::OnAVChange: CApplication::OnAVChange
2021-11-25 12:03:17.943 T:2304    DEBUG <general>: Skipped 2 duplicate messages..
2021-11-25 12:03:17.943 T:2304    DEBUG <general>: CApplication::OnAVStarted: CApplication::OnAVStarted
2021-11-25 12:03:18.011 T:6936    DEBUG <general>: Activating window ID: 12005
2021-11-25 12:03:18.011 T:6936    DEBUG <general>: ------ Window Deinit (MyVideoNav.xml) ------
2021-11-25 12:03:18.011 T:6936    DEBUG <general>: FreeVisualisation() done
2021-11-25 12:03:18.012 T:6936    DEBUG <general>: ------ Window Init (VideoFullScreen.xml) ------
2021-11-25 12:03:18.012 T:6936     INFO <general>: [WHITELIST] Searching the whitelist for: width: 1920, height: 1080, fps: 29.970, 3D: false
2021-11-25 12:03:18.012 T:6936    DEBUG <general>: [WHITELIST] Searching for an exact resolution with an exact refresh rate
2021-11-25 12:03:18.013 T:6936    DEBUG <general>: [WHITELIST] Matched an exact resolution with an exact refresh rate Generic PnP Monitor #1: 1920x1080 @ 29.97Hz (231)
2021-11-25 12:03:18.013 T:6936     INFO <general>: Display resolution ADJUST : Generic PnP Monitor #1: 1920x1080 @ 29.97Hz (231) (weight: 0.000)
2021-11-25 12:03:18.016 T:7088    DEBUG <general>: CApplication::OnAVChange: CApplication::OnAVChange
2021-11-25 12:03:18.059 T:7204    DEBUG <general>: ActiveAE::SyncStream - average error of 88.076959, start adjusting
2021-11-25 12:03:18.059 T:7204    DEBUG <general>: ActiveAE::SyncStream - average error 24.076959 below threshold of 30.000000
2021-11-25 12:03:18.071 T:6936    DEBUG <general>: ------ Window Deinit (DialogBusy.xml) ------
2021-11-25 12:03:18.343 T:6688     INFO <general>: CDVDVideoCodecFFmpeg::CDropControl: calculated diff time: 41000
2021-11-25 12:03:19.059 T:7204    DEBUG <general>: ActiveAE::SyncStream - average error -224.742664 above threshold of 100.000000
2021-11-25 12:03:19.060 T:7204    DEBUG <general>: ActiveAE::SyncStream - average error -0.742664 below threshold of 30.000000
2021-11-25 12:03:20.060 T:7204    DEBUG <general>: ActiveAE::SyncStream - average error -551.575544 above threshold of 100.000000
2021-11-25 12:03:20.159 T:7204    DEBUG <general>: ActiveAE::SyncStream - average error -7.575544 below threshold of 30.000000
2021-11-25 12:03:20.760 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1003.391049
2021-11-25 12:03:20.810 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1000.193849
2021-11-25 12:03:20.810 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1026.288449
2021-11-25 12:03:20.910 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1031.548316
2021-11-25 12:03:20.910 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1019.343549
2021-11-25 12:03:20.910 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1046.417849
2021-11-25 12:03:20.961 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1023.238349
2021-11-25 12:03:20.961 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1049.466449
2021-11-25 12:03:20.961 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1076.578249
2021-11-25 12:03:21.010 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1063.594749
2021-11-25 12:03:21.010 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1003.702349
2021-11-25 12:03:21.010 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1029.847149
2021-11-25 12:03:21.010 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1056.936149
2021-11-25 12:03:21.010 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1084.020249
2021-11-25 12:03:21.060 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1030.618449
2021-11-25 12:03:21.060 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1057.891749
2021-11-25 12:03:21.060 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1084.985349
2021-11-25 12:03:21.061 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1112.066149
2021-11-25 12:03:21.111 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1094.961704
2021-11-25 12:03:21.111 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1122.203804
2021-11-25 12:03:21.111 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1149.317804
2021-11-25 12:03:21.111 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1176.402804
2021-11-25 12:03:21.112 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1024.628337
2021-11-25 12:03:21.112 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1051.773637
2021-11-25 12:03:21.112 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1078.879137
2021-11-25 12:03:21.112 T:7204  WARNING <general>: ActiveAE - large audio sync error: -1105.968937
Reply
#10
Have made a small amount of progress. If I change the threshold variable from 100 to 600 in cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp it is possible to get sound with bitstream output. I have to start the video, turn off audio passthrough and then turn it back on which results in getting sound about 80% of the time with a consistent DD+ lock on my receiver (So severe dropouts but much better than no sound/lock at all). 
The log then looks a bit like this (Large audio sync errors are gone):
Code:
2021-11-25 15:15:46.736 T:7780    DEBUG <general>: CVideoPlayerVideo - CDVDMsg::GENERAL_RESYNC(26696999.977350)
2021-11-25 15:15:46.736 T:5772    DEBUG <general>: ActiveAE - start sync of audio stream
2021-11-25 15:15:46.737 T:3920    DEBUG <general>: CApplication::OnAVStarted: CApplication::OnAVStarted
2021-11-25 15:15:46.753 T:6972    DEBUG <general>: ------ Window Deinit (DialogBusy.xml) ------
2021-11-25 15:15:46.840 T:5772    DEBUG <general>: ActiveAE::SyncStream - average error of 89.664368, start adjusting
2021-11-25 15:15:46.890 T:5772    DEBUG <general>: ActiveAE::SyncStream - average error 25.664368 below threshold of 30.000000
2021-11-25 15:15:47.075 T:7780     INFO <general>: CDVDVideoCodecFFmpeg::CDropControl: calculated diff time: 40909
2021-11-25 15:15:47.891 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-149795.291600, adjusted:-33366.666667
2021-11-25 15:15:47.891 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-116428.624933, adjusted:-33366.666667
2021-11-25 15:15:47.891 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-83061.958266, adjusted:-33366.666667
2021-11-25 15:15:47.891 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-49695.291600, adjusted:-33366.666667
2021-11-25 15:15:48.890 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-27410.723816, adjusted:-33366.666667
2021-11-25 15:15:51.940 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-28969.938256, adjusted:-33366.666667
2021-11-25 15:15:52.940 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-41113.354551, adjusted:-33366.666667
2021-11-25 15:15:53.941 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-55051.839944, adjusted:-33366.666667
2021-11-25 15:15:54.940 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-28273.550962, adjusted:-33366.666667
2021-11-25 15:15:58.941 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-43010.328187, adjusted:-33366.666667
2021-11-25 15:16:00.940 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-51850.911007, adjusted:-33366.666667
2021-11-25 15:16:02.459 T:7780    DEBUG <general>: CPtsTracker: detected pattern of length 2: 33400.00 50016.67, frameduration: 41708.333333
2021-11-25 15:16:02.789 T:7780    DEBUG <general>: CPtsTracker: pattern lost on diff 66683.333333, number of losses 1
2021-11-25 15:16:02.940 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-50547.455438, adjusted:-33366.666667
2021-11-25 15:16:09.991 T:2076    DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-59625.708529, adjusted:-33366.666667
Reply
#11
Great progress! Regarding passthrough, I've got similar problem with WASAPI when I switch between window mode and full screen.  When the problem occur I ​have to start the video in window mode, toggle passthrough and then switch back to full screen. There's something fishy with Kodi but what..

Btw, I tested with both the old and new media player in Win10 and the Leawo Bluray Player without any problems. 

Is there a way one can capture the audio output and save it to a file?
Reply
#12
This is what happens when WASAPI fails. I have seen this reported in the forum as: no sound and the video freezes after 8-10 seconds. I'll have a look at what has changed in the past when it comes to the sound layers/sinks, which can also be the reason why the empty sound frames are produced.

Btw, might be a bit late to ask but what is the main objective here, as in get rid of the blank audio frames, convert it to something else or?

log:
2021-11-24 18:25:12.167 T:4548    DEBUG <general>: CAESinkWASAPI::InitializeExclusive: IsFormatSupported failed (AUDCLNT_E_UNSUPPORTED_FORMAT) - trying to find a compatible format
2021-11-24 18:25:12.224 T:4548    ERROR <general>: CAESinkWASAPI::InitializeExclusive: Failed to initialize WASAPI in exclusive mode -2004287478 - (AUDCLNT_E_DEVICE_IN_USE).
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Sample Rate     : 44100
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Sample Format   : AE_FMT_S24NE4MSB
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Bits Per Sample : 32
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Valid Bits/Samp : 24
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Channel Count   : 6
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Block Align     : 24
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Avg. Bytes Sec  : 1058400
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Samples/Block   : 24
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Format cBSize   : 22
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Channel Layout  : FL, FR, FC, LFE, BL, BR
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Enc. Channels   : 6
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Enc. Samples/Sec: 44100
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Channel Mask    : 63
2021-11-24 18:25:12.225 T:4548    DEBUG <general>: Thread Terminating with Exception: invalid type specifier
2021-11-24 18:25:12.226 T:6136    DEBUG <general>: CDVDVideoCodecFFmpeg - Updated codec: ff-h264
2021-11-24 18:25:12.227 T:6136    DEBUG <general>: CVideoPlayerVideo::OpenStream - open stream with codec id: 27
2021-11-24 18:25:12.227 T:6136     INFO <general>: Creating video thread
2021-11-24 18:25:12.227 T:5928    DEBUG <general>: Thread VideoPlayerVideo start, auto delete: false
2021-11-24 18:25:12.227 T:5928     INFO <general>: running thread: video_thread
Reply
#13
HDMI requires that EAC3 packet be combine to a total of 1536 Samples Per Frame. Source media can be 256, 512, 768 or 1536 SPF with 1536 SPF being by far the most common (Which requires no packet combining at all). The sample I provided is the most extreme 256SPF case so 6 audio samples from the source file need to be combined into one HDMI audio packet.

My current thinking is the existing mechanism to combine these packets is being done in the wrong place, if we combine the DD+ frames much nearer to FFMPEG then we wont generate blank audio frames. I dont understand the synching yet either but my thoughts are if the audio packets rate is decided with knowledge of the SPF it can be effectively set 6 times lower for 256SPF and then the timing problems will probably fix themselves. The other thing I don't quite understand is how you deal with the PTS offset when your combined HDMI audio frame is a combination of 6 audio frames from different PTS time stamps, do you use the timing of the first frame or the last frame?.
Reply
#14
(2021-11-25, 19:48)Boilerplate4U Wrote: This is what happens when WASAPI fails. I have seen this reported in the forum as: no sound and the video freezes after 8-10 seconds. I'll have a look at what has changed in the past when it comes to the sound layers/sinks, which can also be the reason why the empty sound frames are produced.

Btw, might be a bit late to ask but what is the main objective here, as in get rid of the blank audio frames, convert it to something else or?

log:
2021-11-24 18:25:12.167 T:4548    DEBUG <general>: CAESinkWASAPI::InitializeExclusive: IsFormatSupported failed (AUDCLNT_E_UNSUPPORTED_FORMAT) - trying to find a compatible format
2021-11-24 18:25:12.224 T:4548    ERROR <general>: CAESinkWASAPI::InitializeExclusive: Failed to initialize WASAPI in exclusive mode -2004287478 - (AUDCLNT_E_DEVICE_IN_USE).
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Sample Rate     : 44100
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Sample Format   : AE_FMT_S24NE4MSB
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Bits Per Sample : 32
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Valid Bits/Samp : 24
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Channel Count   : 6
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Block Align     : 24
2021-11-24 18:25:12.224 T:4548    DEBUG <general>:   Avg. Bytes Sec  : 1058400
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Samples/Block   : 24
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Format cBSize   : 22
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Channel Layout  : FL, FR, FC, LFE, BL, BR
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Enc. Channels   : 6
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Enc. Samples/Sec: 44100
2021-11-24 18:25:12.225 T:4548    DEBUG <general>:   Channel Mask    : 63
2021-11-24 18:25:12.225 T:4548    DEBUG <general>: Thread Terminating with Exception: invalid type specifier
2021-11-24 18:25:12.226 T:6136    DEBUG <general>: CDVDVideoCodecFFmpeg - Updated codec: ff-h264
2021-11-24 18:25:12.227 T:6136    DEBUG <general>: CVideoPlayerVideo::OpenStream - open stream with codec id: 27
2021-11-24 18:25:12.227 T:6136     INFO <general>: Creating video thread
2021-11-24 18:25:12.227 T:5928    DEBUG <general>: Thread VideoPlayerVideo start, auto delete: false
2021-11-24 18:25:12.227 T:5928     INFO <general>: running thread: video_thread

Is the source file actually 5.1 16/44 or 5.1 24/44? My receiver can play 5.1 24/44 PCM content but I'm not sure if support for that is universal.

Edit: Are any other audio apps or potential WASAPI audio applications running?
Reply
#15
(2021-11-25, 20:07)Krobar Wrote: HDMI requires that EAC3 packet be combine to a total of 1536 Samples Per Frame. Source media can be 256, 512, 768 or 1536 SPF with 1536 SPF being by far the most common (Which requires no packet combining at all). The sample I provided is the most extreme 256SPF case so 6 audio samples from the source file need to be combined into one HDMI audio packet.

My current thinking is the existing mechanism to combine these packets is being done in the wrong place, if we combine the DD+ frames much nearer to FFMPEG then we wont generate blank audio frames. I dont understand the synching yet either but my thoughts are if the audio packets rate is decided with knowledge of the SPF it can be effectively set 6 times lower for 256SPF and then the timing problems will probably fix themselves. The other thing I don't quite understand is how you deal with the PTS offset when your combined HDMI audio frame is a combination of 6 audio frames from different PTS time stamps, do you use the timing of the first frame or the last frame?.
 
Ok, thanks for a good explanation. I need to get into the details to be able to understand and put this into practice. In other words, it's now time to study the knowledge of audio technology at the advanced level and dig into the source code. 
 
Quote:Edit: Are any other audio apps or potential WASAPI audio applications running?

No, checked that several times. it's probably a bug when InitializeExclusive is called even though it's already been initialized. It needs to be released before calling it again. I'll look in to it later on.
Reply

Logout Mark Read Team Forum Stats Members Help
DVDAudioCodecPassthrough.cpp - Audio Frames to HDMI Audio Frame/Packet ratio0