Freeze when playing large FLAC file

Hi everyone!

I recently came across an issue when playing large FLAC files (>40 MB) from a remote location (VPN). As can be seen from the logs below, when I hit play, Kodi freezes for about 30 seconds, then shows the loading spinner and eventually plays the file. The corresponding section from the log is this:

2022-10-29 09:53:43.611 T:3007    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:53:43.619 T:3007    DEBUG <general>: Skipped 1 duplicate messages..
2022-10-29 09:53:43.619 T:3007    DEBUG <general>: GetSongsByWhereJSON query: SELECT song.idSong, strTitle FROM song  ORDER BY song.idSong LIMIT 1
2022-10-29 09:53:43.620 T:3007    DEBUG <general>: GetSongsByWhereJSON - query took 0 ms
2022-10-29 09:53:43.629 T:3007    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:53:54.638 T:3007    DEBUG <CWebserver[10085]>: Skipped 24 duplicate messages..
2022-10-29 09:53:54.638 T:3007    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:54:05.373 T:3007    DEBUG <CWebserver[10085]>: Skipped 27 duplicate messages..
2022-10-29 09:54:05.373 T:3007    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: Skipped 6 duplicate messages..
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerCoreFactory::GetPlayers(musicdb://songs/7000.flac)
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: system rules
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: matches rule: system rules
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: mms/udp
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: streams
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: dvd
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: discimage
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: nsv
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerSelectionRule::GetPlayers: considering rule: radio
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerCoreFactory::GetPlayers: adding audiodefaultplayer (PAPlayer)
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerCoreFactory::GetPlayers: for video=0, audio=1
2022-10-29 09:54:07.467 T:2891    DEBUG <general>: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
2022-10-29 09:54:07.468 T:2891    DEBUG <general>: CPlayerCoreFactory::GetPlayers: adding player: VideoPlayer
2022-10-29 09:54:07.468 T:2891    DEBUG <general>: CPlayerCoreFactory::GetPlayers: added 2 players
2022-10-29 09:54:07.468 T:3142    DEBUG <general>: Thread JobWorker start, auto delete: true
2022-10-29 09:54:07.469 T:3143    DEBUG <general>: Thread PAPlayer start, auto delete: false
2022-10-29 09:54:07.469 T:2891    DEBUG <general>: OnPlayBackStarted: CApplication::OnPlayBackStarted
2022-10-29 09:54:07.469 T:3143    DEBUG <general>: PAPlayer::Process - Playback started
2022-10-29 09:54:07.485 T:2891    DEBUG <general>: CMusicGUIInfo::InitCurrentItem(musicdb://songs/7000.flac)
2022-10-29 09:54:07.530 T:2891    DEBUG <general>: SELECT albumview.*,albumartistview.*  FROM albumview  JOIN albumartistview ON albumview.idAlbum = albumartistview.idAlbum  WHERE albumview.idAlbum = 513  ORDER BY albumartistview.iOrder
2022-10-29 09:54:07.541 T:2891    DEBUG <general>: Loading additional tag info for file smb://device/yyy.flac
2022-10-29 09:54:08.398 T:3142    DEBUG <general>: CSMBFile::Open - opened smb://device/yyy.flac, fd=10000
2022-10-29 09:54:08.441 T:3007    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:54:08.472 T:2891    DEBUG <general>: Skipped 4 duplicate messages..
2022-10-29 09:54:08.472 T:2891    DEBUG <general>: CSMBFile::Open - opened smb://device/yyy.flac, fd=10001
2022-10-29 09:54:08.500 T:3007    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:54:08.824 T:3142    DEBUG <general>: Open - probing detected format [flac]
2022-10-29 09:54:13.596 T:3008    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:54:23.612 T:3156    DEBUG <CWebserver[10085]>: Skipped 10 duplicate messages..
2022-10-29 09:54:23.612 T:3156    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:54:33.627 T:3165    DEBUG <CWebserver[10085]>: Skipped 10 duplicate messages..
2022-10-29 09:54:33.627 T:3165    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:54:47.071 T:2891    DEBUG <general>: Skipped 4 duplicate messages..
2022-10-29 09:54:47.071 T:2891    DEBUG <general>: unrecognized XipComment name: ACOUSTID_ID
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: ASIN
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: BARCODE
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: CATALOGNUMBER
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: DISCTOTAL
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: ISRC
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: MEDIA
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: MUSICBRAINZ_RELEASETRACKID
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: RELEASECOUNTRY
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: SCRIPT
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: TOTALDISCS
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: TOTALTRACKS
2022-10-29 09:54:47.072 T:2891    DEBUG <general>: unrecognized XipComment name: TRACKTOTAL
2022-10-29 09:54:47.075 T:2891    DEBUG <general>: CSMBFile::Close closing fd 10001
2022-10-29 09:54:47.318 T:2891    DEBUG <general>: CPlayerGUIInfo::InitCurrentItem(musicdb://songs/7000.flac)
2022-10-29 09:54:47.418 T:2891    DEBUG <general>: ------ Window Init (DialogBusy.xml) ------
2022-10-29 09:54:47.426 T:3181    DEBUG <general>: Thread JobWorker start, auto delete: true
2022-10-29 09:54:47.442 T:3181    DEBUG <general>: ffmpeg[0xafb2dde0X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:47.452 T:3181    DEBUG <general>: ffmpeg[0xafb2dde0X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:54:47.502 T:2891    DEBUG <general>: CDirectoryProvider[special://skin/extras/playlists/movies_random.xsp]: refreshing..
2022-10-29 09:54:47.503 T:2891    DEBUG <general>: CDirectoryProvider[special://skin/extras/playlists/tvshows_random.xsp]: refreshing..
2022-10-29 09:54:47.504 T:3182    DEBUG <general>: Thread JobWorker start, auto delete: true
2022-10-29 09:54:47.505 T:2891    DEBUG <general>: CDirectoryProvider[special://skin/extras/playlists/albums_random.xsp]: refreshing..
2022-10-29 09:54:47.506 T:2891    DEBUG <general>: CDirectoryProvider[addons://sources/game/]: refreshing..
2022-10-29 09:54:47.506 T:2891    DEBUG <general>: CDirectoryProvider[addons://sources/executable]: refreshing..
2022-10-29 09:54:47.507 T:2891    DEBUG <general>: CDirectoryProvider[pvr://channels/tv/*/]: refreshing..
2022-10-29 09:54:47.507 T:2891    DEBUG <general>: CDirectoryProvider[pvr://channels/radio/*/]: refreshing..
2022-10-29 09:54:48.393 T:3176    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:54:48.456 T:3176    DEBUG <general>: Skipped 2 duplicate messages..
2022-10-29 09:54:48.456 T:3176    DEBUG <general>: GetSongsByWhereJSON query: SELECT song.idSong, strTitle FROM song  ORDER BY song.idSong LIMIT 1
2022-10-29 09:54:48.457 T:3176    DEBUG <general>: GetSongsByWhereJSON - query took 0 ms
2022-10-29 09:54:48.458 T:3183    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:54:48.644 T:3142    DEBUG <general>: Open - avformat_find_stream_info starting
2022-10-29 09:54:48.655 T:3142    DEBUG <general>: ffmpeg[0xafa44a60X]: [flac] Could not find codec parameters for stream 1 (Video: png, none(pc), 3000x3000): unspecified pixel format
2022-10-29 09:54:48.655 T:3142    DEBUG <general>: ffmpeg[0xafa44a60X]: [flac] Consider increasing the value for the 'analyzeduration' and 'probesize' options
2022-10-29 09:54:48.655 T:3142    DEBUG <general>: Open - av_find_stream_info finished
2022-10-29 09:54:48.656 T:3142    DEBUG <general>: CDVDDemuxFFmpeg::AddStream ID: 0
2022-10-29 09:54:48.656 T:3142    DEBUG <general>: CDVDDemuxFFmpeg::AddStream ID: 1
2022-10-29 09:54:48.657 T:3142     INFO <general>: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder flac
2022-10-29 09:54:48.784 T:3142    DEBUG <general>: CSMBFile::Open - opened smb://device/yyy.flac, fd=10001
2022-10-29 09:54:49.847 T:3184    DEBUG <general>: Thread JobWorker start, auto delete: true
2022-10-29 09:54:49.848 T:3181    DEBUG <general>: GetAlbumsByWhere query: SELECT albumview.* FROM albumview  WHERE albumview.strReleaseType = 'album' ORDER BY RANDOM()
2022-10-29 09:54:49.852 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:49.863 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:54:49.875 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:49.887 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:54:49.895 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:49.900 T:3181    DEBUG <general>: GetAlbumsByWhere: Time to fill list with albums 53ms query took 23ms
2022-10-29 09:54:49.923 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:49.934 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:54:50.015 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:50.024 T:3181    DEBUG <general>: ffmpeg[0xafb2dde0X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:50.026 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:54:50.034 T:3181    DEBUG <general>: ffmpeg[0xafb2dde0X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:54:50.038 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:50.051 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:54:54.740 T:3181    DEBUG <general>: ffmpeg[0xafb2dde0X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:54.750 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:54.751 T:3181    DEBUG <general>: ffmpeg[0xafb2dde0X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:54:54.760 T:3184    DEBUG <general>: ffmpeg[0xd97be498X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:54:54.765 T:3182    DEBUG <general>: ffmpeg[0xaf9f6038X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
2022-10-29 09:54:54.774 T:3182    DEBUG <general>: ffmpeg[0xaf9f6038X]: [swscaler] No accelerated colorspace conversion found from yuv420p to bgra.
2022-10-29 09:55:04.278 T:3176    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:55:09.342 T:3142    DEBUG <general>: Skipped 24 duplicate messages..
2022-10-29 09:55:09.342 T:3142    DEBUG <general>: unrecognized XipComment name: ACOUSTID_ID
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: ASIN
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: BARCODE
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: CATALOGNUMBER
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: DISCTOTAL
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: ISRC
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: MEDIA
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: MUSICBRAINZ_RELEASETRACKID
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: RELEASECOUNTRY
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: SCRIPT
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: TOTALDISCS
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: TOTALTRACKS
2022-10-29 09:55:09.343 T:3142    DEBUG <general>: unrecognized XipComment name: TRACKTOTAL
2022-10-29 09:55:09.347 T:3142    DEBUG <general>: CSMBFile::Close closing fd 10001
2022-10-29 09:55:09.586 T:3142    ERROR <general>: ffmpeg[0xafa44a60X]: [flac] invalid sync code
2022-10-29 09:55:09.586 T:3142    ERROR <general>: ffmpeg[0xafa44a60X]: [flac] invalid frame header
2022-10-29 09:55:09.586 T:3142    ERROR <general>: ffmpeg[0xafa44a60X]: [flac] decode_frame() failed
2022-10-29 09:55:10.367 T:3142    DEBUG <general>: SeekTime - seek ended up on time 0.000
2022-10-29 09:55:10.491 T:3142    ERROR <general>: Skipped 1 duplicate messages..
2022-10-29 09:55:10.491 T:3142    ERROR <general>: ffmpeg[0xafa44a60X]: [flac] invalid sync code
2022-10-29 09:55:10.491 T:3142    ERROR <general>: ffmpeg[0xafa44a60X]: [flac] invalid frame header
2022-10-29 09:55:10.491 T:3142    ERROR <general>: ffmpeg[0xafa44a60X]: [flac] decode_frame() failed
2022-10-29 09:55:10.756 T:3142     INFO <general>: AudioDecoder: File is queued
2022-10-29 09:55:10.758 T:3142    DEBUG <general>: AudioDecoder::GetReplayGain - Final Replaygain applied: 1.000000, Track/Album Gain 89.000000, Peak 1.000000
2022-10-29 09:55:10.758 T:2942    DEBUG <general>: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
2022-10-29 09:55:10.760 T:3195    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:55:10.768 T:3142     INFO <general>: PAPlayer::PrepareStream - Ready
2022-10-29 09:55:10.770 T:3195    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:55:10.776 T:3143    DEBUG <general>: OnAVStarted: CApplication::OnAVStarted
2022-10-29 09:55:10.776 T:2943     INFO <general>: CActiveAESink::OpenSink - initialize sink
2022-10-29 09:55:10.777 T:2943    DEBUG <general>: CActiveAESink::OpenSink - trying to open device ALSA:default
2022-10-29 09:55:10.777 T:2943     INFO <general>: CAESinkALSA::Initialize - Requested layout: FL, FR
2022-10-29 09:55:10.777 T:2943     INFO <general>: CAESinkALSA::Initialize - set digital_codec 0
2022-10-29 09:55:10.777 T:2943    DEBUG <general>: CAESinkALSA::Initialize -- unmuting HDMI
2022-10-29 09:55:10.777 T:2943     INFO <general>: CAESinkALSA::Initialize - Attempting to open device "default"
2022-10-29 09:55:10.781 T:3195    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:55:10.784 T:2943     INFO <general>: CAESinkALSA::Initialize - Opened device "default"
2022-10-29 09:55:10.785 T:2943     INFO <general>: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2022-10-29 09:55:10.785 T:2943     INFO <general>: CAESinkALSA::InitializeHW - Using data format AE_FMT_S24NE4
2022-10-29 09:55:10.785 T:2943    DEBUG <general>: CAESinkALSA::InitializeHW - Request: periodSize 2048, bufferSize 8192
2022-10-29 09:55:10.788 T:2943    DEBUG <general>: CAESinkALSA::InitializeHW - Got: periodSize 2048, bufferSize 8192
2022-10-29 09:55:10.789 T:2943    DEBUG <general>: CAESinkALSA::InitializeHW - Setting timeout to 186 ms
2022-10-29 09:55:10.789 T:2943     INFO <general>: CAESinkALSA::Initialize - speaker layout 0
2022-10-29 09:55:10.790 T:2943    DEBUG <general>: CAESinkALSA::GetChannelLayout - Input Channel Count: 2 Output Channel Count: 2
2022-10-29 09:55:10.790 T:3195    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:55:10.790 T:2943    DEBUG <general>: CAESinkALSA::GetChannelLayout - Requested Layout: FL, FR
2022-10-29 09:55:10.790 T:2943    DEBUG <general>: CAESinkALSA::GetChannelLayout - Got Layout: FL, FR (ALSA: none) (CEA: 0)
2022-10-29 09:55:10.790 T:2943    DEBUG <general>: CActiveAESink::OpenSink - ALSA Initialized:
2022-10-29 09:55:10.790 T:2943    DEBUG <general>:   Output Device : Default (AML-MESONAUDIO: HDMI, S/PDIF & analogue)
2022-10-29 09:55:10.791 T:2943    DEBUG <general>:   Sample Rate   : 44100
2022-10-29 09:55:10.791 T:2943    DEBUG <general>:   Sample Format : AE_FMT_S24NE4
2022-10-29 09:55:10.791 T:2943    DEBUG <general>:   Channel Count : 2
2022-10-29 09:55:10.791 T:2943    DEBUG <general>:   Channel Layout: FL, FR
2022-10-29 09:55:10.791 T:2943    DEBUG <general>:   Frames        : 2048
2022-10-29 09:55:10.791 T:2943    DEBUG <general>:   Frame Size    : 8
2022-10-29 09:55:10.799 T:3195    DEBUG <CWebserver[10085]>: request received for /jsonrpc
2022-10-29 09:55:10.810 T:2891    DEBUG <general>: ------ Window Deinit (DialogBusy.xml) ------

This is some information about the FLAC file from MediaInfo:

General
Format: FLAC
Format/Info: Free Lossless Audio Codec
File size: 65.4 MiB
Duration: 8 min 55 s
Overall bit rate mode: Variable
Overall bit rate: 1 023 kb/s

Audio
Format: FLAC
Format/Info: Free Lossless Audio Codec
Duration: 8 min 55 s
Bit rate mode: Variable
Bit rate: 826 kb/s
Channel(s): 2 channels
Channel layout: L R
Sampling rate: 44.1 kHz
Bit depth: 16 bits
Compression mode: Lossless
Stream size: 52.8 MiB (81%)
Writing library: libFLAC 1.3.2 (UTC 2019-08-04)

Since I’m playing media from a remote VPN location (handled by my router), I had to adjust buffering to account for an occasionally unstable connection:

====================== advancedsettings.xml =================== C7hKmH1p
<?xml version="1.0" encoding="utf-8"?>
<advancedsettings>
	<cache>
		<buffermode>1</buffermode>
		<memorysize>300000000</memorysize>
		<readfactor>10</readfactor>
	</cache>
</advancedsettings>
---------------------- advancedsettings.xml END --------------- C7hKmH1p

These settings work very well for movies, but I tried playing around with them too (even completely disabling the cache) and this does not seem to affect playing music that much. What makes me wonder though, is the fact, that when streaming Music via Chorus, it only takes about 8 seconds to start playback of the same file (which is normal, I guess, considering the available bandwidth I have).

One further note: During the time Kodi is freezing SSH access is still possible and I see OSMC caching the file when monitoring the network via my router. But sometimes I saw Kodi even crashing, but that might have been caused by me trying to give too many commands during the freeze period.

The whole (sanitized) log is provided here: https://paste.osmc.tv/odasubajib

Thanks for any help and hints,
Chris

Can you try playing the file from local storage?

Sam

Yep, already gave that a try…no problems there…

Do you think this might be related to Kodi’s SMB client? With some effort I could set something up with FTP or similar…

Chris

I would try a system mount via autofs and test it with the file browser…

If that works out them I would use path substitution to switch your existing library over to using that without having to reconfigure and reconstruct everything.

I would also recommend trying it without your custom cache settings once your going off a system mount.

Thank you for the suggestion @darwindesign. This sounds like a good idea. Unfortunately I constantly get

mount error(95): Operation not supported
>> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

So, I tried mounting the share manually using

sudo mount -t cifs -o username=SMBUSER,password=SMBPASSWORD,uid=osmc,gid=osmc,vers=3.11 //server/path /mnt/Testing

and this failed with

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

On a Debian machine I use for testing, the same command works well. I used vers=3.11, because running smbstatus on the server gives the following:

Samba version 4.9.5-Debian
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
----------------------------------------------------------------------------------------------------------------------------------------
32636   USER         GROUP        OSMC_IP (ipv4:OSMC_IP:34538)              SMB3_11           -                    partial(AES-128-CMAC)

In the forum, I saw another user reporting the same issue (Smbclient connects to Samba share but mount -t cifs does not) but for a Pi instead of Vero. I also found some more hints on the internet, that error 95 is related to SMB protocol version. Could it be, that cifs on Vero does not support version 3.11?

EDIT: I can also confirm that autofs is working on the Debian system (with vers=3.11).

I tried that command just swapping out my paths and using a credentials file connecting to an up to date Win10 PC and although I didn’t get an error message, I also didn’t get a working mount. Running the same command but using vers=3.0 instead gave me a working mount point.

Whether it should work or not is a bit beyond me. @fzinken is better equipped than I on this topic.

This would have been my suggestion to @zerog

1 Like

Thanks for the suggestions to both of you. In the meantime I modified the server config to also allow older protocols and found out that, for OSMC/Vero4K, mounting and autofs works up to SMBv3.02. Interestingly (from the other topic I already mentioned above) it seems to be working up to the latest version SMBv3.11 for OSMC/Pi. Just out of curiosity, do you know the reason for that?

Back to the original issue: At the evening I will check if autofs solves this.

Chris

Autofs is not doing anything different to execute the mount command automatically so if a command line mount doesn’t work autofs would solve it.

It does now, with the server allowing SMBv3.02 also :wink:

They use different Kernels that might have limitations of the supported SMB versions.
But as I just checked the Vero also has CONFIG_CIFS_SMB311=y so that doesn’t explain it.
Maybe @sam_nazarko can take a look if he spots a difference in kernel config.

1 Like

For a long time I used autofs to auto-mount a Samba network share.

Recently I started using systemd which is working well for me… it mounts a drive on-demand and auto un-mounts it after a period of non use. Details are available here.

Flex

But that would make a difference to the support of Version 3.11, or?

Good news on the original issue: Using autofs significantly improved performance of loading audio files (and video files too) in comparison to Kodi’s built-in client. The protocol issue remains, but I consider the freezing problem solved.

Chris

1 Like