Closed joerg-krause closed 6 years ago
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.
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.
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?
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.
I've modified librespot to disable the audio file-cache. See pull request #181.
Closed due to lack of maintenance of the project.
When playling long tracks on my embedded device with about 36MB of free RAM, librespot panics with:
thread 'main' panicked at 'called
Result::unwrap()on an
Errvalue: Error { repr: Os { code: 28, message: "No space left on device" } }'
.For example using this track (45:31). Is there a way not to load the whole song into RAM?