Code Monkey home page Code Monkey logo

Comments (9)

sashahilton00 avatar sashahilton00 commented on September 28, 2024

Comment by plietar
Friday Mar 17, 2017 at 14:37 GMT


Interesting, I never really considered very large tracks.
librespot doesn't load the whole song into RAM, but it downloads it into /tmp, which may be the same thing if that is mounted as a tmpfs.

As a temporary workaround, you can change this line from NamedTempFile::new() to NamedTempFile::new_in("/somewhere/not/in/ram").

Ideally, if a cache directory is specified we can just use $CACHE/temp automatically for that.

from librespot.

sashahilton00 avatar sashahilton00 commented on September 28, 2024

Comment by joerg-krause
Friday Mar 17, 2017 at 17:52 GMT


Thanks, I will try this. In fact, this track is an extreme. It my also happen for tracks having a length of six or seven minutes, depending on the free RAM left.

from librespot.

sashahilton00 avatar sashahilton00 commented on September 28, 2024

Comment by joerg-krause
Thursday Mar 23, 2017 at 12:10 GMT


On second thought, my system is NAND flash based. So, using anything else than the RAM for caching is not a good idea. So, I need a bigger RAM?

from librespot.

sashahilton00 avatar sashahilton00 commented on September 28, 2024

Comment by plietar
Thursday Mar 23, 2017 at 13:25 GMT


Pretty much. A solution would be to change librespot to break up the files in blocks of say 500KB, and delete them automatically (if cache is disabled) once it has moved on to the next one. This is a large-ish change, so it's unlikely I'll be able to implement it anytime soon unfortunately.

from librespot.

sashahilton00 avatar sashahilton00 commented on September 28, 2024

Comment by michaelherger
Tuesday May 02, 2017 at 04:33 GMT


I've modified librespot to disable the audio file-cache. See pull request #181.

from librespot.

ComlOnline avatar ComlOnline commented on September 28, 2024

The final PR for this was closed. See here.

from librespot.

plietar avatar plietar commented on September 28, 2024

This is different from plietar/librespot#204. The issue here is that librespot tries to download the entire file (whether or not cache is enabled), which may be impossible for long tracks and low memory devices.

from librespot.

michaelherger avatar michaelherger commented on September 28, 2024

Yep, I had to learn this the hard way: though I had the audio-cache disabled I still saw people with large files in TMPDIR. In my case I was able to work around this using the method mentioned by @plietar: have librespot write to some place outside in-memory storage. Setting TMPDIR=/path/to/folder librespot ... does the trick here.

from librespot.

sashahilton00 avatar sashahilton00 commented on September 28, 2024

given that all spotify songs are downloaded in chunks, is there an easy way to discard chunks once they have been played when the cache is disabled?

from librespot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.