INTERACT FORUM

More => Old Versions => Media Center 17 => Topic started by: mojave on April 15, 2011, 04:45:52 pm

Title: Bug: Play files from memory
Post by: mojave on April 15, 2011, 04:45:52 pm
Today I downloaded an album from HDTracks. It is 24/96 in FLAC. After the first track downloaded I was able to play it in MC. Later I tried to play the whole album and the first track refused to play. I get the message "Failed to open the file. File may be corrupt or missing." I switched the decoder to madFLAC and the file plays fine. I then downloaded and tried the file with Foobar2000 and it plays fine. I switched MC back to Automatic and the file won't play. I also converted the file to ape using madFLAC as the decoder and the file still won't play. I checked all the tags to see if something accidentally was changed but can't find anything.

The file size is 249 MB (an 11 minute song) and I decide to uncheck "Play files from memory." The song now played! Evidently since the first time I played and later I had opened many more applications and used up too much memory. I have 3 GB of memory, and the resource monitor is showing 2184 MB in use, 814 MB in standby, and 36 MB as free.

If there isn't enough memory, the file should still play as if "Play files from memory" isn't checked.
Title: Re: Bug: Play files from memory
Post by: Alex B on April 15, 2011, 05:18:42 pm
It might be buggy.

IMHO, it is a stupid option anyway. File reading in real time is an easy task for a modern computer. Probably just moving the mouse cursor consumes more CPU. Disk activity happens all the time and if it affects playback the computer is broken. Also, if the file is coming in through a slow wireless LAN and the bandwidth is too narrow for hires files, full file buffering is not the right solution. Buffer underflows will occur sooner or later anyway.
Title: Re: Bug: Play files from memory
Post by: Matt on April 26, 2011, 10:14:28 am
I haven't been able to reproduce this. 

If I play a normal FLAC file (smaller than 256 MB), the whole thing goes to memory.

If I play a 400MB FLAC file, 256MB of the file is kept in memory at once.

Out-of-memory errors should be impossible unless you've disabled swap in the OS or the Media Center process has already allocated about 3 GB (which would only happen from a leak).  Maybe you could check the process memory usage of Media Center when this happens?

Thanks.
Title: Re: Bug: Play files from memory
Post by: mojave on April 26, 2011, 11:14:40 am
I just tried to playback the file again and had the same error. I then deleted the virtual memory paging file, rebooted, and recreated the paging file. Now playback works fine with "Play from Memory" checked. Evidently the paging file had some corruption.
Title: Re: Bug: Play files from memory
Post by: Matt on April 26, 2011, 01:25:45 pm
As an aside, I would recommend leaving 'Play files from memory' off unless there's something special about your configuration.
Title: Re: Bug: Play files from memory
Post by: mojave on April 26, 2011, 03:58:23 pm
I'd like to think there is something special with my configuration.  :D

From a technical perspective, why do you recommend not using it?
Title: Re: Bug: Play files from memory
Post by: Matt on April 26, 2011, 04:56:09 pm
From a technical perspective, why do you recommend not using it?

It uses memory and switches I/O from smooth (gradual reads while playing) to lumpy (full speed read at the start of a file).  It doesn't change the data that gets delivered to the soundcard.

However, there are plenty of users that disagree with my recommendation.  In fact, there are a few threads where users are requesting the ability to tune how memory playback is done (allocation size, page locking, etc.) to make it even better.