Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Foobar Ram Disk component interaction (Read 2971 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Foobar Ram Disk component interaction

There is no documentation or Wiki at all about the component and I have some questions.
https://www.foobar2000.org/components/view/foo_ramdisk

-The ram disk is in fact using the app memory, so I presume it has the usual 32 bits limitation (?)
-Can we expect an update to use memory beyond the main app limit? (I mean... it's 2021, not 2012. Hardware has changed)
-Is there a max size setting or limit apart from the app memory limit?
-What happens if it reaches the memory limit? Does it simply crash or stop working without notice?
-Is there a way to manually flush the ram disk? Does it get flushed at some point after playback?
-Can it be manually flushed using contextual/main menus? (not opening the ram disk window)
-Is there some way to interact with the ram disk contents via SMP or command line? (not counting add/send context menus)
-What happens with duplicates entries in the ram disk? Are they copied multiple times or just once (even if the list has multiple times the same track)?
-Is this fixed (memory not clearing)? https://hydrogenaud.io/index.php?topic=116050.0 https://hydrogenaud.io/index.php?topic=93323.0
-Are Items on ram disk being cached too?
-Playback is being done at the current playlist or the ram disk window? Are we supposed to send items to ram disk and then send them back to a playlist for playback?
-Is there some way to see how many memory is being used in RAM-Disk content?

I'm trying to create a SMP script to interact with it on playback to pre-cache next tracks on the current playing playlist.
(PD: I don't want to read any comment about people not answering the questions to then ask me why someone would use a ram-disk... you know, the stupid discussions some people like to have. -stick to the thread's topic-)

Re: Foobar Ram Disk component interaction

Reply #1
Most of your questions can be answered by testing.

The ram disk is in fact using the app memory, so I presume it has the usual 32 bits limitation (?)
Obviously.
Is there a way to manually flush the ram disk?
Using View->Ram-Disk content, then remove all
Can it be manually flushed using contextual/main menus? (not opening the ram disk window)
No.
What happens if it reaches the memory limit? Does it simply crash or stop working without notice?
It will stop copying files to Ram-disk and give out error like this:
Code: [Select]
Could not process file "G:\blahblah.flac", reason: bad allocation
Files that were succesfully copied to RAM-disk before error remain there and are available for playback.
Is this fixed (memory not clearing)?
Memory is cleared when removing RAM-Disk content from RAM-disk or when foobar2000 is closed.
Are we supposed to send items to ram disk and then send them back to a playlist for playback?
Yes.
What happens with duplicates entries in the ram disk? Are they copied multiple times or just once (even if the list has multiple times the same track)?
If you are trying to send multiple copies of exactly same physical file, it is copied only once. If files are identical but they are different physical copies on HDD, each file is copied to RAM-Disk. If you add new entries of the same file to RAM-disk, it creates new copies of files in RAM even this was exactly same physical file.

Re: Foobar Ram Disk component interaction

Reply #2
Thanks for your help. Then there is now way to automate sending to ram disk via scripts, since it can not be cleared in any way without user interaction (i.e. calling menus with scripts). I could automatically send tracks to be played next, but then it will error at some point when the ram disk is full.

Also, As it is, having to send tracks to ram disk and back again (instead of looking for a match on a list of tracks cached), I see no use for the plugin, it's really impractical. You are forced to send the entire playlist to play it, or send a group of tracks, then create a new playlist with them, and after playing them all start again with other group (?). Makes no sense.

@Peter is there any plan to update the component?

Re: Foobar Ram Disk component interaction

Reply #3
I could automatically send tracks to be played next, but then it will error at some point when the ram disk is full.
You previously only asked about manual flushing of RAM-disk content. But when sending (not adding) files to RAM-Disk, its content is automatically flushed and replaced by new sent content.
I just tested. If file from ram-disk is playing, and new file is sent to ram-disk, old file is removed from ram-disk content and replaced with new file, but playback of old file is still continuing successfully.

Re: Foobar Ram Disk component interaction

Reply #4
Yep, but then...
Quote
-Is this fixed (memory not clearing)? https://hydrogenaud.io/index.php?topic=116050.0 https://hydrogenaud.io/index.php?topic=93323.0
Also, even if those bugs are fixed, having a way to flush the ram disk manually via menus is a must.  Otherwise, in the script, I would have to "send" a new track to the ram disk to flush all content, which makes no sense at all (and involves HDD reading). That's a hack, not a real solution.

Sending new tracks, thus flushing the previous ones, is an acceptable behavior for playback... but that doesn't replace an option to flush the ram disk.

And...
Quote
Also, As it is, having to send tracks to ram disk and back again (instead of looking for a match on a list of tracks cached), I see no use for the plugin, it's really impractical. You are forced to send the entire playlist to play it, or send a group of tracks, then create a new playlist with them, and after playing them all start again with other group (?). Makes no sense.
Since there is NO way to send tracks back without user interaction, there is no way to control the component via scripts.

Yes, I can send tracks to the ram disk, and "flush" the disk sending (not adding) new tracks. But you can't play them, they need to be played from the ram disk which requires user interaction and sending the cached files to another playlist.

Again, I'm at a point where the Ram Disk implementation makes no sense, since the tracks present on it should be hashed. And playing any track on a playlist should be done comparing the handle against the table of cached tracks (not needing to re-add tracks from ram disk).

Re: Foobar Ram Disk component interaction

Reply #5
You said you don't want to hear anything not related to your questions, but I'll reply any way: what you are planning is pointless and you should not expect updates to the component.
Your OS is already most likely caching the track you are about to play to RAM all by itself without any manual work. If for some strange reason that doesn't happen, you can configure foobar2000's read-ahead buffer to something large so foobar2000 will buffer the tracks to memory before playback.

Re: Foobar Ram Disk component interaction

Reply #6
Quote
TOS 5. All members that post to the Hydrogenaudio community must acknowledge and discuss only acceptable topics when starting a new thread. If posting to an already existing thread, they must continue in the vein of discussion that the thread has already manifested; if they wish to change topics, they must start a new thread.
Really don't get why some people love to do that with some topics.