tehkillerbee / mopidy-tidal

Tidal Backend plugin for Mopidy
Apache License 2.0
93 stars 28 forks source link

mopidy-tidal struggles with medium-sized (>=400 track) playlists when loading through ncmpcpp #103

Closed HamNuggets closed 7 months ago

HamNuggets commented 1 year ago

it works fine with small playlists. i have a 31-track 2 hour playlist of all doom osts which loads into ncmpcpp just fine. however whenever i try to use any of my actual playlists (about 400 songs each) it just completely cries itself to sleep and heavily slows down. it won't actually load the playlist either, it will give up after a few minutes (mopidy crash?) i was under the impression that 400 songs wasn't that much in comparison to other playlists. is this an issue on my end or does this app just need to git gud at caching?

tehkillerbee commented 1 year ago

Hi @UwUham. Thanks for your feedback. I have not used ncmpcpp myself, but when using large playlists >300 in Iris, I have noticed the first caching process takes quite a while and nothing appears to happen. After some time, I refresh the window and then all playlist tracks are listed very fast, i.e. the track cache is used when accessing the playlist.

Can you try refreshing/reload the playlist after the first initial caching is complete and see if the behaviour is similar to Iris'?

You mentioned that mopidy crashed. Is it possible that you can provide some logs when your mopidy session appears to crash? You can use journalctl for this, eg.: journalctl -u mopidy | tail -50

Is it possible for you to provide more details on your configuration and/or a test playlist that we can use to investigate further? Unfortunately the playlist caching itself is largely a Tidal limitation, as we have to rely on tidalapi when accessing each playlist.

HamNuggets commented 1 year ago

somehow it's fine now, i didn't change anything at all so i somehow understand less. i'm not sure how github issues work but i'll see if i can reopen this if i manage to make it happen again and i'll provide a bit more info, thank u for offering help

HamNuggets commented 1 year ago

its me again i managed to get it to happen again (i switched from pulseaudio to pipewire-pulse to fix some video playback issues and now it's happening again)

 basil@archbtw  ~  doas journalctl -u mopidy | tail -50  
Apr 16 22:56:52 archbtw mopidy[4948]: INFO     2023-04-16 22:56:52,115 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:52 archbtw mopidy[4948]:   Lookup uris 'tidal:track:16364053:192873183:192873187'
Apr 16 22:56:52 archbtw mopidy[4948]: INFO     2023-04-16 22:56:52,731 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:52 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:52 archbtw mopidy[4948]: INFO     2023-04-16 22:56:52,731 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:52 archbtw mopidy[4948]:   Lookup uris 'tidal:track:16257721:174006950:174006951'
Apr 16 22:56:53 archbtw mopidy[4948]: INFO     2023-04-16 22:56:53,321 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:53 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:53 archbtw mopidy[4948]: INFO     2023-04-16 22:56:53,321 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:53 archbtw mopidy[4948]:   Lookup uris 'tidal:track:6832713:158361884:158361892'
Apr 16 22:56:53 archbtw mopidy[4948]: INFO     2023-04-16 22:56:53,705 [4948:MpdSession-17 (_actor_loop)] mopidy_mpd.session
Apr 16 22:56:53 archbtw mopidy[4948]:   New MPD connection from [::ffff:127.0.0.1]:44306
Apr 16 22:56:54 archbtw mopidy[4948]: INFO     2023-04-16 22:56:54,063 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:54 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:54 archbtw mopidy[4948]: INFO     2023-04-16 22:56:54,063 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:54 archbtw mopidy[4948]:   Lookup uris 'tidal:track:8304101:250752057:250752068'
Apr 16 22:56:54 archbtw mopidy[4948]: INFO     2023-04-16 22:56:54,986 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:54 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:54 archbtw mopidy[4948]: INFO     2023-04-16 22:56:54,986 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:54 archbtw mopidy[4948]:   Lookup uris 'tidal:track:24362374:190383800:190383806'
Apr 16 22:56:55 archbtw mopidy[4948]: INFO     2023-04-16 22:56:55,598 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:55 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:55 archbtw mopidy[4948]: INFO     2023-04-16 22:56:55,598 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:55 archbtw mopidy[4948]:   Lookup uris 'tidal:track:13050346:185407132:185407137'
Apr 16 22:56:56 archbtw mopidy[4948]: INFO     2023-04-16 22:56:56,211 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:56 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:56 archbtw mopidy[4948]: INFO     2023-04-16 22:56:56,211 [4948:TidalBackend-6 
(_actor_loop)] mopidy_tidal.library
Apr 16 22:56:56 archbtw mopidy[4948]:   Lookup uris 'tidal:track:10145385:245039870:245039871'
Apr 16 22:56:56 archbtw mopidy[4948]: INFO     2023-04-16 22:56:56,825 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:56 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:56 archbtw mopidy[4948]: INFO     2023-04-16 22:56:56,825 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:56 archbtw mopidy[4948]:   Lookup uris 'tidal:track:13050346:150879921:150879922'
Apr 16 22:56:57 archbtw mopidy[4948]: INFO     2023-04-16 22:56:57,951 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:57 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:57 archbtw mopidy[4948]: INFO     2023-04-16 22:56:57,952 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:57 archbtw mopidy[4948]:   Lookup uris 'tidal:track:18691773:210885365:210885366'
Apr 16 22:56:58 archbtw mopidy[4948]: INFO     2023-04-16 22:56:58,566 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:58 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:58 archbtw mopidy[4948]: INFO     2023-04-16 22:56:58,566 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:58 archbtw mopidy[4948]:   Lookup uris 'tidal:track:18691773:235271282:235271283'
Apr 16 22:56:58 archbtw mopidy[4948]: INFO     2023-04-16 22:56:58,711 [4948:MpdSession-18 (_actor_loop)] mopidy_mpd.session
Apr 16 22:56:58 archbtw mopidy[4948]:   New MPD connection from [::ffff:127.0.0.1]:54556
Apr 16 22:56:59 archbtw mopidy[4948]: INFO     2023-04-16 22:56:59,185 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:59 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:56:59 archbtw mopidy[4948]: INFO     2023-04-16 22:56:59,185 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:56:59 archbtw mopidy[4948]:   Lookup uris 'tidal:track:21952818:160190197:160190202'
Apr 16 22:57:00 archbtw mopidy[4948]: INFO     2023-04-16 22:57:00,004 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:57:00 archbtw mopidy[4948]:   Returning 1 tracks
Apr 16 22:57:00 archbtw mopidy[4948]: INFO     2023-04-16 22:57:00,005 [4948:TidalBackend-6 (_actor_loop)] mopidy_tidal.library
Apr 16 22:57:00 archbtw mopidy[4948]:   Lookup uris 'tidal:track:19912679:223741958:223741959'

i don't think there's much to see here it may just be the api being busy to be honest i also can't get any sound output from mopidy which is weird, since i can get it from literally everything else

tehkillerbee commented 1 year ago

From your log, it appears that the api is busy getting all the tracks in the playlist. This is slow but normal. After this process is completed, you should be able to browse the playlist as usual. There should be no errors during this sequence. Does it eventually complete the lookup sequence? Are there any errors or warnings, then please include them in your log.

Regarding audio - are you trying to use built-in audio or a (USB) DAC? The latter requires configuring mopidy to use a specific DAC - this is not tidal specific so I assume you must have sound issues when using other sources?

The reason the issue disappeared and them reappeared could be since the cache was first initialized and then afterwards all playlist accesses used the (now initialized) cache. At some point the cache might be cleared, but this should not happen unless you deleted the cache files manually..

tehkillerbee commented 7 months ago

Closing as there has been no updates on this issue. Feel free to reopen if it is still relevant.