This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Script to buffer next N songs in playlist to ram

Tags: None
(comma "," separated)
khaytsus
Registered Member
Posts
4
Karma
0
There are a few reasons for this, laptop power savings, reducing wear and tear on a hard drive, etc...  I recently had a hard drive die after leaving Amarok running 24/7 for the 18 months of its life, just makes me wonder if all the constant reading damaged it...  Obviously I'm not blaming Amarok here, just concerns me about continuing this behavior unmodified.

Would it be possible for someone to write a script to buffer the next X number of songs into ram and play them from ram?  When it gets down to say 1 song, buffer up again?  Just using 30-40M of ram could buffer 3-4 high quality mp3s, and I'd likely allocate it more on my workstation.  I'd guess the drive would read for a few seconds at most every 30 minutes for 100M of data, just rough guestimates here.

It'd have to be very generic (buffer whatever songs are in playlist) and of course change the playlist to point to the buffered song area rather than the real location.

Possible?  Any takers?
User avatar
sebr
Moderator
Posts
301
Karma
0
This isn't going to solve any of your "problems" because buffering songs into ram still requires reading the data off the hard disk. You either read it earlier or later. You'll have more luck looking into using a higher quality HDD device or using a filesystem better suited to your needs.
khaytsus
Registered Member
Posts
4
Karma
0
Seb Ruiz wrote:This isn't going to solve any of your "problems" because buffering songs into ram still requires reading the data off the hard disk. You either read it earlier or later. You'll have more luck looking into using a higher quality HDD device or using a filesystem better suited to your needs.


Of course it reads it eventually..  :rolleyes:  In thise case it reads it in a large chunk, next N number of songs until a threshold is reached, and then it doesn't have to read again for however long that'll play..  100M with mp3's would be 30+ minutes.  Quite different than basically reading constantly from the disk.
User avatar
sebr
Moderator
Posts
301
Karma
0
When a file is played, it generally gets loaded entirely into memory anyway. You can test this by starting to play a file, then deleting it from the disk. You'll notice it still plays without a problem since it lives in ram.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot]