v18 PCM 3.0 Output from HDMI - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59) +---- Thread: v18 PCM 3.0 Output from HDMI (/showthread.php?tid=362238) |
PCM 3.0 Output from HDMI - Krobar - 2021-04-24 Has anyone successfully managed to output PCM 3.0 (FL / FR / C) from Kodi? My Arcam receiver plays it as stereo (So no speech) whilst my Marantz receiver does not detect the audio at all. Both receivers work correctly when using a Bluray player and the original disc but I'm not sure where the bug is (Could be the file, the Intel driver or Kodi) so would appreciate if some other people with a 5.1+ setup could try this sample: https://drive.google.com/file/d/1FBuIA0eUrJXwspsFMmxDc1DL9nbzrTiN/view?usp=sharing RE: PCM 3.0 Output from HDMI - FXB78 - 2021-04-24 (2021-04-24, 11:04)Krobar Wrote: Has anyone successfully managed to output PCM 3.0 (FL / FR / C) from Kodi?It doesn't play the Centre channel for me using S/PDIF, just plays FL & FR. Maybe if you post a Debug Log it might give the experts here more info. RE: PCM 3.0 Output from HDMI - black_eagle - 2021-04-25 I tried playing that file and my amp showed 2.1 so it was getting three channels, just the centre channel was in the LFE. Looking at the created log, Kodi appears to not be able to get the channel map details, despite FFmpeg reporting 3 channels to Kodi. Ultimately I ended up with a 4 channel output being opened. FFProbe and mediainfo both reported the three channel layout correctly. To me, that looks like it might be a bug but I don't know anything about audio so I could well be wrong. Our only audio dev is really busy with RL at the moment so even if it is, it could be a while before it gets fixed. Relevant audio part of log.
@fritsch If you have time, can you shed any light on this? RE: PCM 3.0 Output from HDMI - fritsch - 2021-05-01 SPDIF can only serve 2 PCM channels. So no matter what you open with ffmpeg, the result will be downmixed to FL, FR. The only way you can transfer more than 2 channels via SPDIF is using a virtual format like AC3. Are you sure you mean the SPDIF interface that you are using? RE: PCM 3.0 Output from HDMI - Krobar - 2021-05-02 (2021-05-01, 22:57)fritsch Wrote: SPDIF can only serve 2 PCM channels. So no matter what you open with ffmpeg, the result will be downmixed to FL, FR. The only way you can transfer more than 2 channels via SPDIF is using a virtual format like AC3.I'm using HDMI and as explained above both receivers I have play this PCM 3.0 (FL/FR/C) bluray disc over HDMI but Kodi does not work to play this file with either receiver. I tried to look into this today, I get the same layout contains 0 message as @black_eagle It seems that the channel layout is not being read/handled by Kodi/FFMPEG. I think the channel layout is supported by FFMPEG although the naming seems odd to me as it suggests both FL-FR-C and the old cinema FL-FR-MonoSurround format: https://github.com/FFmpeg/FFmpeg/blob/5541cffa17a8c45004e5ceeda52d4d6b2acee037/libavutil/channel_layout.h#L94 However for whatever reason the map is not read and the default 3 channel layout is used which seems to be the first 3 channel layout in the list below which is 2.1 - Stereo Plus LFE: https://github.com/FFmpeg/FFmpeg/blob/870bfe16a12bf09dca3a4ae27ef6f81a2de80c40/libavutil/channel_layout.c#L83 The file was made from the original media by MakeMKV. MakeMKV is using the "A_MS/ACM" codec ID instead of the more standard "A_PCM/INT/LIT" ID specifically because it wants to add the channel layout info with the WAVE_FORMAT_EXTENSIBLE header. @fritsch does Kodi support this audio format and the WAVE_FORMAT_EXTENSIBLE header? I will give FLAC a try for this audio track as it is lossless and supports the same channel mapping header. RE: PCM 3.0 Output from HDMI - black_eagle - 2021-05-02 @Krobar Can you test this build and see if it works for you? Best to install it in portable mode I should think. RE: PCM 3.0 Output from HDMI - Krobar - 2021-05-02 (2021-05-02, 19:29)black_eagle Wrote: @Krobar Can you test this build and see if it works for you? Best to install it in portable mode I should think. Thanks for the build. I had been running Kodi 18.9 MVC build, am on a VM with easy restore so did a full install. The behaviour with this build was different. Summary of how the different builds behaved for me below: 18.9 - Receiver display says stereo - Centre and hence speech completely missing Fallback To Hints Build - Receiver display says 4.0 (FL-FR-SL-SR) - Actually 5.0 (Could be FL-FR-C-Mono Surround) - Surrounds seem to play a copy of centre Bluray player with original disc - Correctly detected and plays as PCM 3.0 (FL-FR-C) It seems a 4.0 output was intended (Although as FL-FR-SBL-SBR): 2021-05-02 21:14:33.979 T:5748 DEBUG <general>: CActiveAESink::OpenSink - WASAPI Initialized: 2021-05-02 21:14:33.979 T:5748 DEBUG <general>: Output Device : default 2021-05-02 21:14:33.979 T:5748 DEBUG <general>: Sample Rate : 48000 2021-05-02 21:14:33.979 T:5748 DEBUG <general>: Sample Format : AE_FMT_S24NE4MSB 2021-05-02 21:14:33.979 T:5748 DEBUG <general>: Channel Count : 4 2021-05-02 21:14:33.979 T:5748 DEBUG <general>: Channel Layout: FL, FR, BL, BR 2021-05-02 21:14:33.979 T:5748 DEBUG <general>: Frames : 2400 2021-05-02 21:14:33.979 T:5748 DEBUG <general>: Frame Size : 16 The receiver I have does not seems to support that channel config so that might explain the weird output and detection as 4.0 (FL-FR-SL-SR). List of supported input channel configs (Some will likely be bitstream only): 0x00 – Dual Mono 0x01 – Centre only 0x02 – Stereo only 0x03 – Stereo + mono surround 0x04 – Stereo + Surround L & R 0x05 – Stereo + Surround L & R + mono Surround Back 0x06 – Stereo + Surround L & R + Surround Back L & R 0x07 – Stereo + Surround L & R containing matrix information for surround back L&R 0x08 – Stereo + Centre 0x09 – Stereo + Centre + mono surround 0x0A – Stereo + Centre + Surround L & R 0x0B – Stereo + Centre + Surround L & R + mono Surround Back 0x0C – Stereo + Centre + Surround L & R + Surround Back L & R 0x0D – Stereo + Centre + Surround L & R containing matrix information for surround back L&R 0x0E – Stereo Downmix Lt Rt 0x0F – Stereo Only (Lo Ro) 0x10 – Dual Mono + LFE 0x11 – Centre + LFE 0x12 – Stereo + LFE 0x13 – Stereo + single surround + LFE 0x14 – Stereo + Surround L & R + LFE 0x15 – Stereo + Surround L & R + mono Surround Back + LFE 0x16 – Stereo + Surround L & R + Surround Back L & R + LFE 0x17 – Stereo + Surround L & R + LFE 0x18 – Stereo + Centre + LFE containing matrix information for surround back L&R 0x19 – Stereo + Centre + single surround + LFE 0x1A – Stereo + Centre + Surround L & R + LFE (Standard 5.1) 0x1B – Stereo + Centre + Surround L & R + mono Surround Back + LFE (6.1, e.g. DTS ES Discrete) 0x1C – Stereo + Centre + Surround L & R + Surround Back L & R + LFE (7.1) 0x1D – Stereo + Centre + Surround L & R + LFE, containing matrix information for surround back L&R (6.1 e.g. Dolby Digital EX) 0x1E – Stereo Downmix (Lt Rt) + LFE 0x1F – Stereo Only (Lo Ro) + LFE RE: PCM 3.0 Output from HDMI - black_eagle - 2021-05-04 Hmmm, bit missing from that logging showing what Kodi requested to open. From my log.
You can see from that that Kodi requests the correct layout, gets back 4 channels from the OS (nothing is output to the UNKNOWN1 anyway) and my amp correctly shows PCM 3.0 Windows appears from your log to be returning the wrong channel map (assuming Kodi requested FL,FR,FC). Did Kodi indeed request the right channel map? RE: PCM 3.0 Output from HDMI - Krobar - 2021-05-04 (2021-05-04, 09:41)black_eagle Wrote: Hmmm, bit missing from that logging showing what Kodi requested to open.I get this bit of the log but none of the GetChannelLayout messages, do I need to enable additional logging? (I'm using WASAPI output) 2021-05-02 21:14:33.645 T:5640 DEBUG <general>: CVideoPlayer::HandleMessages - player 1 reported state: 0 2021-05-02 21:14:33.645 T:2032 INFO <general>: CDVDAudioCodecFFmpeg::GetChannelMap - FFmpeg reported 3 channels, but the layout contains 0 trying hints 2021-05-02 21:14:33.645 T:2032 INFO <general>: Creating audio stream (codec id: 65536, channels: 3, sample rate: 48000, no pass-through) 2021-05-02 21:14:33.645 T:2032 DEBUG <general>: CVideoPlayerAudio:: synctype set to 0: clock feedback RE: PCM 3.0 Output from HDMI - HomerJau - 2021-05-04 Most AVRs play 4 channel files as stereo. The workaround is to add one or two silent channels. Then Kodi/AVR see the files as 5.0 or 5.1 (5 and 6 channels respectively) and they play correctly. This will work for your 3.0 files. RE: PCM 3.0 Output from HDMI - HomerJau - 2021-05-04 To fix you can run this batch file in Windows (download Sox.exe from a web search: Code:
this adds 3 empty channels to all your FLAC files so they appear as 5.1 and play correctly RE: PCM 3.0 Output from HDMI - black_eagle - 2021-05-04 (2021-05-04, 09:49)Krobar Wrote: I get this bit of the log but none of the GetChannelLayout messages, do I need to enable additional logging? (I'm using WASAPI output) Might get a little more if you enable logging for the audio component. I would have though you should at least get something like WASAPI Exclusive Mode Sink Initialized using ... without that though.The WASAPI stuff seems to log less debug info but much more about errors if they occur. RE: PCM 3.0 Output from HDMI - Krobar - 2021-05-04 (2021-05-04, 10:28)HomerJau Wrote: Most AVRs play 4 channel files as stereo. The workaround is to add one or two silent channels. Then Kodi/AVR see the files as 5.0 or 5.1 (5 and 6 channels respectively) and they play correctly. This will work for your 3.0 files. Thanks for the tip but doing this will break up mixing pretty badly as adding silent channels is not ideal. My AVR does actually play Quad PCM fine from Kodi. I can play this PCM 3.0 from a Bluray player with the original disc too but not from Kodi. The build @black_eagle pointed me at seems to be making some progress in the right direction at least. RE: PCM 3.0 Output from HDMI - Krobar - 2021-05-04 (2021-05-04, 12:40)black_eagle Wrote:(2021-05-04, 09:49)Krobar Wrote: I get this bit of the log but none of the GetChannelLayout messages, do I need to enable additional logging? (I'm using WASAPI output) Here is the log (Have had to truncate it as most paste services wont take much bigger than 1MB it seems): https://controlc.com/2689d391 RE: PCM 3.0 Output from HDMI - black_eagle - 2021-05-05 Thanks. Two things there stood out to me. Firstly, HDMI - ARC AV AMP . Makes me wonder if you are connected PC-->TV-->AMP ? ARC has caused me issues in the past so if you have it enabled, maybe try without it and see if that makes a difference.Secondly, this bit is generic to all OS's and tells me that Kodi has seen the correct channel layout (we will have got it from the hint, which does contain the correct channel map).
But, when WASAPI returns the channel layout we can use it gives us this.
Does directsound do the same thing? I know that's not recommended for Win but might be worth a try. I can try and add some more logging to the wasapi stuff and get another test build which might show more clearly if indeed kodi requests the right layout and it's the win driver giving us the incorrect one back but this is shooting in the dark a little as I can't test it! |