MQn minimalist Wasapi WAV C++ memory player integrated with foobar2000
Mar 31, 2013 at 5:49 AM Thread Starter Post #1 of 50

sbgk

100+ Head-Fier
Joined
Mar 25, 2013
Posts
152
Likes
73
Hi,
 
this seems to be an exciting time for computer audiophiles with a number of new players becoming available.
 
I have developed a minimalist Wasapi WAV player that has several innovations not seen in other players, it was born out of my frustrations with the sound quality of other players and the desire to understand why players with so called efficient code sounded so digital and also different to each other. My hunch was proven right (to my ears, anyway) that the other players made design compromises that introduced noise to the sound at critical sections and that by carefully checking and rechecking the sonic impact of every constituent part of the code/build and using optimisations for speed as much as possible the noise could be reduced to a minimum.
 
It is minimalist, there is no user interaction, it just loads a file into memory and renders it to the default audio device. It is gapless, but can only play files of the same bit depth/sample rate at a time.
 
It is WAV only at the moment, but I plan to modify the MQn.bat file so that sox can be used to convert FLAC etc to WAV before loading to memory.
 
Innovations are optimised render loop, page aligned memory, optimised memcpy, Visual Studio 2012 compile using the latest optimisation techniques, auto vectorisation, profile guided otimisation, use of Intel C++ libraries during build, each setting has been tested to ensure best sound quality, fixed period sizes to align with memory page size, each sample rate/bit depth combination has it's own render loop, use of goto in loop rather than for/while, static libraries, single core compile etc
 
It is free.
 
I use it on quite a revealing and neutral system NAD M51 dac, Linn Klout power amp and ATC SCM 20 speakers, so any weakness in players is apparent. I do use beyerdynamic headphones on my bedroom system.
 
I am posting this on head-fi.org because I feel that the community here are a bit more interested in sound quality than most and am interested in any feedback to see how it compares to other players, have already had good feedback from users in AA and CA.
 
it requires 64 bit win7/8 and an x64 intel cpu with as much ram as required. bit rates supported are 16 bit 44/48 and 24 in 32 bit container 44/48/88/96/176/192
 
there is no install, just download 3 files (mqn.exe, paste.exe and mqn.bat) into a directory eg c:\MQnPlayer, copy the required WAV files or folder to the clipboard and double click MQn.bat. the console will close automatically after play finishes or can be closed down manually to stop play.
 
it can be controlled via foobar2000, see MQnfoobar.txt in the download link
 
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
 
it doesn't seem to get on with the JPlay windows service or fidelizer, due to them setting the system timer to 0.5ms (introduces a digital sound), so stop them before using MQn
 
here is the text from the MQnreadme.txt file
 
MQn - Just good music is a minimalist WASAPI Wav memory player that is stripped back as far as possible to reduce noise.

Innovations are optimised render loop, page aligned memory, optimised memcpy, Visual Studio 2012 compile using the latest optimisation techniques, auto vectorisation, profile guided otimisation, use of Intel C++ libraries during build, each setting has been tested to ensure best sound quality, fixed period sizes to align with memory page size, each sample rate/bit depth combination has it's own render loop, use of goto in loop rather than for/while, static libraries, single core compile etc.

example render loop for 16/44 shown at bottom of this file.


requirements are x64 Intel cpu with x64 win 7 or x64 win 8 and as much ram as you need to load the music you are about to play.

It plays 16 bit 44/48 in 16 bit containers and 24 bit 44/48/88/96/176/192 in 32 bit containers.

To play music just highlight the wav files/folder required, right mouse click and select copy to load the filenames into the clipboard

then just double click on MQn.bat

Installation - there is no installation or registry modification

Just download the MQn.bat, paste.exe and the latest version of the MQn.exe that meets your needs (see below) to a directory eg c:\MQnPlayer
 

Why the different versions - each version has the release point for the data to the device buffer optimised for a particular device

There are 3 options - the normal method of loading the buffer is

1. MQn.exev3 - normal method

 buffer event triggered -> get next buffer from device -> load buffer -> release buffer, so release point is last thing that happens

2. MQn.exev1 - buffer preloaded from previous loop

 buffer event triggered -> release buffer -> get next buffer from device -> load buffer, so release point is first thing that happens

3. MQn.exev2 - buffer preloaded from previous loop

 buffer event triggered -> load buffer -> release buffer -> get next buffer from device, so release point is first thing that happens

Just try the different versions and use the one that works/sounds best

MQn.exev1 is for realtek laptop drivers/HDMI and some dacs

MQn.exev2 is for usb eg I use it for my MF Vlink 192 usb/spdif convertor

MQn.exev3 is a vanilla version and should work with everything, but sound very slightly compromised compared to v1 and v2

rename the one selected to MQn.exe

optimisation tip - right mouse click on MQn.exe and select properties, then select compatability and tick

 disable visual themes, disable desktop composition, disable display scaling on high DPI settings and rune as an administrator

 then click apply


example render loop

    loop1644:

    
        
        WaitForSingleObject(hNeedDataEvent, INFINITE);

        
        pAudioRenderClient->ReleaseBuffer(1024, 0);
        pAudioRenderClient->GetBuffer(1024, &pData);
        A_memcpy (pData, sound_buffer += 4096, 4096);
        
        

        
    goto loop1644;
 
Apr 2, 2013 at 2:03 AM Post #2 of 50
I have just release vx.6 which switches off the desktop window manager's use of MMCSS leading to a dramatic improvement in the amount of detail obtained and a fantastic 3d sound stage.

https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
 
 
Apr 7, 2013 at 4:34 PM Post #3 of 50
Just released MQn version x.14 with flac play capability

download from

https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541

version x.14 needs the MMCSS and DWM services to be disabled for best sound quality, there are instructions in the MQnMMCSSDisable Readme.txt file (requires a small registry edit)

Have also uploaded a method of playing flac files with MQn using sox to decode them to wav before playback start, there are instructions in the readme file in the MQnFlac.zip

version x.14 is a big step up from v x.6

1. I had implemented MMCSS the wrong way round so that it was affecting the sound quality, I experimented with the recommended way and finally came to the realisation that MMCSS was bad for sound quality, so v x.14 doesn't use MMCSS and it is recommended that MMCSS is disabled. MMCSS is there so that cpu intensive media apps are not affected by other system loads, MQn is not cpu intensive and is a constant load so doesn't need another process (MMCSS) switching threads and priorities in and out for what is a non existent problem (MMCSS is designed for a heavy periodic cpu load and then a period of no load).

2. I had set the priority of MQn too high so that it was affecting critical system processes and sound quality, v x.14 priority has been lowered to the best setting for sound quality.

3. Intel have updated their c++ libraries, the new ones provide quite a step up in sound quality.

the future - plan to have pause and track skip back/forward and a more comprehensive decode ability. The decoding is done in the MQn.bat file so if anyone wants to have a go at setting it up to handle other formats then feel free.
 

 
 
May 7, 2013 at 4:23 PM Post #6 of 50
have uploaded a version which allows control of mqn - version mqn.exev2.50 control

space bar to pause/resume, less than sign to skip track back, greater than sign to skip track forward, M to skip 5 seconds back and / to skip 5 seconds forward, it is not case sensitive.

Unfortunately there is a slight hardening of the sound due to the extra thread, but it shows what can be done. Am looking at other ways so that the sound is not affected.

Also uploaded a much improved version of mqn - version x.47, this version has the buffer set to 8192 for all resolutions and also stops the console and associated input/output/output streams. The impact on the sound quality is pretty breathtaking, perhaps one of the biggest improvements so far.

need to use mqnstop.bat to stop mqn version x.47 as it is no longer associated with the console, so just download mqnstop.batbak and rename it to mqnstop.bat and create a shortcut on the desktop.


https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541

I'm going to make a bold statement and say this is the best (free) windows player out there. If you have heard anything as sweet or detailed then please let me know, because I haven't.

It has taken a while and I have been guilty of hyperbole with previous versions, but this is the real deal, absolutely stunning.

I have posted a 2.50 and a 2.46 atom control version, but the sq is inferior, but it's there anyway.
 
May 7, 2013 at 4:25 PM Post #7 of 50
Hi,
 
Mqn is mostly optimised for intel 64 bit, but I can do an amd build. If you find out which version works with your setup, then I'll build that version.
 
cheers
 
 
May 7, 2013 at 4:27 PM Post #8 of 50
Hi,
 
Did you try it. If you are still interested I would recommend the latest version 47, the sound is the closest to a live performance I have heard and sweet sounding too.
 
cheers
 
May 21, 2013 at 4:50 PM Post #9 of 50
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541



new version, quite a major upgrade in sound quality, think this is the final version in terms of SQ.

to quote one tester who came from mpdpup

"I am thoroughly enjoying 2.79 I can tell you. So far ahead of anything
I have ever heard from my system."

"2.79 is just breathtaking. I could listen to 2.79 all night and it just encourages one to turn up the
volume (always a good sign). Astonishing detail which i could never have
believed Red Book could contain."
 
no one in head-fi want to try the life changing experience of listening to MQn ? It's only the most detailed, free flowing, rhythmical undigital music player you will ever hear. If I am wrong then your money back and you can tell me which player is better.
 
As a statement of how revolutionary MQn is I can reveal that my ideas have been attacked by 4 leading player developers who said they wouldn't work, the most vociferous attack being from the creator of JEI who said I was a hacker. So if they are attacking MQn then shouldn't you give it a try and see what they are afraid of.
 
 
May 26, 2013 at 6:36 AM Post #11 of 50
@sbgk
 
Could not run WAV's other than 16/44
On other formats (24/44, 24/96) cmd window shows up & disappear. 
Sound card accepts 32-bit data ('containers') no problem. 
 
- W7x64SP1Ult / c2d e8400 / 8gb ddr3
- Infrasonic Quartet 24/192
 
Thks,
Nik
 
May 27, 2013 at 1:10 AM Post #12 of 50
Quote:
@sbgk
 
Could not run WAV's other than 16/44
On other formats (24/44, 24/96) cmd window shows up & disappear. 
Sound card accepts 32-bit data ('containers') no problem. 
 
- W7x64SP1Ult / c2d e8400 / 8gb ddr3
- Infrasonic Quartet 24/192
 
Thks,
Nik

 


Hi,
 
thanks for trying it, there is a 32 bit container version in the testing folder, can you see if that works ? It hasn't been updated for a while.
 
http://rapidshare.com/files/300120799/mqn.exe2.1432bitcontainer
 
there is also a wasapi test exe
 
http://rapidshare.com/files/506046217/WASAPI_test.exe
 
if you run that in a dos prompt it will output which formats the device can play
 
May 27, 2013 at 1:26 AM Post #13 of 50
am finalising a version that allows control of MQn, it acts very much like lifting the needle on a turntable, ie the user makes a change and returns the player to best quality, other players use other threads or are constantly checking for user input, both of which affect the SQ.
 
it uses a mqncontrol.exe as well as mqn.exe
 
while mqn is playing music, the user can press a key and a separate console appears where the user can pause, fast forward\rewind and skip tracks forward/back.
 
what happens is that mqncontrol.exe changes the page protection of the mqn sound buffer to no access, this way the render loop doesn't need to check for user input and mqn doesn't need a separate thread to be constant;y running.
 
mqn immediately throws an exception as it cannot read the sound buffer
 
mqn has an exception filter which is called, this starts a menu thread and resets the page protection so the music can keep playing
 
the menu thread opens a new console and waits for user input
 
the user makes changes and presses x to exit the menu console/thread
 
the menu thread is stopped
 
mqn is returned to highest SQ state.
 
will be released next week
 
Jun 7, 2013 at 12:25 PM Post #15 of 50
version x.82, been playing it for a few weeks and have failed to improve on it, so it's as good as non control mqn is going to get. The control version will have a smaller player.exe so may sound better.

really just tuned the memory settings, hard to believe there is one setting that affects treble and one bass, so was a matter of finding the optimum settings.

definately the last update before a control version release.

https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
 

Users who are viewing this thread

Back
Top