Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic with message "No space left on device" #51

Closed
sashahilton00 opened this issue Jan 29, 2018 · 9 comments
Closed

Panic with message "No space left on device" #51

sashahilton00 opened this issue Jan 29, 2018 · 9 comments

Comments

@sashahilton00
Copy link
Member

Issue by joerg-krause
Friday Mar 17, 2017 at 09:51 GMT
Originally opened as plietar/librespot#166


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 anErr value: 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?

@sashahilton00
Copy link
Member Author

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.

@sashahilton00
Copy link
Member Author

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.

@sashahilton00
Copy link
Member Author

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?

@sashahilton00
Copy link
Member Author

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.

@sashahilton00
Copy link
Member Author

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.

@ComlOnline
Copy link
Contributor

The final PR for this was closed. See here.

@plietar
Copy link
Contributor

plietar commented Feb 2, 2018

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.

@plietar plietar reopened this Feb 2, 2018
@michaelherger
Copy link
Contributor

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.

@sashahilton00
Copy link
Member Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants