Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


[HOW-TO] Spotify Connect Web for Moode
(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


Messages In This Thread
RE: Spotify Connect for Moode - by Tim Curtis - 04-06-2018, 07:34 PM
RE: Spotify Connect for Moode - by RafaPolit - 04-07-2018, 05:30 AM
RE: Spotify Connect for Moode - by deafnut - 04-07-2018, 08:01 PM
RE: Spotify Connect for Moode - by RafaPolit - 04-08-2018, 05:28 AM
RE: Spotify Connect for Moode - by gabmartini - 04-09-2018, 02:08 AM
RE: Spotify Connect for Moode - by pinkdot - 04-09-2018, 04:58 PM
RE: Spotify Connect for Moode - by airdronian - 04-17-2018, 09:01 PM
RE: Spotify Connect for Moode - by Tim Curtis - 04-09-2018, 02:18 AM
RE: Spotify Connect for Moode - by franz159 - 04-11-2018, 04:43 AM
RE: Spotify Connect for Moode - by JonPike - 05-03-2018, 01:59 AM
RE: Spotify Connect for Moode - by RafaPolit - 04-11-2018, 05:43 AM
RE: Spotify Connect for Moode - by jonners - 04-11-2018, 07:39 AM
RE: Spotify Connect for Moode - by gabmartini - 04-13-2018, 11:33 PM
RE: Spotify Connect for Moode - by pinkdot - 04-14-2018, 08:10 AM
RE: Spotify Connect for Moode - by Tim Curtis - 04-14-2018, 12:14 PM
RE: Spotify Connect for Moode - by RafaPolit - 04-17-2018, 10:10 PM
RE: Spotify Connect for Moode - by airdronian - 04-17-2018, 11:31 PM
RE: Spotify Connect for Moode - by gabmartini - 04-17-2018, 11:50 PM
RE: Spotify Connect for Moode - by airdronian - 04-18-2018, 12:13 AM
RE: Spotify Connect for Moode - by airdronian - 04-19-2018, 05:34 PM
RE: Spotify Connect for Moode - by Onionhead - 04-23-2018, 01:40 AM
RE: Spotify Connect for Moode - by pinkdot - 04-23-2018, 05:50 AM
RE: Spotify Connect for Moode - by RafaPolit - 04-23-2018, 06:18 PM
RE: Spotify Connect for Moode - by Onionhead - 04-23-2018, 06:35 PM
RE: Spotify Connect for Moode - by gabmartini - 04-27-2018, 11:31 PM
RE: Spotify Connect for Moode - by pinkdot - 04-28-2018, 07:48 AM
RE: Spotify Connect for Moode - by grasshopper - 04-29-2018, 10:26 AM
RE: Spotify Connect for Moode - by JonPike - 05-03-2018, 03:05 AM
RE: Spotify Connect for Moode - by grasshopper - 05-03-2018, 07:08 PM
RE: Spotify Connect for Moode - by JonPike - 05-16-2018, 01:33 AM
RE: Spotify Connect for Moode - by grasshopper - 05-17-2018, 07:00 PM
RE: Spotify Connect for Moode - by Me2018 - 01-22-2019, 02:40 PM
RE: Spotify Connect for Moode - by npetra - 08-28-2019, 05:18 PM
RE: Spotify Connect for Moode - by grasshopper - 01-17-2019, 12:00 PM
RE: Spotify Connect for Moode - by grasshopper - 04-29-2018, 10:38 AM
RE: Spotify Connect for Moode - by RafaPolit - 04-29-2018, 10:53 AM
RE: Spotify Connect for Moode - by aBrianH - 04-30-2018, 10:11 AM
RE: Spotify Connect for Moode - by RafaPolit - 05-01-2018, 03:59 AM
RE: Spotify Connect for Moode - by gabmartini - 05-02-2018, 03:43 AM
RE: Spotify Connect for Moode - by grasshopper - 05-02-2018, 06:11 PM
RE: Spotify Connect for Moode - by RafaPolit - 05-12-2018, 12:53 AM
RE: Spotify Connect for Moode - by Tim Curtis - 05-12-2018, 12:52 PM
RE: [HOW-TO] Spotify Connect Web for Moode - by TheOldPresbyope - 11-07-2018, 04:48 AM
Error when Spotify Connect Web - by IT-Andy52 - 09-06-2019, 08:54 AM
RE: Error when Spotify Connect Web - by RafaPolit - 09-25-2019, 07:39 PM

Forum Jump: