Thank you for your donation!


[HOW-TO] Spotify Connect Web for Moode
Hi. During long listening spotify the cache size (/var/local/www/spotify_cache/files) increases and takes up all the free space on the memory card, because of this, the system stops working stably, is there any solution to limit the cache size ? I try to clean this folder on my own through cron, it looks like it works.

P.S. Moode 4.3 (with native Spotify support)
Reply
This is really the wrong place to ask this question. Here we are discussing a non-native installation of a different package which takes care of Spotify with Spotify Connect Web.

For the native Spotify support, please address this question in the support forum, probably starting a new thread. It will get Tim's attention much quicker!
Reply
(11-06-2018, 08:51 PM)abigor Wrote: Hi. During long listening spotify the cache size (/var/local/www/spotify_cache/files) increases and takes up all the free space on the memory card, because of this, the system stops working stably, is there any solution to limit the cache size ? I try to clean this folder on my own through cron, it looks like it works.

P.S. Moode 4.3 (with native Spotify support)

@abigor

Looking through the issues log on the librespot github repo, I see that this same problem was addressed by the maintainer last year with the addition of a new run-time option "--disable-audio-cache". It isn't clear, at least to me, what side effects this option may have so we'll likely have to test it before adding it in moOde.

Regards,
Kent

PS - Yes, I'm a member of the Moderator group for this forum but I didn't get the memo on how to move this post to a new thread so Rafa's suggestion will have to wait on Tim or @rikardo1979 to do it.
Reply
(11-07-2018, 12:57 AM)TheOldPresbyope Wrote:
(11-06-2018, 08:51 PM)abigor Wrote: Hi. During long listening spotify the cache size (/var/local/www/spotify_cache/files) increases and takes up all the free space on the memory card, because of this, the system stops working stably, is there any solution to limit the cache size ? I try to clean this folder on my own through cron, it looks like it works.

P.S. Moode 4.3 (with native Spotify support)

@abigor

Looking through the issues log on the librespot github repo, I see that this same problem was addressed by the maintainer last year with the addition of a new run-time option "--disable-audio-cache". It isn't clear, at least to me, what side effects this option may have so we'll likely have to test it before adding it in moOde.

@abigor

I make the change to playerlib.php and have been listening to Spotify tracks for the past three hours. So far it seems to be working for me. I can't say this is an exhaustive test but it is at least a proof of concept. With the change and a reboot there is no caching of files to /var/local/www/spotify_cache/files directory. I cleared it once and it remains empty.

You apparently listen to Spotify a lot more than I do so how about testing this change too to see if I've overlooked a side effect? Since you have been mucking with cron I'm confident you can deal with the edit involved. 

In /var/www/inc/playerlib.php, there's a long string-concatenation statement beginning at line 1752 (in moOde r43)

Code:
    $cmd = 'librespot' .
        ' --name "' . $_SESSION['spotifyname'] . '"' .
        ' --bitrate ' . $cfg_spotify['bitrate'] .
        ' --initial-volume ' . $cfg_spotify['initial_volume'] .
        $linear_volume .
        $volume_normalization .
        ' --cache /var/local/www/spotify_cache --backend alsa --device "' . $device . '"' .
        ' --onevent /var/local/www/commandw/spotevent.sh' .
        ' > /dev/null 2>&1 &';

Insert a new line "' --disable-audio-cache' ." so the statement reads something like

Code:
       $cmd = 'librespot' .
               ' --name "' . $_SESSION['spotifyname'] . '"' .
               ' --bitrate ' . $cfg_spotify['bitrate'] .
               ' --initial-volume ' . $cfg_spotify['initial_volume'] .
               $linear_volume .
               $volume_normalization .
               ' --disable-audio-cache' .
               ' --cache /var/local/www/spotify_cache --backend alsa --device "' . $device . '"' .
               ' --onevent /var/local/www/commandw/spotevent.sh' .
               ' > /dev/null 2>&1 &';

and reboot (executing "sudo /home/pi/srestart.sh" might be enough).

Listen to the music.

Regards,
Kent
Reply
(11-06-2018, 10:41 PM)RafaPolit Wrote: This is really the wrong place to ask this question.  Here we are discussing a non-native installation of a different package which takes care of Spotify with Spotify Connect Web.

For the native Spotify support, please address this question in the support forum, probably starting a new thread.  It will get Tim's attention much quicker!

I apologize for writing the wrong topic.

Quote:TheOldPresbyope


I make the change to playerlib.php and have been listening to Spotify tracks for the past three hours. So far it seems to be working for me. I can't say this is an exhaustive test but it is at least a proof of concept. With the change and a reboot there is no caching of files to /var/local/www/spotify_cache/files directory. I cleared it once and it remains empty.

You apparently listen to Spotify a lot more than I do so how about testing this change too to see if I've overlooked a side effect? Since you have been mucking with cron I'm confident you can deal with the edit involved. 

In /var/www/inc/playerlib.php, there's a long string-concatenation statement beginning at line 1752 (in moOde r43)

Thank you so much for your answer, everything works fine.
Reply
(04-29-2018, 10:26 AM)grasshopper Wrote: My first post here.  Good morning Big Grin 
Anyway, just to say I followed the instructions on Git to install this in V4.1 & it worked flawlessly.  Thank you to all involved.
Using an IQaudIO DAC Pro I just changed the reference from hw:1 to hw:0 in asound.conf.
Replying to my own post here I know.
I followed RafaPolit's instructions again in MoOde 4.4 using the same IQaudIO DAC Pro combo & it worked flawlessly, just needing to change hw:1 to hw:0 in asound.conf again.
I have a question though, in MoOde Audio Config, the ALSA volume is set to 100%, if it is, the volume when connecting Spotify is distorted badly.  Reducing the ALSA volume to 90% results in loss of distortion & excellent sound.
If MoOde is restarted, the ALSA volume reverts to 100%.
Is there a way of ensuring the ALSA volume stays at 90% or should I be adjusting the volume elsewhere?  In the Spotify app, the volume for MoOde is shown at about 80% or 90% depending on how loud the source recording is.
Reply
For audio devices that have a hardware volume controller, moOde sets hardware (ALSA) volume to 0dB (100%) prior to beginning the stream sent from the client to the renderer.

Volume level is always set by the client.

What do you have volume set in in the Spotify app?
Reply


Forum Jump: