But now : what will *I* be able to do about that ... ?
I'd theorize this could simply be another manifestation of a more fundamental issue we also discussed in SFS thread last week: namely, it could all be related to RAM fragmentation.
But, hey, talk is cheap - wouldn't it be great if we could somehow test this and let everyone make up their own mind?
To that end, I am attaching 2 small test programs for anyone curious enough to try!
BTW Programs are based on publicly available sample code provided by Microsoft which means there's nothing fancy there: just super-minimal console WASAPI demo. Although, I did have to modify the code a bit to make it 'Audiophile Approved' (LOL). In other words, all disk I/Os during playback have been removed: it's now a true mini version of a 'memory-based' player
)
But the point is this: both versions are
_absolutely identical_ except in the way they allocate RAM: One uses 'traditional' approach (well, maybe a bit more advanced than you'd see in Foobar, iTunes etc but no major differences) and the other uses Large Pages (which, to my knowledge, is not used by anyone, incl. XX so it's at least 'certifiably different'
).
So now you can judge for yourself (and with _your_ hardware/audio setup) if this RAM talk makes any sense at all!
Before you start playing though, we'll need to do some preparation work: by default, Large Page support is disabled by Windows as it is not something for 'typical' users/usage scenarios (and also removes precious resources from under Windows' control) so you'll have to enable it manually like this: (make sure you have Administrator privileges)
1. open Control Panel->System->Administrative Tools->Local Security Policy
2. in left panel, open "Local Policies" and click on "User Rights Assignment"
3. in right panel, double-click "Lock pages in memory": If your username is listed you're set!
4. if not (more likely), click on 'Add User or Group' and in popup click Advanced and then click Find Now: this will show all 'users' (most are 'system users'): double-click on one you are using to log-on i.e. one you will use to run test programs
5. close all dialogs with OK & make sure you appear in the list in step 3.
6. reboot (so Windows can activate our new policy)
Oh, since sample code is based on WASAPI you may also wish to play with MMCSS registry settings:
http://msdn.microsoft.com/en-us/library/ms684247(VS.85).aspxBut, if you're lazy, just download & double-click ProAudioKey.reg attachment
To run test programs:
- copy your favorite song(s) into the same folder as attached executables
- make sure you use plain 16/44.1 WAV format!
- also, please make sure your sound card is set as 'default' in Windows and format is set to CD 16/44 (if your 'normal' setting is 24/96 or whatever)
Start Command Prompt (told you it's stripped to the bone - there's no GUI or anything here...) and in the folder where you have put everything simply type:
jplay1 --file YourTestTrackName.wav
Listen.
Then, in same way, try second version:
jplay2 --file YourTestTrackName.wav
Then try with some more tracks. Also try the other way 'round or try several WAVs with one and then other version.
Then try opening your browser, Outlook, anything that eats memory - chances are, jplay2 will report that it cannot allocate memory. Then try again jplay1 - it should still work but listen how it sounds. Then reboot and try again.
Finally: share with everyone if there is any difference between two programs!
Have fun!
PS. If your sound card does not like default buffer size (1024 samples) you can change it: just type program name without any parameters for instructions....