Moode Forum
[SOLVED] Library update too slow - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [SOLVED] Library update too slow (/showthread.php?tid=2879)



Library update too slow - magostinelli - 08-12-2020

Hello,
my hardware is pi4 with Allo Bos Dac and a ssd connected via usb 3.0, with too many flac files.
Moode audio version: 6.7.1

When I update the library the pi was too slow (more than 20 hours to complete 270gb of files).

If I play some music while updating the library, the player do some silence, ad I see these lines inside the mpd.log:
Aug 12 10:08 : alsa_output: Decoder is too slow; playing silence to avoid xrun

If I check the cpu and ram usage the pi is idle, no performance problems detected.

Thanks.


RE: Library update too slow - Tim Curtis - 08-12-2020

How many files?
What is the predominant audio format (flac, alac, wav, aiff, mp3, etc)?

Post the Moode log. It will show some statistics regarding the Library update job.

Code:
moodeutl -l



RE: Library update too slow - magostinelli - 08-12-2020

I found the issue, the problem was rpi 4 with some ssd device.
(https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=245931)

The solution was:
1. find device id by using lsusb, in my case:
    pi@moode:/var/log/mpd $ lsusb
    Bus 002 Device 002: ID 125f:a67a A-DATA Technology Co., Ltd.
2. put the id in file /boot/cmdline.txt:
   usb-storage.quirks=125f:a67a:u

I have more than 7000 flac file, I have the same file on another pc over the network, so I tried to mount it by nfs, the all library content was updated in a few minutes, so I started to watch on usb speed.

It's possible to check the usb ssd speed by using hdparm command.

I also have problem on boot with the automount function, that not works, i solved by switthing from udisks-glue to devmon


RE: Library update too slow - TheOldPresbyope - 08-12-2020

@magostinelli


With moOde 6.7.1 on an RPi4B, initially with only the single Stereo Test file on the SDcard, I plugged an SSD drive containing 1285 FLAC tracks (aka songs) with embedded cover art into a USB3.0 port and told moOde to update the library.

According to the moOde log, it took approximately 7 seconds to regenerate the library and the thumbnails

Code:
20200812 084803 worker: Job regen_library
20200812 084803 thmcache: Start
20200812 084803 thmcache: Scanning: NAS, SDCARD, UPNP, MUSIC, MUSIC-2
20200812 084806 worker: Job regen_library done
20200812 084810 thmcache: Done: 122 album dirs processed


From the command line, "mpc stats" reports the results


Code:
pi@moode64:~ $ mpc stats
Artists:    189
Albums:     119
Songs:     1286

Play Time:    0 days, 2:58:08
Uptime:       6 days, 18:49:54
DB Updated:   Wed Aug 12 09:06:45 2020
DB Play Time: 4 days, 10:00:41


Other things being equal, the time it should take for moOde to scan your library would be roughly

TIME = 7 sec * 7000 / 1286 = 38 sec

If connected via NFS or SAMBA it would naturally take somewhat longer.

Since you mention hdparm, what do you get for "hdparm -t" with your SSD drive plugged into the RPi4B via USB3.0?

With my random SSD drive in a no-name USB3.0 enclosure, I get

Code:
pi@moode64:~ $ sudo hdparm -t /dev/sdb1

/dev/sdb1:
Timing buffered disk reads: 966 MB in  3.00 seconds = 321.47 MB/sec


Not as comprehensive a test as, say, iozone but an easy one. The result compares favorably with numbers reported by Jeff Geerling in his testing (https://www.jeffgeerling.com/blog/2020/fastest-usb-storage-options-raspberry-pi)

Regards,
Kent


RE: Library update too slow - magostinelli - 08-12-2020

Now I solved the problem (adding the setting in cmdline.txt), I wrote here the solution for help other users.

pi@moode:/var/log/mpd $ sudo hdparm -t /dev/sda1

/dev/sda1:
Timing buffered disk reads: 968 MB in 3.00 seconds = 322.19 MB/sec


RE: Library update too slow - TheOldPresbyope - 08-12-2020

+1

Don't forget to mark the thread as "Solved".


RE: Library update too slow - Tim Curtis - 08-12-2020

(08-12-2020, 01:11 PM)magostinelli Wrote: I found the issue, the problem was rpi 4 with some ssd device.
(https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=245931)

The solution was:
1. find device id by using lsusb, in my case:
    pi@moode:/var/log/mpd $ lsusb
    Bus 002 Device 002: ID 125f:a67a A-DATA Technology Co., Ltd.
2. put the id in file /boot/cmdline.txt:
   usb-storage.quirks=125f:a67a:u

I have more than 7000 flac file, I have the same file on another pc over the network, so I tried to mount it by nfs, the all library content was updated in a few minutes, so I started to watch on usb speed.

It's possible to check the usb ssd speed by using hdparm command.

I also have problem on boot with the automount function, that not works, i solved by switthing from udisks-glue to devmon

Thanks for investigating and finding that article :-)


RE: Library update too slow - magostinelli - 08-12-2020

(08-12-2020, 01:34 PM)TheOldPresbyope Wrote: +1

Don't forget to mark the thread as "Solved".

I was looking for that function, how to do it?
I should manually edit my first post?


RE: Library update too slow - TheOldPresbyope - 08-12-2020

(08-12-2020, 02:49 PM)magostinelli Wrote:
(08-12-2020, 01:34 PM)TheOldPresbyope Wrote: +1

Don't forget to mark the thread as "Solved".

I was looking for that function, how to do it?
I should manually edit my first post?

Yup.