Audio out of sync

Ok I have a very weird situation here.

I have been running LibEl on RPi3 and RPi4 for years and I’ve never seen anything like this. Recently I got a new 4k TV, an LG C9. I first tried on a Pi4, but it didn’t offer HDR support and it was somewhat slow.

I bought an Odroid N2, flashed CoreELEC on it, and confirmed it played 4K content with proper HDR output perfectly.

However, certain regular HD files (some mp4 files specifically) seem to play with the audio out of sync. Also, when using the Twitch app on Kodi, all streams play out of sync immediately. The weird part is that if I play the same files or streams on my pi4 connected to the same tv, they work perfectly. Moving the N2 to a different TV, the files also play perfectly. So some weird mix between the N2 and my TV seems to be causing certain files to play out of sync. I have tried changing all sorts of settings on the TV and within CoreELEC. One thing I did notice, was that turning off h264 acceleration seems to make the files more in sync, but still slightly off, though the video randomly gets choppy, as I guess this is caused from doing more software decoding?

Any help would be much appreciated!

Here is mediainfo output for a file that doesn’t play in sync:
General
Complete name : Z:\incoming\file.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/mp41)
File size : 4.12 GiB
Duration : 58 min 33 s
Overall bit rate mode : Variable
Overall bit rate : 10.1 Mb/s
Encoded date : UTC 2020-04-17 23:12:25
Tagged date : UTC 2020-04-17 23:48:36
TIM : 00:00:00:00
TSC : 60
TSZ : 1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L4.2
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Format settings, GOP                     : M=4, N=60
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 58 min 33 s
Bit rate                                 : 9 751 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 60.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.078
Stream size                              : 3.99 GiB (97%)
Language                                 : English
Encoded date                             : UTC 2020-04-17 23:12:26
Tagged date                              : UTC 2020-04-17 23:12:26
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 58 min 33 s
Source duration                          : 58 min 33 s
Bit rate mode                            : Variable
Bit rate                                 : 317 kb/s
Maximum bit rate                         : 336 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 133 MiB (3%)
Source stream size                       : 133 MiB (3%)
Language                                 : English
Encoded date                             : UTC 2020-04-17 23:12:26
Tagged date                              : UTC 2020-04-17 23:12:26

Did you do a clean install or have you done a backup/restore from the pi?

I did do a backup/restore from the pi. Do you think I should try a fresh install?

Yes, there are some settings that don’t play well with Amlogic hardware, and were removed from the UI, but they could still affect your system if restored from a previous install.

I will give that a shot and update the post, thank you!

I tried the twitch app after I saw your post on the HK forums last night and I have no issues with it, my guess is you have sync playback to display turned on or some other old setting is causing the issues your having.

Well I feel like a complete idiot. After factory resetting, I tried the app and problem files and they played back perfectly. I then went to change the resolution to 4k and it immediately hit me. I had the resolution set at 4096 x 2160 instead of 3840 x 2160. 4096 only allows a 24fps refresh which is what was causing the problems with 60fps files (and 60fps streams on twitch). Not sure why that resolution is even listed, as I can’t imagine many TV’s support it.

Luckily I had made a complete backup before resetting. I restored that, fixed the resolution, and all is well.

Thanks!