cpd73 wrote:
> I've used your musly.py code to interface with musly, but added usage of
> python's concurrent features to speed up analysis. On my 5 year old i7
> laptop with an SSD card I can analyse ~20k in just over 1 hour - which
> is amazing compared to the ~1week for MusiIP (although that was not
> 24*7). Looking at the timing of the analysis, the last ~20minutes are
> taken by the call to setmusicstyle. This is not that bad when analysing
> all tracks, but setmusicstyle is called if more tracks are added - and
> takes ~20minutes again.
>
First of all, I wrote this ~3 years ago, so I have to admit I'm a bit
hazy on the details.
However, one thing I noticed was this modification in add_tracks
Code:
--------------------
# original code
if numtracks > MUSLY_MUSTYLENUMTRACKS:
_LOGGER.debug("add_tracks: using subset for setmusicstyle")
snumtracks = MUSLY_MUSTYLENUMTRACKS
sample = random.sample(range(numtracks), k=MUSLY_MUSTYLENUMTRACKS)
smtracks_type = (ctypes.POINTER(self.mtrack_type)) * MUSLY_MUSTYLENUMTRACKS
smtracks = smtracks_type()
i = 0
for s in sample:
#_LOGGER.debug("add_tracks: subset setmusicstyle: {}".format(s))
smtracks[i] = mtracks[s]
i += 1
else:
smtracks_type = mtracks_type
smtracks = mtracks
snumtracks = numtracks
# NOT original code
smtracks_type = mtracks_type
smtracks = mtracks
snumtracks = numtracks
# original code continues
# int musly_jukebox_setmusicstyle (musly_jukebox * jukebox, musly_track **
tracks, int num_tracks
self.mus.musly_jukebox_setmusicstyle.argtypes =
[ctypes.POINTER(MuslyJukebox), ctypes.POINTER(smtracks_type), ctypes.c_int ]
--------------------
which now always passes all tracks to setmusicstyle, instead of only a
sample if there are > MUSLY_MUSTYLENUMTRACKS tracks.
Not sure I understand the purpose of this modification - have you
noticed any issues with the sampling approach?
cpd73 wrote:
>
> Do you know of anyway to speed this call up? I tried re-compiling Musly
> with OpenMP but this made no difference.
>
If only passing a sample instead of all tracks to it doesn't help,
probably not, as it is in libmusly itself.
However, I'll have a look if I can reproduce it on my system (IIRC, I've
never analysed that many tracks). Unfortunately, atm all fast-ish
systems I have are busy with other workloads - I'll post an update
later.
'Various SW' (https://www.nexus0.net/pub/sw/): Web Interface | Playlist
Editor / Generator | Music Classification | Similar Music | Announce |
EventTrigger | LMSlib2go | ...
'Various HowTos' (https://www.nexus0.net/pub/documents/LMS/): build a
self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...
------------------------------------------------------------------------
Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=108495
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins