Kodi freezing constantly after 15-20 minutes of playing songs

Hi everybody.
I’m on Raspberry Pi3 (with IQ Audio Pi-DAC+) + OSMC + Kodi.
The only use is for hi-fi stereo, with 2 2TB Segate hard disks connected via USB, and with a USB power supply in the middle. Lots of album releases, about 8.000. Everything remote driven by Yatse on Android.
No add-ons, except SSH, FTP and Samba services.
I use MySQL + PHPMyAdmin on the same machine.
I did a fresh reinstall some days ago, for other problems (Kodi used to freeze after a couple of songs, but I thought it was maybe because of a lot of upgrades during the months): just reimaged the SD card (OSMC original), minimum config, added MySQL (configured for local use) and PHP, and rescan the 2 folders with albums in the 2 hard disks (all Music Brainz tagged .flac files).
After all this setup all seemed OK (fanart visible, DB on MySQL present and populated and so on), but Kodi cannot resist playing more than 15-20-25 minutes. After that the music stops, sometimes tries to restart jumping (but with nothing really audible), but at the end after some minutes of agony Kodi freezes and restart.
Here’s my logs: https://paste.osmc.tv/soxehiyace

Thanks in advance
Alex

Your SD card is failing:

Apr 11 04:18:42 osmc kernel: “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
Apr 11 04:18:42 osmc kernel: kworker/0:2 D 0 2141 2 0x00000000
Apr 11 04:18:42 osmc kernel: Workqueue: events_freezable mmc_rescan
Apr 11 04:18:42 osmc kernel: [<80a3813c>] (__schedule) from [<80a38930>] (schedule+0x5c/0xc0)
Apr 11 04:18:42 osmc kernel: [<80a38930>] (schedule) from [<8082d37c>] (__mmc_claim_host.constprop.15+0x100/0x240)
Apr 11 04:18:42 osmc kernel: [<8082d37c>] (__mmc_claim_host.constprop.15) from [<8082d4f0>] (mmc_get_card+0x34/0x38)
Apr 11 04:18:42 osmc kernel: [<8082d4f0>] (mmc_get_card) from [<808383c0>] (mmc_sd_detect+0x24/0x7c)
Apr 11 04:18:42 osmc kernel: [<808383c0>] (mmc_sd_detect) from [<80830480>] (mmc_rescan+0x260/0x530)
Apr 11 04:18:42 osmc kernel: [<80830480>] (mmc_rescan) from [<80153438>] (process_one_work+0x238/0x5c4)
Apr 11 04:18:42 osmc kernel: [<80153438>] (process_one_work) from [<80153e68>] (worker_thread+0x7c/0x65c)
Apr 11 04:18:42 osmc kernel: [<80153e68>] (worker_thread) from [<8015c25c>] (kthread+0x190/0x1c0)
Apr 11 04:18:42 osmc kernel: [<8015c25c>] (kthread) from [<801010ac>] (ret_from_fork+0x14/0x28)
Apr 11 04:18:42 osmc kernel: Exception stack(0xadd19fb0 to 0xadd19ff8)
Apr 11 04:18:42 osmc kernel: 9fa0: 00000000 00000000 00000000 00000000
Apr 11 04:18:42 osmc kernel: 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Apr 11 04:18:42 osmc kernel: 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000

OK, thanks.
That explains even the failures before the reinstall.
Sam, I’m going to place a new order for a 32 GB card. Are you delivering normally (from UK, right?) in these terrible days?

Thanks in advance and take care
Alex

Yes – but won’t go out until Tuesday obviously due to Bank Holiday

Sam

I’m not sure I agree with Sam’s analysis, in this case.

If Kodi is freezing repeatedly after 15-20 minutes of playing songs, that sounds more like a resource issue than a bad card. And, in fact, the log shows that you first of all ran out of memory, which caused the oom-killer to kill Kodi.

Kodi then restarted but I suspect that there was some kind of resource issue after the out-of-memory problem and Kodi subsequently crashed.

So, while it might be a bad SD card (never say never), I’m more inclined to think that you’re trying to fit too much into the Pi’s limited memory. If you could move the MySQL database to another device or simply use the default sqlite3, I think the problem might disappear.

He could try stop MySQL (and not use library mode) and see if that helps.
I missed the OOM

If the only use is HiFi stereo, OSMC and Kodi are overkill. There are much more robust solutions for this on Rpi, such as MPD on Raspbian. Control by remote smart device is also quite possible in this scenario.

Do you mean to stop MySQL in SSH session and using Yatse to navigate by files?
OK it’s quite easy, I can try.
Only one thing: I’m sure I used the same system in a perfect way for months and months, for example as far as I remember almost all 2019 and for the beginning of 2020 everything worked perfectly always with MySQL on the same machine: this would lead either to a damaged SD card as you wrote, or a problem with the last versions of OSMC/Kodi (maybe with the interactions with a huge library or with a local instance of MySQL.

You can test the card with H2testw
Also good time to take a backup of it.

Could you remind me the process with H2testw?
Is it possible from a Windows 10 notebook with the card inserted?

Yes – use the ‘Write and Verify’ option.
Take a backup first.

It could be, but I need to use Yatse, because to me it’s the most amazing app for liquid hifi.
Is it possible?

Yatse is for Kodi only. But I know there are likely dozens of Android apps for controlling mpd. You would be wise to investigate some of them.

No way. Yatse is unbeatable. Moreover I bought it (years ago). :slight_smile:

Well, flatly refusing to entertain the idea that there might be alternatives of equal or better quality doesn’t seem like the action of an intelligent person, but to each their own…

Clearly I’d like to use the best interface possible. I tested other UPNP/DLNA smartphone controller just to check in the last years, but nothing compares to Yatse as usability and other features.
Moreover I had years of perfect functionality of OSMC + Kodi for HiFi, so…

I’ve read through the thread but can’t see why you chose to use MySQL / MariaDB, rather than the more lightweight sqlite3. Generally, MySQL / MariaDB would be chosen if you wanted to have a central database that is shared across more than one Kodi system.

Mmm… mainly to be able to interact with the DB.
I couldn’t stand some features of Kodi as the Artist Name displayed.
I wanted to read “Dylan, Bob”, instead of “Bob Dylan”, or “Doors, The” instead of “The Doors” even though in the last releases I could find those artists correctly ordered under “D”. So last year I did some update queries on the DB (but not after the last 2 reinstall).
I know that DB direct writings/updates are deprecated, but I wanted to do it anyway. :slight_smile:
There was no option to do it with the sqlite3, as far as I know.
Maybe I could uninstall PHPMyAdmin (and Apache consequently) and get some improvements because I don’t really need it, since I can interact with MySQL DB remotely with MySQL or MariaDB Windows client tools.

You could just make sure the files are tagged correctly and update as needed. I think for most people this would probably involve using sort name tags.

https://kodi.wiki/view/Settings/Media/Music#Use_artist_sortname_when_sorting_by_artist

The default setting is to ignore articles.

https://kodi.wiki/view/Settings/Media/General#Ignore_articles_when_sorting

Uff… I perfectly know all of this stuff.
I’ve been following the debate about that and other implementations in Kodi for years.
Therefore I know that now the order is correct and the article is ignored.
But I’d like also to READ on my device “Dylan, Bob” while browsing the artists, not only to have it correctly sorted. I find it ridiculous to browse and get this:

The Dream Syndicate
Drexciya
Drive Like Jehu
Bob Dylan

though I agree it’s sorted.
The only way I found to get it was to update the DB, inserting in the Artist Name the Artist Sort Name.