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

  • Libreelec master compiled with kodi 19 b1 / a3 same issue

    Is it still possible to download nightly versions from november so I can check at what point the audio gets broken?

    Edited once, last by A1RFORCE1 (January 5, 2021 at 9:17 PM).

  • 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.

  • Hi Hias,

    Yes this corrected the audio problem, SUPER!

    The master HD track seems to run smootly again

    True HD tracks have minor audio stutter

    But what's the fix in this version so I can add this in the nightly builds :)

    I will post a new debug log off the True HD movie ...

  • 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.

  • The fix in the testbuild is included in this PR: linux (RPi): update to 5.10.4 by HiassofT · Pull Request #4871 · LibreELEC/LibreELEC.tv · GitHub

    The problem is that H264 hardware decoding consumes quite a lot of RAM bandwidth and that results in HDMI audio FIFO underrun as audio DMA gets delayed because RAM is busy.

    The kernel patch included in the testbuild (and the PR) increases the memory bandwidth for audio DMA which helps a lot, but it looks like a bit more tweaking is needed.

    Unfortunately neither kodi nor kernel log will show anything if or when that happened.

    As a workaround you can also disable hardware decoding (in player->video settings), software-decoded H264 videos (which was the default in nighty builds until a few weeks ago) don't suffer from the audio dropout issue.

    so long,

    Hias

  • nicely found !! thanxz, looking forward to the further tweaks !

    I also noticed when DRM Prime decoding is enable the menu button overlay for the (normal) DVD menu's is not showing the highlight (but not with all dvd's)

    I modified the DVDVideoCodecDRMPRIME.cpp for test (kodi 18.9 was just fine)


    if (!(hints.codecOptions & CODEC_FORCE_SOFTWARE)){

    while ((codec = av_codec_iterate(&i)))

    {

    if (!av_codec_is_decoder(codec))

    continue;

    if (codec->id != hints.codec)

    continue;

    const AVCodecHWConfig* config = FindHWConfig(codec);

    if (config)

    return codec;

    }

    } else {

    if ( hints.codec == 2){

    CLog::Log(LOGINFO, "CDVDVideoCodecDRMPRIME::{} return nullptr for codec {}",__FUNCTION__, hints.codec);

    return nullptr;


    Now the menu is showing normal again...

  • Hi Hiassoft,

    Just played a couple of true HD audio movies !! This fix seems to decrease the number off glitches

    update:

    - Hmmm after +/- 16 min of movie again a little stutter but a lot less..

    - during the stutter the following entry appears in the logfile:

    - after 25 min off movie the frequency of stutter increases

    - restarted pi with debug log

    - resumed the movie at 25 min

    - now stutter begins after +/- 30 min .

    2021-01-06 21:46:18.619 T:973 ERROR <general>: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover

    2021-01-06 21:46:33.776 T:973 ERROR <general>: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover

    2021-01-06 21:46:48.763 T:973 ERROR <general>: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover

    2021-01-06 21:47:18.044 T:973 ERROR <general>: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover

    2021-01-06 22:22:00.867 T:1079 DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-10068.390007, adjusted:-10068.390007

    2021-01-06 22:23:21.364 T:1079 DEBUG <general>: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-10039.105164, adjusted:-10039.105164

    2021-01-06 22:24:26.566 T:975 ERROR <general>: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover


    Can I add the code above to the findcodec function to fix the dvd menu or will this break other codec functionality ?

    Kind regards,

    Ferry

    Edited 5 times, last by A1RFORCE1 (January 6, 2021 at 9:41 PM).

  • New debug log for this version:

    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.

  • From the log it seems you have "Adjust display refresh rate" set to off. Please make sure it's enabled ("On start/stop" is in general a good choice) and your display whitelist is setup properly.

    "snd_pcm_writei(-32) Broken pipe" means audio underrun which more likely is caused by A/V sync issues if the display is not running at the same refresh rate as the video.

    I can't comment on the dvd menu change, please open a separate thread (or issue on kodi github) about that.

    so long,

    Hias

  • changed it to "start/stop" Adjust display refresh rate still got the errors

    Changed it to "always" Adjust display refresh rate still got the errors

    Also I see an error regarding the readrate:

    Readrate 4814000 is too low with 5128350 required (on usb 3.0 disk)

    Edited once, last by A1RFORCE1 (January 7, 2021 at 1:35 PM).

  • Not really sure about the Readrate message - I've never seen that here. Might be worth to check journal/dmesg if there's some actual problem with the USB drive.

    BTW: When posting logs from the console please use the "pastekodi" script. This will also include journal/dmesg which can contain very important info. And also please don't use a mouse, that spams the kodi log with lots of useless pointer move messages and it's very hard to find the actually relevant information.

    so long,

    Hias