I have a pi zero w, with I think around 1000 albums on a USB (mp3s). It does freeze up after updating music on the USB. It takes about 10 minutes for the initial indexing, but without freezing. Where it freezes is when I click on Artists (or I assume Albums) the first time. It’s frozen right now and I can’t even SSH in.
Last time this happened I think I just waited a few days and it was fine. Since this is happening on clicking Artists, I’m guessing the little pi is overwhelmed trying to add album covers.
Next time I’ll try adding files without disconnecting the USB - hopefully it only has to reindex the added files.
I’m not sure it’s just album covers doing it. This time it froze for 4 days (since my last post) and I gave up and rebooted. I tried clicking on Artists and Albums, and it was slow to load covers but not that slow. I ran “top” on SSL, and CPU didn’t get past 50%, with a minimum 25M free in memory.
I then went to Settings and reset my album covers, Save, then clicked on Artist. CPU went as high as 91% briefly, but then back down. It’s (alphabetically) filling in all of the album covers without freezing. It only took a few minutes to load all of the album covers. I then clicked Album and had similar results (noticed 70% CPU max, 29M memory free min). Also only took a few minutes. Then I’m down to 1-2% CPU, still 29M memory free (475M total).
The next step is to replicate what makes it fail - maybe taking the USB out, adding some music, plugging it back in, rescanning, waiting for it to finish, then clicking Album. I’ll post back here when I find time to do that.
Here’s a clip of after I clicked to reload album covers then clicked Artists:
Interesting datapoint, even if not just at failure point.
We see Node is taking a significant chunk of memory already… Would be nice to see how this evolves during indexing and before/at failure.
Now, it seems strange swap is reported as 0, as default memory setup for PiZero is supposed to have swap (though this could be debatable since swap on SD has some big issues): have you tweaked configuration in some way?
So we have 2 issues here:
Original hang/crash may come from out of memory situation, which may be a fundamental memory leak issue that’d need investigation as a whole (Node process memory usage is a smoking gun that’d needs screening); it would be beneficial for any device. Let’s call it Issue 1 to investigate.
For some reason swap is not enabled on your device (Volumio is supposed to enable it by default on PiZero): Issue 2.
By fixing Issue 2 we may hide fundamental Issue 1, while inheriting a performance penalty hit, and increased SD corruption risks.
So, let’s look at Issue 2 for now, what gives: sudo /bin/dynswap.sh
and then check cat /proc/swaps and free
In the name of science I started with a clean install of Volumio with no plugins. First of all the 2.834 version didn’t work at all, so I installed 2.729 and then upgraded within the software (worked).
Same behavior - no swap file and “swapon failed” when I ran the sudo /bin/dynswap.sh
@MattG Issue is being investigated (see Github link @ashthespy provided) , and it’s still unclear since which version, swap setup started to fail, nor when a definitive fix is available in later versions.
So far, I’ve a (simple) workaround (change /data/ into /imgpart/ within /bin/dynswap.sh), but it may compromise future updates…
You may track that Github issue to monitor when definitive change is eventually implemented.
Put me in my place if you feel like I am hijacking but:
I found this topic trying to explore the reasons for my suddenly incredibly slow Volumio (RPi2). I have loads of other things installed on top of Volumio (shame on me, I know), because I test that particular RPi as 433 sniffer as well. Everything worked fine (for days when all this was installed) up to a point today when I found out that mpd failed. I got same error like mentioned here: mpd broken in Volumio 2.5.26 so I went on with building libbcm_host.so as suggested. While tinkering with that, I realised that RPi is getting really sluggish. Wanted to check RAM but could not get to RPimonitor anymore. Several reboots later I found out that I have no swap enabled. First I tried to edit dynswap.sh, replace /data/ with /imgpart/. Reboot, no change. Then I updated to the latest volumio version (2.852), nada. I Checked github and manually edited dynswap.sh (which looked exactly the same as before update) to mirror the last version (/data/ replaced with /swap/ and so on). Another reboot, no luck.
I tried manually run sudo dynswap.sh but it seems not to do anything at all.