Nightly builds Rpi4 Audio passthrough TrueHD/Master HD not working (huge stutter) anymore

  • lolek please post a full "pastekodi" log.

    I'm sorry I won't use the pastekodi to paste a full log because it may contain information that I don't want to share.

    Please let me know which part are you interested in and I'll be happy to do what I can to share that with you.

  • Kodi automatically redacts sensitive information (like username/passwords) in it's log so there's very low risk when uploading them to a paste site.

    You can also tell pastekodi to save the info to a file by using the "-c" option - eg pastekodi -c > my.log and then eg send it to me via email [email protected]

    so long,

    Hias

  • chook55 there's nothing suspicious in the logs you emailed me and I also couldn't reproduce the issue here.

    As I wrote before check your cabling - contact issues, bad cables / adapters are the number one cause of the issues you described. I'd recommend starting with a direct connection from your RPi to your TV, try also a different, known good HDMI cable, leaving the argon case and HDMI splitter out of the chain - they are all potential sources of issues.

    so long,

    Hias

  • Some extra testing observations:

    -Films with Dolby True HD the sound stutters every once in a while (Doesn't happen with DTS-MA) Once I catch this in the log, I'll post a copy here

    -Even with the 'Allow renaming and deletion' option set to on, the delete and rename options don't appear in the context menu. I can delete/rename files in the file manager however.

  • chook55 there's nothing suspicious in the logs you emailed me and I also couldn't reproduce the issue here.

    As I wrote before check your cabling - contact issues, bad cables / adapters are the number one cause of the issues you described. I'd recommend starting with a direct connection from your RPi to your TV, try also a different, known good HDMI cable, leaving the argon case and HDMI splitter out of the chain - they are all potential sources of issues.

    so long,

    Hias

    Noted.

    cheers

    Chook

    Update: I found a problem in my rig. There is a small power jack and cable that powers the Targus USB Hub. It could be that this was not firmly in the socket and could be losing power intermittently. Its not a tight fit so now I've secured it with a rubber band. The only device in the hub is the 3.5" HDD. Ill check tomorrow to see if this indeed was the problem. How annoying.

    Info: I just tested LibreElec nightly 20210224 at 4k 30Hz and blanking occurred while viewing a 4K video (same one). Its not occuring at Full HD resolution. So It was not the power to the hub that was causing the issue. I'll reconfigure and do testing next opportunity.

    Edited 2 times, last by chook55: Info (February 25, 2021 at 9:37 AM).

  • lolek thanks, got your mails, I'm answering here so other users can follow, too:

    The buffer underruns ("snd_pcm_writei(-32) Broken pipe" lines in kodi log) are most certainly caused by kod not being able to sustain the data rate of the file.

    Kodi requests 200ms audio buffers, but can only get a ~86ms one due to the current defaults in the vc4 driver. As you play the files from local media this means kodi won't use a read buffer/cache, so if the read rate from the drive drops (eg due to seeking etc) you have a higher chance of getting underruns.

    Please do the following tests on the current nightly builds:

    First try if increasing the audio buffer size helps:

    Code
    systemctl stop kodi
    echo 2048 > /proc/asound/vc4hdmi0/pcm0p/sub0/prealloc
    systemctl start kodi

    When playing a HD audio file kodi log should now indicate that it could use a 200ms buffer (the "setting timeout..." line)

    Code
    2021-02-25 15:28:49.606 T:941     DEBUG <general>: CAESinkALSA::InitializeHW - Request: periodSize 9600, bufferSize 38400
    2021-02-25 15:28:49.610 T:941     DEBUG <general>: CAESinkALSA::InitializeHW - Got: periodSize 9600, bufferSize 38400
    2021-02-25 15:28:49.610 T:941     DEBUG <general>: CAESinkALSA::InitializeHW - Setting timeout to 200 ms

    Then try with an advancedsettings.xml file, setting buffermode to 1 (so local files use kodi's cache, too) .

    /storage/.kodi/userdata/advancedsettings.xml:

    Code
    <advancedsettings version="1.0">
      <cache>
        <buffermode>1</buffermode>
      </cache>
    </advancedsettings>

    Reboot, so the audio buffer size change is restored back to the default and advancedsettings change take effect and test again.

    It could also be that both audio buffer size increase and local buffering are required.

    Please let us know which variants work and send me pastekodi logs of the cases where you got audio dropouts / underruns. I'm also still interested in a pastekodi log of a dropout with plain nightly build, wiithout any of the above mentioned changes.

    so long,

    Hias

  • Did a test with nightly-e12ff43 , blueray 7.1

    losing audio completely with errors:

    2021-02-26 20:46:52.957 T:955 WARNING <general>: ActiveAE - large audio sync error: -1050.441136

    2021-02-26 20:46:52.984 T:955 WARNING <general>: ActiveAE - large audio sync error: -1050.454576

    2021-02-26 20:46:52.986 T:955 WARNING <general>: ActiveAE - large audio sync error: -1050.454761

    Edited once, last by A1RFORCE1: also more video stutter appearing with message : 021-02-26 20:57:26.152 T:1088 WARNING <general>: OutputPicture - timeout waiting for buffer 2021-02-26 20:57:37.164 T:1088 INFO <general>: Skipped 4 duplicate messages.. 2021-02-26 20:57:37.164 T:1088 WARNING <general>: OutputPicture - timeout waiting for buffer (February 26, 2021 at 7:57 PM).

  • A1RFORCE1 please post full pastekodi debug logs -snippets are completely useless and the warnings you posted are rather harmless.

    so long,

    Hias

    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • video and audio stutter:

    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • lolek FYI: today's nightly build LibreELEC-RPi4.arm-9.80-nightly-20210226-e12ff43.tar includes the ALSA buffer size change mentioned above.

    Please give that a try, if you still get drop-outs and buffer underrun entries in kodi log test with buffermode 1.

    so long,

    Hias

    I have updated to LibreELEC-RPi4.arm-9.80-nightly-20210226-e12ff43.tar. I'm running at 1080P screen setting. I have 5.1 audio channels with pass-through enabled but not encoding which works on 2.0 channel setting only. . All the Dolby samples work as they should even HD audio. However there is one that did work a month ago but no longer plays sound through my TV or Amp. I've posted the media-info data here.

    General

    Unique ID : 189688238917226230182892306850293502700 (0x8EB4A03DCAD84192A6F0AD43F93C52EC)

    Complete name : D:\Music\THX\DATASAT_51_71_DTS-HD_MA-thedigitaltheater.mkv

    Format : Matroska

    Format version : Version 4

    File size : 241 MiB

    Duration : 51 s 35 ms

    Overall bit rate mode : Variable

    Overall bit rate : 39.5 Mb/s

    Encoded date : UTC 2015-10-19 22:12:49

    Writing application : mkvmerge v8.3.0 ('Over the Horizon') 64bit

    Writing library : libebml v1.3.1 + libmatroska v1.4.2

    Video

    ID : 1

    Format : AVC

    Format/Info : Advanced Video Codec

    Format profile : [email protected]

    Format settings : CABAC / 2 Ref Frames

    Format settings, CABAC : Yes

    Format settings, Reference fra : 2 frames

    Codec ID : V_MPEG4/ISO/AVC

    Duration : 48 s 382 ms

    Bit rate mode : Variable

    Bit rate : 28.8 Mb/s

    Width : 1 920 pixels

    Height : 1 080 pixels

    Display aspect ratio : 16:9

    Frame rate mode : Constant

    Frame rate : 23.976 (24000/1001) FPS

    Color space : YUV

    Chroma subsampling : 4:2:0

    Bit depth : 8 bits

    Scan type : Progressive

    Bits/(Pixel*Frame) : 0.578

    Stream size : 166 MiB (69%)

    Default : Yes

    Forced : No

    Audio #1

    ID : 2

    Format : DTS XLL

    Format/Info : Digital Theater Systems

    Commercial name : DTS-HD Master Audio

    Codec ID : A_DTS

    Duration : 50 s 998 ms

    Bit rate mode : Variable

    Bit rate : 4 431 kb/s

    Channel(s) : 6 channels

    Channel layout : C L R Ls Rs LFE

    Sampling rate : 48.0 kHz

    Frame rate : 93.750 FPS (512 SPF)

    Bit depth : 24 bits

    Compression mode : Lossless

    Stream size : 26.9 MiB (11%)

    Default : Yes

    Forced : No

    Audio #2

    ID : 3

    Format : DTS XLL

    Format/Info : Digital Theater Systems

    Commercial name : DTS-HD Master Audio

    Codec ID : A_DTS

    Duration : 50 s 998 ms

    Bit rate mode : Variable

    Bit rate : 5 538 kb/s

    Channel(s) : 8 channels

    Channel layout : C L R LFE Lb Rb Lss Rss

    Sampling rate : 48.0 kHz

    Frame rate : 93.750 FPS (512 SPF)

    Bit depth : 24 bits

    Compression mode : Lossless

    Stream size : 33.7 MiB (14%)

    Default : No

    Forced : No

    Audio #3

    ID : 4

    Format : PCM

    Format settings : Big / Signed

    Codec ID : A_PCM/INT/BIG

    Duration : 51 s 35 ms

    Bit rate mode : Constant

    Bit rate : 2 304 kb/s

    Channel(s) : 2 channels

    Sampling rate : 48.0 kHz

    Frame rate : 200.000 FPS (240 SPF)

    Bit depth : 24 bits

    Stream size : 14.0 MiB (6%)

    Default : No

    Forced : No

    Here are a score or so of lines from the 01_Kodi.log I recorded just now.

    Music/Music/THX/DATASAT_51_71_DTS-HD_MA-thedigitaltheater.mkv

    2021-02-27 12:41:24.439 T:1911 INFO <general>: Creating InputStream

    2021-02-27 12:41:24.473 T:1911 INFO <general>: Creating Demuxer

    2021-02-27 12:41:24.577 T:1911 INFO <general>: Opening stream: 0 source: 256

    2021-02-27 12:41:24.577 T:1911 INFO <general>: [WHITELIST] Searching the whitelist for: width: 1920, height: 1080, fps: 23.976, 3D: false

    2021-02-27 12:41:24.578 T:1911 INFO <general>: Display resolution ADJUST : 1920x1080 @ 23.976025 Hz (40) (w e i g h t: 0.000)

    2021-02-27 12:41:24.652 T:989 INFO <general>: VideoPlayer: OnLostDisplay received

    2021-02-27 12:41:24.652 T:989 WARNING <general>: CDVDMessageQueue(audio)::Put MSGQ_NOT_INITIALIZED

    2021-02-27 12:41:24.652 T:989 WARNING <general>: CDVDMessageQueue(video)::Put MSGQ_NOT_INITIALIZED

    2021-02-27 12:41:24.652 T:989 INFO <general>: GLES: Maximum texture width: 4096

    2021-02-27 12:41:24.686 T:1911 INFO <general>: Creating video codec with codec id: 27

    2021-02-27 12:41:24.686 T:1911 INFO <general>: CDVDVideoCodecDRMPRIME::Open - using decoder V4L2 mem2mem H.264 decoder wrapper

    2021-02-27 12:41:24.701 T:1911 INFO <general>: Creating video thread

    2021-02-27 12:41:24.701 T:1912 INFO <general>: running thread: video_thread

    2021-02-27 12:41:24.701 T:1911 INFO <general>: Opening stream: 1 source: 256

    2021-02-27 12:41:24.701 T:1911 INFO <general>: Finding audio codec for: 86020

    2021-02-27 12:41:24.702 T:1911 INFO <general>: Creating audio thread

    2021-02-27 12:41:24.702 T:1913 INFO <general>: running thread: CVideoPlayerAudio::Process()

    2021-02-27 12:41:24.766 T:989 INFO <general>: VideoPlayer: OnResetDisplay received

    2021-02-27 12:41:24.807 T:1913 INFO <general>: CAEStreamParser::SyncDTS - dtsHD MA stream detected (8 channels, 48000Hz, 16bit BE, period: 8192, syncword: 0x41a29547, target rate: 0x18, framesize 2080))

    2021-02-27 12:41:24.807 T:1913 INFO <general>: Creating audio stream (codec id: 86020, channels: 8, sample rate: 48000, pass-through)

    2021-02-27 12:41:24.835 T:1004 INFO <general>: CActiveAESink::OpenSink - initialize sink

    2021-02-27 12:41:25.036 T:1004 INFO <general>: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=vc4hdmi0,DEV=0"

    2021-02-27 12:41:25.042 T:1004 INFO <general>: CAESinkALSA::Initialize - Opened device "hdmi:CARD=vc4hdmi0,DEV=0,AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x09"

    2021-02-27 12:41:25.043 T:1004 INFO <general>: CAESinkALSA::InitializeHW - Unable to open the required number of channels

    2021-02-27 12:41:25.046 T:1004 INFO <general>: CAESinkALSA::Initialize - could not open required number of channels

    2021-02-27 12:41:25.049 T:1004 INFO <general>: CAESinkALSA::Initialize - Attempting to open device "default"

    2021-02-27 12:41:25.056 T:1004 INFO <general>: CAESinkALSA - Unable to open device "default:AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x09" for playback

    2021-02-27 12:41:25.058 T:1004 INFO <general>: CAESinkALSA::Initialize - Opened device "default"

    2021-02-27 12:41:25.060 T:1004 INFO <general>: CAESinkALSA::InitializeHW - Unable to open the required number of channels

    2021-02-27 12:41:25.069 T:1004 INFO <general>: CAESinkALSA::Initialize - could not open required number of channels

    2021-02-27 12:41:25.070 T:1004 ERROR <general>: CActiveAESink::OpenSink - no sink was returned

    2021-02-27 12:41:25.070 T:1003 ERROR <general>: ActiveAE::InitSink - returned error

    2021-02-27 12:41:25.071 T:1003 WARNING <general>: CActiveAE::StateMachine - signal: 11 from port: OutputControlPort not handled for state: 2

    2021-02-27 12:41:25.071 T:1003 WARNING <general>: CActiveAE::StateMachine - signal: 12 from port: OutputControlPort not handled for state: 2

    2021-02-27 12:41:25.577 T:1913 ERROR <general>: CAEStreamInfo::GetDuration - invalid stream type

    2021-02-27 12:41:25.602 T:989 INFO <general>: Skipped 1048 duplicate messages..

    2021-02-27 12:41:25.602 T:989 INFO <general>: [WHITELIST] Searching the whitelist for: width: 1920, height: 1080, fps: 23.976, 3D: false

    2021-02-27 12:41:25.602 T:1003 ERROR <general>: CAEStreamInfo::GetDuration - invalid stream type

    2021-02-27 12:41:25.603 T:989 INFO <general>: Skipped 15 duplicate messages..

    2021-02-27 12:41:25.603 T:989 INFO <general>: Display resolution ADJUST : 1920x1080 @ 23.976025 Hz (40) (w e i g h t: -0.000)

    2021-02-27 12:41:25.603 T:1003 ERROR <general>: CAEStreamInfo::GetDuration - invalid stream type

    2021-02-27 12:41:25.728 T:1003 INFO <general>: Skipped 3914 duplicate messages..

    2021-02-27 12:41:25.728 T:1003 WARNING <general>: ActiveAE - large audio sync error: 5007.251593

    2021-02-27 12:41:25.729 T:1003 ERROR <general>: CAEStreamInfo::GetDuration - invalid stream type

    2021-02-27 12:41:25.729 T:1003 INFO <general>: Skipped 1 duplicate messages..

    2021-02-27 12:41:25.729 T:1003 WARNING <general>: ActiveAE - large audio sync error: 5016.844500

    2021-02-27 12:41:25.729 T:1003 ERROR <general>: CAEStreamInfo::GetDuration - invalid stream type

    2021-02-27 12:41:25.729 T:1003 INFO <general>: Skipped 1 duplicate messages.. etc etc.

    The source has 8 channels I have 6.

    Good luck and thanks.