![]() ![]() |
Audio Asylum Thread Printer Get a view of an entire thread on one page |
For Sale Ads |
86.140.246.157
Having just been involved in the JPLAY v5 beta testing and tried numerous different players I was still disappointed with the sound. This prompted me to start investigating why they sound so different, I still don't know not being a c++ developer, but with access to VS2010 I have been able to modify the play.cpp file in the project below and compile it to what I think is a big step forward in SQ.
There are only so many ways a file can be rendered to an audio device so I tried optimising the steps that were already there.
Now a good c++ developer will put all sorts of checks and error trapping in the code, I have effectively removed as much as possible of these so the code is doing the minimum in the render loop, of course not being a c++ developer I can do this. I guess the lesson is that the render loop is very important to the SQ and i would think in many cases could be optimised further.
The original project is linked below
http://blogs.msdn.com/b/matthew_van_eerde/archive/2009/04/03/sample-wasapi-exclusive-mode-event-driven-playback-app-including-the-hd-audio-alignment-dance.aspx
My code is in the link below, compiled for MS win 7 64 bit, it uses the default playback device, just copy the files into a folder called for example MusicPlayer, then just copy a 16/44.1 wav file or folder name containing 16/44.1 wav files and double click on sp.bat to play. have included the unoptimised file as well called playerextreme.exe.bak so a comparison can be made with the original. There is no pause or stop or gapless mode, just close the cmd window to stop. It only plays 16/44.1 wav files. I can honestly say it is the best SQ I have heard from my system.
http://rapidshare.com/users/playerextreme/3363
Follow Ups:
Hi SBGK,Outdoor weekend has been cancelled.
So lots of time for my audio computer setup.
:-)
I have no extra Win7 64 CD at hand.
Might it work on XP x64 also?[edit] XP x64 has no wasapi :-(.
So XP x64 won'tSorry for asking
Mark
Tiny Core Linux + DeadBeef > ESI Juli@ > Van den Hul Optocoupler > Lavry Black DA10 > Vovox Sonorus Direct S > Klein & Hummel O300
Edits: 09/06/13
download win8.1 preview ?
uploaded 2.27, sound is pretty revolutionary
Hi SBGK,I was not repaired for this, what a superb sound quality !!
I can't see anything left too wish for on sound quality.
This is it. It was some sort of an 'enlightening' experience.
Without any tuning to the WIN7 OS system at all, it sounds soooo good!
Looking at the number of downloads, I would like too say too other inmates:
Do try !! You don't know what you miss on Sound Quality!BTW, I red the very unpleasant conversation on the computeraudiophile forum between you and the developer of HQplayer. I'm very glad you stayed motivated and continued work on your player. HQplayer doesn't sound bad, but your player sounds much (!!) better than HQplayer. In my view, he is just pissed because your player is free (your free player is a threat for his sales)
I could not find my way around your downloads.
I could not locate version number 2.27, so I downloaded mnqplay.exe 3.10 sse4 intel.
Is this the one?I'm now trying too get this work on Foobar, hoping it will get more user friendly.
I would like to play my favorite classical piece, Akhnaten from Philip Glass, gappless.Thank you for developing such a player!
It shows the way too other developers.Mark
Tiny Core Linux + DeadBeef > ESI Juli@ > Van den Hul Optocoupler > Lavry Black DA10 > Vovox Sonorus Direct S > Klein & Hummel O300
Edits: 09/10/13
just removed another chunk of code from the assembly code with good results
have uploaded 2.31 sse4 intel
gets you that bit closer to the music
nt
Tiny Core Linux + DeadBeef > ESI Juli@ > Van den Hul Optocoupler > Lavry Black DA10 > Vovox Sonorus Direct S > Klein & Hummel O300
![]()
I can't find 2.31 sse4 intel.
Do I look at the correct place?
This is what I see:
Tiny Core Linux + DeadBeef > ESI Juli@ > Van den Hul Optocoupler > Lavry Black DA10 > Vovox Sonorus Direct S > Klein & Hummel O300
thanks, glad you enjoyed it, I am listening to 2.30 sse4 intel eax as the preferred version at the moment. There are plenty of improvements still to come.
There is some info about foobar integration on the rapidshare site a readme file and .bmp file.
To select more than one file you just need to select the files you want to play in explorer and right mouse click and select copy (to copy to the clipboard) and then double click on mqn.bat or use foobar2000.
No developer has been particularly friendly about my efforts, but then developers are quite arrogant, that's why I had to write my own player. Yamamoto2000 was very helpful , but even he was sceptical about what I was trying to do.
am using ws2012 for a better sound than win7/8
I would like to hear the same techniques as MQn on a Linux player on puppy, maybe a winter project.
I just downloaded a 180 day trail version of the Windows Server 2012.
What installation option did you use?
- the Server Core Installation
- or the Server with a GUI?
There where several versions 2.3 too chose:
mqnplay.exe 2.30 sse4 intel al v2
mqnplay.exe 2.30 sse4 intel eax
mqnplay.exe 2.30 sse4 intel eax 64
I downloaded the mqnplay.exe 2.30 sse4 intel al v2 version for my setup:
* MoBo:
GA-HA65M-UD3H-B3 (rev. 1.0)
Intel® H61 Chipset
Northbridge: Intel Sandy Bridge rev. 09
Southbridge: Intel H61 rev. B3
* RAM
4 GB Dual channel DDR3 532.1 MHz
* Processor
Celeron G530 2.40GHz Socket 1155
Is 'mqnplay.exe 2.30 sse4 intel al v2' the correct version for my setup?
Mark
Tiny Core Linux + DeadBeef > ESI Juli@ > Van den Hul Optocoupler > Lavry Black DA10 > Vovox Sonorus Direct S > Klein & Hummel O300
you need gui as core deletes wasapi capability
just uploaded mqnplay.exe 2.31 sse4 intel, so try that one, I think it is spectacular. The older versions are in the archive directory, 2.30 sse4 intel eax would be the closest comparison.
you just need sse4.1 instruction set which you have. the next step up is haswell which has 256 bit registers, sandybridge has 256 bit registers, but you can only load 128 bit at a time and write 256 bit, haswell you can do both at 256 bit, I only have 128 bit registers so can't develop for 256 bit yet.
nt
Tiny Core Linux + DeadBeef > ESI Juli@ > Van den Hul Optocoupler > Lavry Black DA10 > Vovox Sonorus Direct S > Klein & Hummel O300
that version wasn't quite right either, have uploaded a 2.31 sse4 intel rax version
have uploaded 2 more versions as there is more than 1 way of doing things 2.31 sse4 intel r9 and r11, am liking r9 at the moment.
" have uploaded 2 more versions as there is more than 1 way of doing things 2.31 sse4 intel r9 and r11, am liking r9 at the moment. "
I also like these last two versions better than the version you uploaded (and removed) before these 2 last. That version sounded too bright in my system and also sounded somewhat 'brittle', 'stressed', 'strained'. Don't know the exact word. But the sound was not okay.
Only listened too r9 yet. want too try r11 tonigt or tomorrow.
Checking the download-area just now, I see you uploaded some news version again. Is there some info (in the MQnreadme.txt perhaps) on the meaning of these new file extensions?
Mark
Tiny Core Linux + DeadBeef > ESI Juli@ > Van den Hul Optocoupler > Lavry Black DA10 > Vovox Sonorus Direct S > Klein & Hummel O300
uploaded 2.35 which I hope sorts the bass out
Had computer problems which are resolved now, find I can no longer download any of your latest MQN player versions from Rapidshare.
more details and link here
http://mqnplayer.blogspot.co.uk/
Thanks for your new link, have downloaded 2.44 sse4 intel, this version is by far the best so far, thanks a lot.
you obviously haven't heard 2.48 sse4 intel then
HI SBGK,[edit: let's continue here: http://www.tirnahifi.org/forum/viewtopic.php?f=8&t=2418
Your MQn-player is just too damn good.
If it threatens the commercial interest of commercial software players, commercial media server manufacturers and CA's infomercial website, than: so be it. “If it doesn’t kill you, it will make you stronger”
My sincere sympathy.
Take a pause, and than continue.
MQn is just too damn good !!Hope too hear from you soon.
Mark
Server 2012 + foobar > ESI Juli@ > Van den Hul Optocoupler > Lavry Black DA10 > Vovox Sonorus Direct S > Klein & Hummel O300
Edits: 10/07/13 10/07/13 10/07/13 10/07/13 10/07/13
if it's that good then surely they would copy it, anyway look forward to the future.
http://mqnplayer.blogspot.co.uk/
Great to see you back in the saddle sbgk, CA have no idea on what they passed up on here, best player on the planet bar none!
Audio PC-CAPS Zuma on MQN & Teddy Pardo 12v 4a supply & 5v 3a supply, PPA USBv2 card, PPA CF Card Sata OS Drive, PPA Red Sata cable for OS, Server Core 2012 R2, Meitner MA-1, Conrad Johnson Premier 17LS, Art Audio Maestro monos, Quad
Good to see that little CA hiccup didnt stymie your output sbgk.
I suspect house training may take a little longer LOL.
do you really think it was my fault, poor moderating is always to blame, how is it acceptable to troll like that ? some can give it out, but can't take it, same with all schoolyard bullies
anyway I find it hard to navigate the threads/posts here so am over at http://www.tirnahifi.org/forum/viewtopic.php?f=8&t=2418 from now on
http://mqnplayer.blogspot.co.uk/
"do you really think it was my fault"
What I think? Of course it wasn't your fault. Period.
Just read about your predicament/ban/reinstatement on the other web site and was very disturbed about the way this was handled.
I am very pleased with your MQn player using the various versions you created and had a hard time keeping up, but enjoyed every
minute of it listening to your player, sincerely hope you will continue working on the MQn player for the benefit of us who use your
player for our musical enjoyment, after all it is an incredible computer player.
Another CA refugee here...
2.60 sse4 intel 8 add best of the 2.60 serie. Very, very well balanced sound and full of details. Like it so much.
Well done , the beat goes on.
Yes...it is not just good, it changes the world of computer playing music, at least in Windows environment!
Hello sbgk and refugees from CA.
Lets hope we can continue enjoying sbgk's developments of his player without all the angst at least for a little while.
Have uploaded 2.60 sse4 intel 8 add, bit more bass and detail than the other 2.60 versions
http://mqnplayer.blogspot.co.uk/
look on the computer audiophile thread for more info
http://www.computeraudiophile.com/f11-software/visual-studio-2012-c-and-wasapi-minimalist-player-15401/index21.html
right where were we, 2.32 had a bug which caused a cache miss at the start,oops, that's why it sounded a bit rough. Have uploaded 2.33 sse4 intel rel which is the fixed version, 2.33 sse4 intel buf buf which is another way of doing things, 2.34 sse4 intel buf buf no xmm which is a warmer version, 2.34 sse4 intel buf buf no xmm nopgo which doesn't have profile guided optimisation and finally the famous 2.34 nopgomemcpy which is an updated version of the original. I like the 2.34 sse4 intel buf buf no xmm version, the nopgomemcpy has good bass, but digital sounding on my system - it uses the original memcpy function
as you have 2 cores use the mqncontrol.exe instead of mqncontrol.exe 4 core and it will put mqnplay on core 1 and everything else on core 0
I had a wrong instruction in the 2.31 version which made it sound thin, have uploaded a correct version - called it the same name, the other version has been moved to the archive
you have a Celeron, saw sandybridge in the mb description
http://ark.intel.com/products/53414
says you have sse 4.1
there are a number of ws2012 tweaking threads on the jplay site, have used the first 2 parts of http://jplay.eu/forum/computer-audio/windows-server-2012-from-gui-to-core-the-easy-way/
had to rebuild after the last part, so be careful.
changed cpu % min/max to 0 in the power plan settings - use high performance and also switched off the allow windows to switch off this device setting in the usb power settings tab - see device mgr
Hi SBGK,
This looks to be some very interesting work you're doing. I'm wondering if there's anything you're doing that may be applicable in a more general way as optimizations that can be done in a system running Win 7 64 bit with Fidelizer and J River? This is about the only thing I could see that might be applicable:
"needs mmcss enabled and set to start automatically
advise setting the background only setting of mmcss pro audio setting to True
regedit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Pro Audio
change Background Only to True"
I would be interested in experimenting with any suggestions you might have.
Thanks,
Bill
fideliser doesn't ssem to agree with mqn, think the system clock being set to 0.5ms is the issue. if you really want to get rid of the digital glare the only solution I found is mqn.
some good tips here
http://jplay.eu/forum/computer-audio/windows-8-optimization-script/
if you know what you are doing you can alter the priority of interrupts
Start by opening the System Information utility (msinfo32.exe), and navigating to System Summary\Hardware Resources\IRQs to view the IRQs in use on your system, and the devices using them.
make a .reg file with the following
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PriorityControl]
"Win32PrioritySeparation"=dword:00000018
"IRQ4294967294Priority"=dword:00000099
"IRQ13Priority"=dword:00000099
"IRQ0Priority"=dword:00000099
"IRQ8Priority"=dword:00000000
"IRQ22Priority"=dword:00000000
"IRQ1Priority"=dword:00000099
"IRQ12Priority"=dword:00000099
Hi SBGK,
Thanks for the response. I went to the jplay link you posted and found a lot of good information. On the first page of that topic I got onto this link which I found to have some great information:
http://www.computeraudiodesign.com/Windows%20Modifications/CAD%20Windows%20Software%20Modifications.pdf
I went through the entire document and did almost every suggestion he made. It took the better part of the day (including troubleshooting BSOD caused by one of the registry changes to disable services/drivers). I'm convinced it made a noticeable change for the better.
One question I have is based on your suggestion to:
"make a .reg file with the following
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PriorityControl]
"Win32PrioritySeparation"=dword:00000018
"IRQ4294967294Priority"=dword:00000099
"IRQ13Priority"=dword:00000099
"IRQ0Priority"=dword:00000099
"IRQ8Priority"=dword:00000000
"IRQ22Priority"=dword:00000000
"IRQ1Priority"=dword:00000099
"IRQ12Priority"=dword:00000099"
I see you have IRQ's with the same priority. From page 29 of that pdf I linked above, he specifically comments that it's not recommended to have IRQ's with the same priority. using his guidelines, I did modify my IRQ priorities and had no issues. I'd be curious to hear your thoughts on using same priority level for different IRQs.
Thanks,
Bill
Those are the settings I use and haven't noticed any issues. Think the one that makes the big difference is the "IRQ4294967294Priority"=dword:00000099 ie Intel graphics media accelerator.
Could try giving them different values, but it already has a nice effect.
some good stuff on the JPlay forum, they are always trying to push the boundaries and seem to be open minded about trying things.
Have also used total commander which makes quite a difference.
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
Have finally got the mqncontrol.exe and mqnplay.exe programs working
control reads the selected files and calculates the total storage required
it then starts up mqnplay, passing the storage and format requirements
mqnplay allocates the virtual storage and initialises the required device
control then loads the music into mqnplay's storage
mqnplay then renders the music
quite a big jump in sound quality, surprising really, but still builds on the mqn fundamentals.
I would describe it as listening to music is more of an emotional experience now rather than listening to hi-fi.
mqnplay.exe is 87 kb in size, mqn used to be 184 kb, so a lot of code reduction by having mqnplay perform fewer tasks.
should be ready for a release in a weeks time.
Hi SBGK:
Waiting anxiously.
Very much thanks for your efforts.
Juan
https://rapidshare.com/#users|459800...a4b6194c|11541
have uploaded a mqncontrolexe2.100v6 and mqnplay.exe2.100v6
if you use the 1 or 3 versions you'll have to wait.
it doesn't have control functions yet, but the sound quality is so phenomenal that some may want to try it. You might as well, since once you've heard it you won't be going back to any previous version of mqn.
put the mqnplay.exe in a folder on the c drive called mqnplayer, shall fix this limitation later)
put mqncontrol.exe in the same directory as you have mqn.exe, delete mqn.exe and rename mqncontrol.exe to mqn.exe
change the mqnstop.bat file to stop mqnplay.exe instead of mqn.exe
get ready to hear your music collection as you've never heard it before.
only plays 16/44.1 files at the moment.
https://rapidshare.com/#users|459800...a4b6194c|11541
have uploaded the control version and updated the mqn.bat and mqnreadme.txt file. the new version uses mqncontrol.exe and mqnplay.exe. works with 16/44.1 up to 24/192, it is possible to crash the control by pressing the keys too quickly, but treat it with respect and it works.
only version 2.0 at the moment, shall release the others when I get time.
The control works by setting the page protection setting of the sound buffer to no access, the player immediately throws an exception and the control instructions are fed to the player by the controller writing bytes to a spare section of the sound buffer, the exception triggers an unhandled exception function and this function moves the pointer in the sound buffer and then sets the page protection back to the original setting and play recommences. pause is done by the controller setting the player into debug mode.
The sound quality is the best I have heard, it makes quite a difference having a small dedicated player exe, I though 16/44.1 was good, but the hirez SQ is much improved as well.
That's the end of this little experiment, I have proved to myself that the player is responsible for a large slice of the SQ pie and others seem to appreciate the efforts.
As it stands it could be developed further to be integrated with foobar etc, but I don't have the inclination as SQ was my main goal.
I am considering writing my own version of A_memcpy dedicated to copying 8192 bytes, so that may improve things further. Will also look at an ASIO implementation and maybe KS for WS 2012 use.
SBGK,
Thanks for your efforts. Your player only plays 16/44.1 WAV files at the moment, correct? No lossy files or codecs?
there is a description of how to modify the mqn.bat file to play flac files using sox as a decoder, so anything that sox can decode to will be available so long as it decodes to 16/44.1 wav minimum. the idea was that you are not going to get maximum quality from lossy formats and there are plenty of players that can play lossy streams etc.
cheers
have finalised the SQ of mqnplay (at least for my intel i3 capabilities with 16x128 bit registers), will address 256 bit registers when I get a haswell cpu, presumably they are going to be twice as good (noise wise) as 128 bit registers.
you need sse to use this, check using cpuz.
Have uploaded mqnplay2.0 memcpy final to
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
I haven't heard anything so good before, just my opinion.
have also uploaded mqnplay.bat that I used to compare different versions
operation is to select a track and start it normally via mqn.bat, then stop it and double click on mqnplay.bat
the code for playing a version is
taskkill /fi "PID gt 0" /IM mqnplay.exe /F > nul
taskkill /fi "PID gt 0" /IM mqncontrol.exe /F > nul
del mqnplay.exe
copy "mqnplay.exe pf x 2 split new" mqnplay.exe
start MQncontrol --file ".\Files.txt"
powershell -command "Start-Sleep -s 80"
so, to add another version or remove a version just add/remove that block of code, change the line
copy "mqnplay.exe pf x 2 split new" mqnplay.exe to copy the desired version
change the 80 to the desired no of seconds to listen to, the track will play for 80 seconds for each version and loop back to the start.
have uploaded the final versions which I used before settling on the memcpy final version, they are
mqnplay.exe pf x 2 grp, mqnplay.exe pf x 2 split shift, mqnplay.exe pf x 2 split shift x 2, mqnplay.exe pf split x 2
turns out memcpy is absolutely critical to the SQ of the player, the aim is to ensure the maximum amount of data can pass through the cpu as quickly as possible, hardware prefetch gave a digital edge to the sound, so had to tune the software prefetch to ensure the data was close to the cpu to minimise cache misses.
there are a couple of tweaks for hirez formats, but that's the finished article for 16/44.1. will implement affinity setting in mqncontrol so that mqnplay has a dedicated core and also look again at control.
Dear SBGK:
No files on the link!!!!!!!!!
Waiting for version 1.0.
The best Win player to me
Thanks for the efforts
Juan
have uploaded the mqnplay.exe 3.1, 2.1 and 1.1 versions so more dacs should be able to use it.
also uploaded a new version of mqncontrol.exe which has better load performance
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
The sound is pretty outrageous now or sublime depending on your taste in music.
the latest changes include optimised memcpy, code tidy up and render loop unroll
that's it for sound quality, am still working to get the control working without affecting the SQ.
realise that last version was a bit bass heavy, I though unrolling the render loop to the maximum size would sound better, but it turns out the code needs to fit into the instruction set efficiently. Have uploaded mqnplay2.2 with the optimum render loop unroll and some more tweaks to memcpy. This is about as good as I can make it and am pleased to say am getting some serious interest in it.
have uploaded the 1.2 and 2.2 versions of mqnplay
if you have a core i3,5,7 etc cpu with sse 4.1 (check using cpuz) you might be interested in the mqnplay.exe 2.7 sse4 intel version I have just uploaded. It takes advantage of the streaming load sse4 movntdqa instructions which increases the speed of memcpy by x 4. The effect on detail is quite dramatic, I have never heard my music played with such detail and lack of digital edge. Just another reminder that what you are listening to is the efficiency of how the cpu moves data from one memory location to another.
for lesser cpus there is mqnplay.exe 2.5 sse2 intel which uses an L1 cache buffer and sse2 streaming writes
Am satisfied that 2.10 is a big enough step up in SQ so have uploaded sse2 and sse4 versions of mqnplay.exe 3.10 and 1.10 for the non version 2 users.
http://my.rapidshare.com/sbgk/11541
Have also uploaded a no affinity setting version of mqncontrol.exe as someone was complaining that he wasn't able to work on his laptop at the same time.
the sse4 version needs sse4.1 instruction set on your cpu, check using cpuz
have been playing about with developing my own masm optimised version of memcpy using sse4 streaming reads and sse2 streaming writes as described in the article below, am very happy with the results. the sse4 version uses movntdqa for streaming reads and the sse2 version uses movdqa, so you can compare the sse2 and sse4 version to see if there is an improvement using sse4, I think there is a big difference in the SQ between the two.
http://software.intel.com/en-us/articles/copying-accelerated-video-decode-frame-buffers
version 2.7 of MQn was recently compared to jplay in a 1 and 2 player setup and they liked MQn better in standalone and thought jplay had more body and staging in the 2 player setup. That was using version 2.7 sse4 which sounds pretty awful compared to 2.10 sse4/sse2, so not a bad result.
Have downloaded the latest files you suggested to run your player to try, at this point it is not working I am running Win7 Ultimate also changed the file location in your Batch file.
Did install the files on a different drive other than C which should not make a difference?? but who knows.
depends what you mean, think there was an issue with someone who installed mqnplay.exe on a different drive to the other files. could it be the file renaming issue you had before. did you remember to change the directory reference in mqn.bat ?
am just going to maintain my MQn thread in computer audiophile from now on. Any issues just ask a question over there.
have been using both mqnplay.exe 2.15 oword 512 and mqnplay.exe 2.15 v4 sse4 intel and find them to be excellent sounding, set up is so I can can use either.
Where is the Computer audiophile forum could not find it.
try http://www.computeraudiophile.com/f11-software/visual-studio-2012-c-and-wasapi-minimalist-player-15401
Have downloaded mqnplay.exe 2.19, mqncontrol.exe 4 core affinity and mqn.exev3.5_24bit all these file are working fine under win7 ultimate,
the differences between all these versions are very subtle, version 2.19 seems to be the best compromise at this point, thanks again for a very fine wasapi 16/44.1 player.
3.5+24bit was an attempt to get 24 bit in 24 bit container working for those with 24bit dacs - not a proper release. didn't think 2.19 change was subtle at least not on my system. control 4 core was for people who have 4 physical cores who were getting problems when mqnplay was out on 1 and everything else on 0, it puts mqnplay on 1 and everthing else on 0,2 and 3.
Have just listened to your latest version 2.26 which is at this point the best you have created, the bass is strong and tight and the good tone and detail is not affected still remaining very musical.
it's a bit too strident, but plenty detail
the difference between 2.19 and the 24/96 version is very subtle the 24 bit version seems a bit layed back and just a tad more relaxed, whether this is better at this point I do not know.
was it working before or is this the first time you have tried it ? what versions are you trying ?
can you rem out the @echo off at the start of mqn.bat and un rem the pause at the end of mqn.bat and try running it again and send me the output, use PM if you want to keep it private. think there have been issues where someone had the mqn.bat on a different drive to the exe's.
BTW forgot to mention I am running MediaMonkey and MusicBee both with Wasapi 16bit 48K from my computers S/PDIF output not USB using an optical cable to a Dac into my Tube SE amp sounding fine.
http://my.rapidshare.com/sbgk/11541
It is the first time trying to run this player and the above is the version I downloaded the files from, also did the rem @echo off rem the pause was already done, it is still not running, it does not bring up a screen there is nothing I can send. All the files required are in one folder called ( MQnPlayer ) also loaded some music files into same folder still no go.
the rem change was so that you could see the output from the batch file so that you could send it to me for diagnosis, if the pause had the rem removed you should see the output. would also be useful to see a directory listing of your mqnplayer directory
you don't need to copy the wav files to the directory, you just need to copy them from explorer to the clipboard by right mouse click and clicking copy, you then double click on mqn.bat
mqn won't work if other media players have initialised the wasapi device at the same time.
All the files shown where scanned and converted to JPG files, did not know how to do it any other way
![]()
These are the file in my folder I:/MQnPlayer
![]()
![]()
and your batch file, hope this helps
Hi, it was the output from running the mqn.bat file with echo off commented out that I was looking for. You need to remove the rem from the rem pause line near the end. If you right mouse click on the top bar of the console window you can go to edit and select all and then edit copy and then paste it into a .txt file or a new message. Cheers
Whenever I double click on MQN.bat all I get is the text of the file nothing else, when you are referring to explorer do you mean internet explorer my main web browser is Firefox, tried using IE copy the .wav file
to IE than click on mqn.bat same thing getting the text of the file only.
It seemed to have created a new folder ( mqnplayer_files ) under Libraries/Documents.
I know it looks like the text, but it isn't, there should be something in that text that tells me what is going on. The explorer I meant was the file explorer ie windows explorer not the internet explorer.
![]()
![]()
![]()
This is the output text, cannot upload a text file will only except graphic
file formats.
looks like the batch file is not running
in your directory listing it looked like mqn.bat was actually mqn.bat.0, can you check and rename it to mqn.bat
still don't understand why you can't paste into the message text.
here is the output from mine
C:\musicplayer> rem @echo off
C:\musicplayer> Title MQn - Just good music
C:\musicplayer> taskkill /fi "PID gt 0" /IM mqn.exe /F 1> nul
C:\musicplayer> rem net stop "Desktop Window Manager Session Manager"
C:\musicplayer> rem net stop "Multimedia Class Scheduler"
C:\musicplayer> cd c:\musicplayer
C:\musicplayer> del Files.txt /q
C:\musicplayer> paste 1> param.txt
C:\musicplayer> rem echo off
C:\musicplayer> rem file
C:\musicplayer> for /F "usebackq delims==" %i IN (`sort param.txt | FIND /I ".wav
"`) do echo %i 1> > File1.txt
C:\musicplayer> echo C:\musicplayer\06 Blue Prelude.wav 1> > File1.txt
C:\musicplayer> if exist file1.txt goto :crlf
C:\musicplayer> rem remove cr/lf from last line
C:\musicplayer> setlocal DisableDelayedExpansion
C:\musicplayer> set "firstLineReady="
C:\musicplayer> (for /F "eol=$ delims=" %a in (File1.txt) DO (
if defined firstLineReady (echo( )
set "firstLineReady=1"
set /p "=%a" 0) ) 1> Files.txt"
C:\musicplayer> del File1.txt /q
C:\musicplayer> set TIMESTAMP= 8:03:57
C:\musicplayer> echo Playback commenced - 8:03:57
Playback commenced - 8:03:57
C:\musicplayer> echo.
C:\musicplayer> for /F "usebackq delims==" %i IN (`sort Files.txt`) do echo %~ni
C:\musicplayer> echo set "firstLineReady
set "firstLineReady
C:\musicplayer> echo p "
p "
C:\musicplayer> echo )
)
C:\musicplayer> echo 06 Blue Prelude
06 Blue Prelude
C:\musicplayer> echo musicplayer> (
musicplayer> (
C:\musicplayer> echo if defined firstLineReady (echo( )
if defined firstLineReady (echo( )
C:\musicplayer> rem lets play music
C:\musicplayer> MQn --file ".\Files.txt"
C:\musicplayer> pause
Press any key to continue . . .
The batch file is named mqn.bat in my folder when I cut and pasted it to Word it showed as mqn.bat.0 under the file listings it is identified as 0 file, have a feeling this is causing the problem instead of calling mqn,bat it converts to mqn.bat.0. As far as cut and pasting to your batch file is no problem, what is the problem uploading into Audio Asylum which will only except graphic files like bmp, jpg etc.
to play music you must have mqn.bat, paste.exe, mqncontrol.exe and mqnplay.exe all in the same directory, the directory in mqn.bat needs to be changed to your directory.
open windows explorer and highlight a track or folder with your mouse, press right hand mouse key and select copy to copy the track/folder into the clipboard. Then double click on mqn.bat.
if you have altered mqn.bat by removing/adding rem for diagnostic purposes then these need to be reversed before play.
if you can copy and paste to word then you can copy and paste into a message box. I can't really help you much more, these are simple steps which no one else has had a problem with, good luck.
that doesn't even make sense, the registry contains entries and attributes. MQn doesn't touch the registry. You may be seeing MQn in the registry as it keeps a record of programs that were run, downloaded etc. which registry entry are you talking about ?
can you create a test.bat file with the following in it
@echo off
echo hello world
pause
does that batch file run ?
you should see
hello world
Press any key to continue . . .
Found the problem, the mqn.bat was not a windows batch file, when I copied and pasted the contents into a new file called mqn2.bat in Notepad ++ and safed this file it became a true windows batch file and it worked as you said it should, than also copied mqn.bat into notepad ++ and safed the file it also became a true windows batch file and works fine now.
Initial impression of this player against Musicbee and MediaMonkey seemed to be in favour of your player being a little cleaner tighter bass and little more transparency and detail.
Congrats on your program to make this simple player cleaning up the C program code for windows wasapi, it certainly does work, thanks.
thanks for the feedback, was that the sse2 or sse4 version you tried ? Are you running it on windows, why was there a problem with the batch files ?
Running windows7 64 ultimate, I assume you mean to have only 1 file of mqnplay.exe 2.10 sse2 or sse4 in the directory/folder, have the mqnplay.exe 2.10 sse4 only in my folder so is this the file your player will use, than this is the one I am playing now which makes MediaMonkey/Musicbee sound like compressed mp3 files of course I am using non compressed wav files only.
In your download directory the batch file is called mqn.batc2.0 this is the one I downloaded renamed it to mqn.bat which turned out not to be a batch file but just a text file until it is put into a program text editor and safed as a window batch files which is really a DOS batch file, used to program in DOS as well creating database applications30 years ago have not done any
programming in the last 20 years, except for web site creation.
strictly speaking you can have both the sse2 and sse4 mqnplay files in the directory, but only one file called mqnplay.exe. Wonder if the problems you were having was because you had the setting hide extension for known file type set in folder and search options, that way it would have type 0 and would still be type 0 when you tried to rename it.there is a file called mqnplay.bat which allows different versions of mqnplay to be played bac to back in a loop for a set time. just needs editing to change the versions to test or to add/remove versions. the playing time can be adjusted as well, it is how I narrow down the changes.
win 8 is better than win 7 as wasapi was largely rewritten for win 8. win 7 has a distinctive digital sound. I use ws2012, but it's expensive if you have to buy it.
have you tried hirez music on mqn ? the digital noise is even more apparent in hirez so an optimised player is even more important.
Edits: 08/23/13
went into the folder search option to unhide the setting it did not change the file, at least we know that the file can be run in a program editor like Notepad ++ to recreate the batch file.
You are right with win7 havimg a distinct digital sound it is very clean and smooth and impressive but somehow the sole of the music is missing.
It is similar to Tubes vs SS sound, SS sound can be excellent but some how the sole of the music is missing again, had a chance to compare a very good First Watt PassLab SS amp against my class a1 SE 2 stage Tube amp, musically speaking the tube amp sounded a little more organic like real music in my and other peoples opinion who heard the comparison, this is not to belittle the PassLab amp which in its own right is an excellent amp.
Will download the mqnplay.bat file to see if I can make it work and compare.
ws2012 is way to expensive for me to implement, Win 8 is a possibility.
Have not tried any hirez music in any form not having a player to do so.
Basically I have gotten into this digital play back thru a computer about 3 month ago, before this the expense involved to implement digital play back was just to much and in my opinion not worse it to try, when a friend gave me a 30 feet tosling optical cable to try and recommended to use MediaMonkey as server as well a $30 S/PDIF Dac, was shocked to find in how good it sounded for what I invested which was almost nothing, so your simple player raised the bar to another level especially for the cost involved absolutely fantastic against other solutions using much more expensive USB Dac's costing 100's to 1000's of dollars.
can't promise that mqn is ever going to be as usable as other solutions, but it's there if you want to explore how a stripped down player would sound. people spend thousands on optimising things when the player itself is a major contributor to the digital sound they are hearing, it's a little researched/understood area.
Have found I left some code references in that affected the sound and also found 2 more tweaks so shall put another release out when that's finished.
Looking forward to your updated mqn player, I like the simplicity of your player it is like putting a vinyl record on to a turntable and play it one tune at a time just like in the old days when I got into audio which was more than 50 years ago, after all we are looking to hear whats in the groove we used to say and enjoy the musical performance.
just uploaded mqnplay.exe 2.11 sse4 intel, haven't tested the final version yet, but from initial testing it sounded more detailed.
you can cue more than 1 tune at a time, it will play a whole folder or as many tracks as will fit in your memory, although the sound suffers if the O/S doesn't have enough ram - say 1.5 GB
good to know I can put more more than 1 file into memory, have 8 GB of memory, not that I want to play more than 1 file at a time for serious listening. Is the mqnplay.exe 2.11 sse4 intel the final version for download yet.
I am enjoying your mqn player very much, it is amazing what you have done by just optimizing the program code to improve playback looks like you are succeeding in providing a better wasapi player.
yes, mqnplay.exe 2.11 sse4 intel is there for download.
Just had a listen and am absolutely amazed by the level of detail, unbelievable, even after all this time with MQn. I have never heard the music played like that before, the sustain on the piano just goes on for ever, wow.
there is another code change I am going to try, so there may be further gains.
Created another folder with the older mqnplay.exe 2.10 sse4 intel so I can do a comparison of course there is no switching involved, have to listen 1 at a time, the later version is better more musical seems to have a little more gain ?? or it just has a clearer presentation.
well, 2.11 proved to be an experiment, great detail, but wasn't satisfied with the bass. have uploaded 2.12 which goes back to 2.10 and has some enhancements which don't reduce the bass.
found another veil to lift from the sound, now it's getting what I would call good. 2.13 sse4 intel uploaded
Sounds to me like 2.11 combined with 2.12 making up 2.13 lucky number sounds the best so far just amazing, do not know where you find some more veils, keep trying and thanks for a beautiful wasapi player, the only problem I found with the functions like resume,pause, skip etc are not working.
Uploaded mqnplay.exe 2.15 sse4 intel, the final version for now as far as SQ goes. It has improved quite a bit over the last week and is pretty much the best thing I have heard on my system, a very live irrepressible sound if you are playing live music. Don't blame me if you stay up all night rediscovering your music collection. http://my.rapidshare.com/sbgk/11541 Shall build the other versions at the weekend.
I am running SBGK's latest version mqnplay.exe 2.15 sse4 intel, I am very pleased with the SQ on Win 7 64 ultimate.
I have come from MediaMonkey, Musicbee and Foobar in Win 7, the best to my ears so far is MQn by far.
SBGK has certainly put an enormous effort into his focussed aim of optimising the best Wasapi Audiophile player code and I for one thought it well worth giving it a go. I don't regret it and am very appreciative of his efforts, the MQn player has become my main playback player.
What other version are you creating??.
an sse2 version and versions with different release points for different dacs that's why there is a version 1.n, 2.n and 3.n. I use 2.15 as that fits my dac and I have tended to just upload that version until I am happy there has been some progress.
Still mean to have a go at large memory pages and control.
the 2.15 sse4 intel was just too bright in my system so have uploaded 2.15 v2 sse4 intel which maybe has a better balance. It just differs by 1 instruction in my tuned version of memcpy that is run once per call, but that is enough to give the difference in sound. 2.15 has sub al,-64 and 2.15 v2 has mov al, 64 - just resetting the counter for the second loop.
of course a better option is to remove the requirement for resetting the loop, now have detail and depth without the bright sound. have uploaded 2.15 v3 sse4 intel
uploaded a version mqnplay.exe 2.15 oword 512 that has thunderous bass if anyone is interested, again just one instruction changed that is used once per call.
have uploaded 2.14 which adds a bit of control and structure to the sound, just one more tweak and that will be it for the player SQ.
Created another folder with the older mqnplay.exe 2.10 sse4 intel so I can do a comparison of course there is no switching involved, have to listen 1 at a time, the later version is slightly better.
Just had a listen with the mqnplay.exe 2.11 sse4 intel, what I found was that it had a fuller sound closer to the original music less digital, definitely better more analog like, the detail is presented a little different because of the tone but is about the same as your previous version at this point it is hard for me to evaluate because I cannot compare side by side switching back and forth.
I have news for you, did a regedit on my registry and found all your filea as well as my Folder/directory seems to me the batch file is putting all the files into my registry but is not playing any music, looks to me I have to do a registry cleanup.
test
sorry to say but I think my winamp with maiko wasapi sounds alot better than this, but it is good to see some who is digging in to this, cuz there is diffently room for improvements. All players sound different, and we all want the best ;)
Edits: 04/11/13
don't be sorry, at least you know what you like
here is the rendering loop with all the commented code in, the changes to the code path are to precalculate the no of buffers in the file and then loop until the last one which is processed out of loop, this saves numerous calculations running everytime the buffer fill event is triggered that were required to find out if we were at the end of the file. Needless to say the advantages to SQ are tremendous, if you're not getting the data right at this stage what chance is there of correcting things down the line. Now just need to get it working for other sample rates. I am pretty sure other players don't optimise the render loop to this extent and is one of the reasons they sound digital. pretty fundamental to get the code as efficient as possible, but not many c++ developers are interested in SQ.
// render loop
UINT32 nBuffersinFile = (nFramesInFile/nFramesInBuffer);
UINT32 nBuffersPlayed = 0;
UINT32 nFramesThisPass = nFramesInBuffer;
printf("bufinfile %I64u nframfile %I64u nframbuff %I64u", nBuffersinFile,nFramesInFile,nFramesInBuffer );
while (nBuffersPlayed < nBuffersinFile)
{
nFramesThisPass = nFramesInBuffer;
/* for (
UINT32 nFramesPlayed = 0,
nFramesThisPass = nFramesInBuffer;
nFramesPlayed < nFramesInFile;
nFramesPlayed += nFramesThisPass
) {*/
// in a production app there would be a timeout here
WaitForSingleObject(hNeedDataEvent, INFINITE);
// need data
hr = pAudioRenderClient-> GetBuffer(nFramesInBuffer, &pData);
//if (FAILED(hr)) {
// //printf("IAudioRenderClient::GetBuffer failed: hr = 0x%08x\n", hr);
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return hr;
//}
// is there a full buffer's worth of data left in the file?
//if (nFramesPlayed + nFramesInBuffer > nFramesInFile) {
// // nope - this is the last buffer
// nFramesThisPass = nFramesInFile - nFramesPlayed;
// UINT32 nBytesThisPass = nFramesThisPass * pWfx-> nBlockAlign;
//LONG nBytesGotten = mmioRead(hFile, (HPSTR)pData, nBytesThisPass);
//if (0 == nBytesGotten) {
// // printf("Unexpectedly reached the end of the file.\n");
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return E_UNEXPECTED;
//} else if (-1 == nBytesGotten) {
// // printf("Error reading from the file.\n");
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return E_UNEXPECTED;
//} else if (nBytesGotten != (LONG)nBytesThisPass) {
// // printf("mmioRead got %d bytes instead of %u\n", nBytesGotten, nBytesThisPass);
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return E_UNEXPECTED;
//}
// if there's leftover buffer space, zero it out
// it would be much better if we could intelligently fill this with silence
// ah well, c'est la vie
/* if (nFramesThisPass < nFramesInBuffer) {*/
/* UINT32 nBytesToZero = (nFramesInBuffer * pWfx-> nBlockAlign) - nBytesThisPass;
ZeroMemory(pData + nBytesGotten, nBytesToZero);
*/ /*}*/
/*} else
{*/
UINT32 nBytesThisPass = nFramesThisPass * pWfx-> nBlockAlign;
LONG nBytesGotten = mmioRead(hFile, (HPSTR)pData, nBytesThisPass);
/*}*/
/* UINT32 nBytesThisPass = nFramesThisPass * pWfx-> nBlockAlign;
LONG nBytesGotten = mmioRead(hFile, (HPSTR)pData, nBytesThisPass);*/
//if (0 == nBytesGotten) {
// // printf("Unexpectedly reached the end of the file.\n");
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return E_UNEXPECTED;
//} else if (-1 == nBytesGotten) {
// // printf("Error reading from the file.\n");
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return E_UNEXPECTED;
//} else if (nBytesGotten != (LONG)nBytesThisPass) {
// // printf("mmioRead got %d bytes instead of %u\n", nBytesGotten, nBytesThisPass);
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return E_UNEXPECTED;
//}
// if there's leftover buffer space, zero it out
// it would be much better if we could intelligently fill this with silence
// ah well, c'est la vie
/*if (nFramesThisPass < nFramesInBuffer) {
UINT32 nBytesToZero = (nFramesInBuffer * pWfx-> nBlockAlign) - nBytesThisPass;
ZeroMemory(pData + nBytesGotten, nBytesToZero);
}*/
hr = pAudioRenderClient-> ReleaseBuffer(nFramesInBuffer, 0); // no flags
//if (FAILED(hr)) {
// // printf("IAudioRenderClient::ReleaseBuffer failed: hr = 0x%08x\n", hr);
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return hr;
//}
nBuffersPlayed += 1;
/*printf("bufplayed %I64u", nBuffersPlayed );*/
} // render loop
hr = pAudioRenderClient-> GetBuffer(nFramesInBuffer, &pData);
nFramesThisPass = nFramesInFile - nBuffersPlayed*nFramesInBuffer;
UINT32 nBytesThisPass = nFramesThisPass * pWfx-> nBlockAlign;
LONG nBytesGotten = mmioRead(hFile, (HPSTR)pData, nBytesThisPass);
if (nFramesThisPass < nFramesInBuffer) {
UINT32 nBytesToZero = (nFramesInBuffer * pWfx-> nBlockAlign) - nBytesThisPass;
ZeroMemory(pData + nBytesGotten, nBytesToZero);
}
hr = pAudioRenderClient-> ReleaseBuffer(nFramesInBuffer, 0);
// add a buffer of silence for good measure
//WaitForSingleObject(hNeedDataEvent, INFINITE);
//hr = pAudioRenderClient-> GetBuffer(nFramesInBuffer, &pData);
//if (FAILED(hr)) {
// // printf("IAudioRenderClient::GetBuffer failed trying to post-roll silence: hr = 0x%08x\n", hr);
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return hr;
//}
//hr = pAudioRenderClient-> ReleaseBuffer(nFramesInBuffer, AUDCLNT_BUFFERFLAGS_SILENT);
//if (FAILED(hr)) {
// // printf("IAudioRenderClient::ReleaseBuffer failed trying to post-roll silence: hr = 0x%08x\n", hr);
// pAudioClient-> Stop();
// AvRevertMmThreadCharacteristics(hTask);
// pAudioRenderClient-> Release();
// CloseHandle(hNeedDataEvent);
// pAudioClient-> Release();
// return hr;
//}
Where did this render loop code come from (JPLAY, Micro$oft or some other vendor)?
For critical calculations, we used to dump the resulting assembly code so we could calculate the exact time it would take on each platform.
We would then make an optimized variant of the code for each platform (or group of platforms) and then pull the fastest platform specific variant in at build time (e.g. pointer arithmetic versus array indexes, etc.).
I am surprised they had print statements in the loop without #ifdefs or equivalents to completely remove it at optimized build times.
They also did a lot of needless redundant cut-and-pastes which bloats the code size.
They must not be used to writing for restricted space and low end processors.
sorry, I am new to this so don't really understand what you said, but I think they would be working on the assumption that so long as the bits arrived on time and there were no underruns then all is good.
However, it does seem to make a difference to the sound, many would argue that the sound should be the same.
So, it seems to me to be a fundamental paradox of computer audio that you need C++ to write low level code to handle the passing of data to the device in a timely manner, but the C++ standard is to write exception free code and it is the code that handles these exceptions that affects the sound. I would imagine no professional programmer would allow the above to be released which is why us audiophiles are left to try and tweak/filter the generated noise. I have my solution to it and am ok to run with unsafe code because it sounds so good. lol
just uploaded a new version of playerextreme.exe to
https://rapidshare.com/#!users|45980080-0ae609ce616a35c8de7ac5fda4b6194c|3363
that's as good as I can make it at the moment, don't know if making it memory play would make any difference.
just uploaded a new version of playerextreme.exe. the old version used the devices minimum latency mine was 3ms, now set to 0.5 s, so no glitches now and sounds better too. Takes away what I can only think was noise caused by the buffer filling 333 times a second, apologies to P Hoffman for saying low latencies sounded good.https://rapidshare.com/#!users|45980080-0ae609ce616a35c8de7ac5fda4b6194c|3363
I still don't know what to make of the sound, never heard anything like it. It seems to sound extremely clean without any digital sound that used to make me wince, it is also ruthless in highlighting good and bad recordings. Needless to say I have not heard so much detail, quick transients and exact placement before. Due to the cleaness of the sound there is a perception of lack of bass, but if listening in the next room the bass can be heard loud and clear. So while I was searching for a more analogue sound I am getting used to this all detail bared clean sound.
Edits: 01/28/13
======
apologies to P Hoffman for saying low latencies sounded good.
======
Absolutely no need to apologize. In fact saying high latencies sound good is just as relevant as saying low latencies sound good. Both are just subjective observations skewed (even unintentionally) by the human mind.
IMO the effect of your doubtlessly big effort would be many times multiplied if you accompanied your SW research by properly conducted blind tests confirming your subjective outcomes (i.e. that any audible change actually occured). But we have already talked about that many times...
well, I am just doing this for my own amusement, the differences are clear enough to me. I am not aware of anyone having gone to these lengths to see what a minimalist player would sound like and to find out why players sound digital. Despite a number of programmers saying that they use efficient code when you look under the bonnet there is a rats nest.
I think I have found a solution to digital sounding players. Maybe there is more money to be made selling hardware solutions than tackling the issue at source.
right we have perfection, fantastic bass, midrange, detail, neutral sound, no digital noise etc, this is as good as it gets. Turns out the clean sound wasn't a keeper and I had a brainwave about how to further optimise the render loop which solved that issue.
I have updated the playerextreme.exe in the link in the above posts for anyone brave enough to try.
I find it outrageous that I have made such great improvements in removing digital noise from the sound and also ending up with the best sound I have heard in such little time, I guess you remove noise you get good sound.
It's just lazyness on the part of the player developers that they rely on the old methods, I guess they think bits are bits. It would be interesting to see if anyone could try it with ALSA etc, they all use the same methods, that's why they all sound the same. They actually introduce noise at the most critical part of loading the buffer and then we moan about digital noise. Well it doesn't need to be that way, listen to this basic player and then ask your player developer why their player sounds worse in comparison. It's not rocket science.
Anyway, the new idea I had was to move the getbuffer and load data step to after the buffer release. Traditionally there is a buffer event that says fill me, the code then does a getbuffer and a load and then a release. It is only the buffer release that makes the buffer available to play and we don't want a delay in making the buffer available, that delay causes the digital noise we all love. so by preloading the buffer before the loop I can get the release to happen immediately after the event, resulting in fantastic SQ, never heard such great bass and natural sound from my system. Also making the loop a while x > 0 and decrementing the counter at the end using --x helps (1 cpu tick). Does a while loop sound better than a for loop ? there's something to ponder. Also changing the time to INFINITE in the WaitForSingleObject(hNeedDataEvent, INFINITE); statement means we don't require an additional counter, although it's bad practice.
Will anyone adopt this method of rendering a stream ? I wonder, it would change the need for reclockers etc if they did.
does anyone know how to use waveformatextensible ? I need it to play 24 bit wavs.
BYTE *pData;
UINT32 nFramesThisPass = nFramesInBuffer;
UINT32 nBytesThisPass = nFramesThisPass * pWfx-> nBlockAlign;
hr = pAudioRenderClient-> GetBuffer(nFramesInBuffer, &pData);
hr = mmioRead(hFile, (HPSTR)pData, nBytesThisPass);
// register with MMCSS
DWORD nTaskIndex = 0;
HANDLE hTask = AvSetMmThreadCharacteristics(L"Pro Audio", &nTaskIndex);
if (NULL == hTask) {
DWORD dwErr = GetLastError();
printf("AvSetMmThreadCharacteristics failed: last error = %u\n", dwErr);
pAudioRenderClient-> Release();
CloseHandle(hNeedDataEvent);
pAudioClient-> Release();
return HRESULT_FROM_WIN32(dwErr);
}
// call IAudioClient::Start
hr = pAudioClient-> Start();
if (FAILED(hr)) {
printf("IAudioClient::Start failed: hr = 0x%08x", hr);
AvRevertMmThreadCharacteristics(hTask);
pAudioRenderClient-> Release();
CloseHandle(hNeedDataEvent);
pAudioClient-> Release();
}
// render loop
UINT32 nBuffersinFile = (nFramesInFile/nFramesInBuffer);
UINT32 nBuffersPlayed = nBuffersinFile;
printf("bufinfile %I64u nframfile %I64u nframbuff %I64u", nBuffersinFile,nFramesInFile,nFramesInBuffer );
while (nBuffersPlayed > 0)
{
WaitForSingleObject(hNeedDataEvent, INFINITE);
hr = pAudioRenderClient-> ReleaseBuffer(nFramesInBuffer, 0); // no flags
hr = pAudioRenderClient-> GetBuffer(nFramesInBuffer, &pData);
hr = mmioRead(hFile, (HPSTR)pData, nBytesThisPass);
--nBuffersPlayed;
} // render loop
hr = pAudioRenderClient-> GetBuffer(nFramesInBuffer, &pData);
nFramesThisPass = nFramesInFile - nBuffersPlayed*nFramesInBuffer;
nBytesThisPass = nFramesThisPass * pWfx-> nBlockAlign;
LONG nBytesGotten = mmioRead(hFile, (HPSTR)pData, nBytesThisPass);
if (nFramesThisPass < nFramesInBuffer) {
UINT32 nBytesToZero = (nFramesInBuffer * pWfx-> nBlockAlign) - nBytesThisPass;
ZeroMemory(pData + nBytesGotten, nBytesToZero);
}
hr = pAudioRenderClient-> ReleaseBuffer(nFramesInBuffer, 0);
continue to optimise and get improvements in sound, one thing I have found is that as the loop is optimal the reliance on low latency is reduced, in fact sounds much worse at low values, so can now use a period of 0.5s
found that best vs2010 optimisation settings were for speed.
playing wav files from a ramdisk gave best sound
then moved on to memory play, initially SQ was worse.
found that a function called memcpy was the culprit, most memory players use memcpy and this is one of the reasons why memory play sounds worse ie digital sounding. Fortunately there is an optimised version of memcpy from http://www.agner.org/optimize/, using this version removes the hard edge produced by memcpy. the other thing I did was to close the file after reading into the buffer.
also most players use malloc to get memory while new is the c++ method and sounds better.
updated exe below, sounds fantastic I use it all the time now, doesn't have the processed sound of JPlay and is the best player I have heard on my system.
https://rapidshare.com/#myrs_filemanager/file/3363
optimised loop below.
BYTE *sound_buffer = new BYTE [sizeof(BYTE) * nBytesInFile];
hr = mmioRead(hFile, (HPSTR)sound_buffer, nBytesInFile);
mmioClose(hFile, 0);
//UINT32 nByteCnt = nBytesInFile - nBytesThisPass*2;
//while (nBytesToSkip < nByteCnt)
//while (--nBuffersPlayed)
do
{
WaitForSingleObject(hNeedDataEvent, INFINITE);
hr = pAudioRenderClient-> ReleaseBuffer(nFramesInBuffer, 0);
hr = pAudioRenderClient-> GetBuffer(nFramesInBuffer, &pData);
A_memcpy (pData, sound_buffer + nBytesToSkip, nBytesThisPass);
nBytesToSkip += nBytesThisPass;
}
while (--nBuffersPlayed);
//while (nBytesToSkip < nByteCnt);
//while (nBuffersPlayed > 0);
// render loop
WaitForSingleObject(hNeedDataEvent, INFINITE);
//hr = mmioRead(hFile, (HPSTR)pData, nBytesThisPass);
hr = pAudioRenderClient-> ReleaseBuffer(nFramesInBuffer, 0);
WaitForSingleObject(hNeedDataEvent, INFINITE);
hr = pAudioRenderClient-> GetBuffer(nFramesInBuffer, &pData);
nFramesThisPass = nFramesInFile - nBuffersinFile*nFramesInBuffer;
nBytesThisPass = nFramesThisPass * pWfx-> nBlockAlign;
A_memcpy (pData, sound_buffer + nBytesToSkip, nBytesThisPass);
if (nFramesThisPass < nFramesInBuffer) {
UINT32 nBytesToZero = (nFramesInBuffer * pWfx-> nBlockAlign) - nBytesThisPass;
ZeroMemory(pData + nBytesThisPass, nBytesToZero);
}
Since you seem to be well into the details, you should think about going directly to the end of the line, and get the processor completely out of the loop. This is done by loading all the music to be played into a single large buffer before play commences and then pointing the DMA engine to the start of this buffer and letting it go. The processor will have nothing more to do.
There are two hard obstacles. First, the DMA engine may have a limited memory addressing ability (e.g. 32 bit addressing, 16 bit word counts). The memory addressing difficulties can be bypassed by various tricks, but this will require knowledge of how the kernel memory management works. The word count limit can't be overcome, without using different hardware. However, a driver can be written that does minimal processing, i.e. juggles buffer pointers, with only a few instructions per buffer switch. The rule here is that the CPU should do absolutely no data copying while music is playing. Second, if you do this, the user interface is likely to be quite primitive. In the extreme case there will not be a way to stop playback without aborting it by some kind of hardware reset to the DMA controller. However, vinyl lovers may appreciate this "feature" since pausing LP playback is not clean. :-)
The resulting software won't be a "product" because it is likely to work for only one hardware and software configuration, but it will give a clear demonstration of what is lost by the huge amount of bloat in modern, "general purpose" operating systems with their layers and layers of overhead.
Tony Lauck
"Diversity is the law of nature; no two entities in this universe are uniform." - P.R. Sarkar
interesting concept I would buy such a beast if it is possible to build, how would the end device know what sample rate to use ?
I have found the best sound is an infinite goto loop with it throwing an exception after it reads beyond the end of the buffer, I set exceptions off so it doesn't crash the program. At least with vinyl you can lift the needle, with this method you have start and stop.
If the end device is a USB DAC, it would get the sample rate information over the USB. If it's an SPDIF connection, then SPDIF conveys the sampling rate. However, when there is a word clock or other clock in the DAC using SPDIF, AES/EBU, or IIS don't have a way for the sample rate to get from the computer to the DAC. One would need some kind of out of band channel or manual setting. One of the big advantages of async USB DACs is that they solve both problems: they put the controlling clock in the DAC where it belongs, and they allow the computer to tell the DAC what speed this clock should run at.
Another alternative is to always upsample in the computer to a fixed sample rate, bypassing this problem. Whether this is satisfactory or not will depend on the available alternatives for sample rates and conversion software. Note: in the minimalist spirit, this implies doing any sample rate conversions prior to starting music playback. It can be done file to file well in advance if sufficient disk storage space exists, or it can be done on-the-fly while loading RAM if the processor is sufficiently fast and/or the user sufficiently patient.
Tony Lauck
"Diversity is the law of nature; no two entities in this universe are uniform." - P.R. Sarkar
thanks for the reply, am using wasapi over HDMI, so are you saying that when I open a connection to the device it is actually the driver on the pc that I am talking to and that the link from the pc to dac is machine to machine without software involved ?
The way this is sounding I would be inclined to downsample everything to 16/44.1. Haven't had much success upsampling, much prefer the original having tried sox, audacity etc.
========
are you saying that when I open a connection to the device it is actually the driver on the pc that I am talking to and that the link from the pc to dac is machine to machine without software involved ?
========
Yes, this has been the basic principle of computer audio for decades when DMA was introduced. No matter whether PCI, USB or HDMI (which is basically something like PCI to Intel HDA soundcard in the graphics card plus "spdif on steroids"). Your software is not part of any synchronous data path to the DAC as there is none.
Tony - I continue to support your approach with all the caveats that you quite clearly state. Do hope that SBGK and others will move the software side of 'Tony's Player' forward.
Haven't heard recently if JS has progressed on the hardware side?
SBGK - people like you don't get enough thanks for sharing your results of an enormous amount of time & effort.
I will now spoil it by asking if you could compile a Win 7 32 bit version? Or is that a lot of work changing the code?
Cheers
Jonathan
Hi Thanks, more like dogged determination than skill I am afraid.
Shall include a 32 bit version in the link, just rename it to playerextreme.exe, shall let you know when.
The version in the link is for x64 Intel proceesors
https://rapidshare.com/#myrs_filemanager/file/3363
Apologies for the previous version, I was using while do for the render loop which after a while didn't sound so good so back to while loop which sounded better.
I have updated what to me is the ultimate version as far as sound quality is concerned, it really is very good. No real big changes in the code, just some things I found that made a difference to the sound and then some optimisations.
One of the big finds was
hr = CoInitializeEx(NULL,0x8); //COINIT_SPEED_OVER_MEMORY 0x8
which really brought the sound to another level.
I was reassured that as I optimised for speed the Sound Quality improved.
I was surprised at how big a difference the optimisations made to the sound, you can only do so much with code.
Here are the optimisation settings for x64 Intel processor, /MT, /fp:fast,
and the /O2 /Ob2 /Oi /Ot /Oy switches made the difference
c/c++ section
/Zi /nologo /W3 /WX- /O2 /Ob2 /Oi /Ot /Oy /GL /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Gm- /EHsc /MT /GS /fp:fast /Zc:wchar_t /Zc:forScope /Fp"x64\Release\playerextreme.pch" /Fa"x64\Release\" /Fo"x64\Release\" /Fd"x64\Release\vc100.pdb" /Gd /errorReport:queue
-DUNICODE -D_UNICODE /Og /favor:INTEL64
linker section
/OUT:"C:\vs2010\playerextreme - mem - one file\source\x64\Release\playerextreme.exe" /INCREMENTAL /NOLOGO "libad64.lib" "libacof64.lib" "libacof64o.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"x64\Release\playerextreme.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\vs2010\playerextreme - mem - one file\source\x64\Release\playerextreme.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /PGD:"C:\vs2010\playerextreme - mem - one file\source\x64\Release\playerextreme.pgd" /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X64 /ERRORREPORT:QUEUE
I also made it a single thread which again made a small improvement, also fixed the sizes of buffers etc so that numbers were used in the code. This means that different code would need to be used for different sampling rates. Also worked out a way to play gapless (next release) where the wav data is just appended to the buffer. Means that it won't be able to play different sample rates gapless, but it suits my purposes.
The next release will be gapless and play different sample rates.
Fantastic. Dogged determination is much the most important in such matters, but you clearly have skill as well!
It just needs someone like you to cut out all the unnecessary code for a completely dedicated player, where sound quality is valued far more than glitzy UI. Anyhow that's my view and I am looking forward to giving it a spin.
Cheers
Jonathan
Hi,
just uploaded playerextreme32.exe, just rename it to playerextreme.exe or change the sp.bat file to point to the 32 bit version.
Let me know if you have any problems.
remember it can only use the default device at the moment.
uploaded a new version of playerextreme32.exe as the original was too bright. A recommended optimisation setting for x64 had been used which wasn't recommended for x86. Now both x86 and x64 sound nearly the same, the x64 marginally better, something to do with 64 bit integers, maybe.
JPlay and fidelizer both set the system clock to 0.5ms and I tried this with playerextreme, but realised it was making the sound worse ie more digital sounding. If you have Jplay or Fidelizer running then the advice is to stop them before using this.
Fantastic. I will give it a run soon.
Hi,
Have had to upload the 64 and 32 bit files again as there was a setting which was making it too bass heavy, floating point model fast if you are interested - setting it to precise brings it back into line.
For those who downloaded the bass heavy version you will be able to compare what one optimisation switch can do.
Cheers
Sorry to be a bit dim on this, but I am failing to see your files in http://rapidshare.com/users/playerextreme/3363 or any of your subsequent Rapidshare URLs. I just get a blank page with no files listed at all to download?
I even joined Rapidshare personally! Using Chrome browser on iMac and Windows 7 PC.
Guidance please.
Try this one
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|3363
ta
I have still failed to get ExtremePlayer to work.
I think you should point out to potential users, that, as I found, it will not work at all unless .NET v.4 framework is installed to Windows.
Having installed .NET v.4, I downloaded all of your files inc the 32 bit version, renamed it as suggested, and copied them all into one folder on the desktop.
I copied five .WAV tracks to the same folder.
I ran sp.bat. Following error messages (or similar) were returned in the CMD window -
Opening .WAV file
C:desktop/.NetFx40_FullX86.exe
Could not find a RIFF/WAV chunk:mmr=0x00000109
cPrefs constructor failed hr=0x80070057
Press any key
and then CMD window closed
Any pointers to what I am doing wrong?
Thanks
Hi,
Apologies for the issues you have found, I have 2 laptops with it on and must have had .net v4 already installed.
It is not necessary to physically copy the wav files, just copy the filenames to the clipboard ie highlight them in explorer, right mouse click and select copy or just use ctrl c. the sp.bat can then be run.
Hopefully you have the 32 bit version in the directory, the only thing I can think of that caused the errors is that the last file you copied wasn't a wav file and the player tried to play that non wav file and couldn't parse it.
Have got the hi rez working now and have finally settled on the optimum build settings, just need to get the gapless implemented and that will be that. I thought the 16/44.1 were sounding good, but the player really lets hirez tracks sing , as it were. I guess with the higher data throughputs an optimal renderer is even more important.
I read your comment-
It's just lazyness on the part of the player developers that they rely on the old methods, I guess they think bits are bits. It would be interesting to see if anyone could try it with ALSA etc, they all use the same methods, that's why they all sound the same. They actually introduce noise at the most critical part of loading the buffer and then we moan about digital noise. Well it doesn't need to be that way, listen to this basic player and then ask your player developer why their player sounds worse in comparison. It's not rocket science.
I suspect that this is a stupid question, but I am currently getting fantastic results with ALSA running MPD. Is your code, or an adapted version of the principles contained within it, applicable to running in a Linux environment?
The reason being that I used to run Foobar on a highly optimised Windows 7 platform and although it was a great improvement on standard Windows SQ with Foobar, it is a million miles away from the results on MPD (running mpdPup all in RAM 60MB all up inc the 2.6.39 Kernel on USB stick!).
If your code could improve ALSA or take its place, then you really would have a winner for the hard core Linux audiophile community.
Just a thought
That's all well beyond my capabilities, but I think there are probably critical areas that could be done better eg in the wasapi example event driven is the best for SQ and yet why has no one thought to put the release statement next to the event statement instead of having an unnecessary step right after the event call ie preload the buffer ready to fire when an event trigger happens. Presumably the same method is used in other players.
I have reduced this player down to 1 thread, single core, no disk access after play starts and no user interaction other than start and stop, so basically it has been built from the ground up with attention to what affects the sound. It is an extreme solution, but people are paying thousands to try and improve digital sounding systems so why not be prepared to suffer a little. You can always have a lower grade player as well if you want all the bells and whistles.
The most perplexing thing was the difference the build optimisation settings made, so again if a programmer is not paying attention to the sound quality they can have a great program and then affect the sound by some innocuous build setting.
Have gone back to a lower latency setting was losing too much of the transients with 0.5s.
Will make better instructions etc once it gets to a final stage, that's if there is interest.
I found it was hard to pick up the differences a small change made when listening to the main system, so I tried plugging headphones into my laptop with the player running and was amazed at the quality, the player has turned my laptop into an audiophile quality device - when using headphones anyway.
The version I am working on is a lot better than the one available for download, shall probably release it next week. Found there were a load of things that can be switched off inside the program just like switching services off on a pc affects the sound. One of the settings was called Windows Lean and Mean would you believe.
All sounds very positive and greatly looking forward to trying it.
Am still having problems getting it to run on 32 bit version.
Would you be able to PM me so we can get through the install issues offline?
Thanks
Jonathan
you should have pm
Supposed to be getting gapless working, but got sidetracked on memory types and usage. Have settled on using virtualalloc to allocate the memory as it aligns it to page size - 4096k, I then hard coded the periods so that the buffers would align with the pagesize, also means they are 128bit aligned. Sounds pretty good.
The final render loop looks like this eg for 16/44.1
loop1644:
WaitForSingleObject(hNeedDataEvent, INFINITE);
hr = pAudioRenderClient-> ReleaseBuffer(256, 0);
hr = pAudioRenderClient-> GetBuffer(256, &pData);
A_memcpy (pData, sound_buffer += 1024, 1024);
goto loop1644;
Makes quite a difference to the sound having the buffer and frame sizes hard coded rather than being variables. Goto also sounds better than anything else I have tried. an exception is thrown when it reads past the end of the buffer and the program quits.
Have uploaded the 64 bit version ie playerextreme.exe that now plays gapless and hirez 16/44.1, 24/44.1, 16/48, 24/48, 24/88.2, 24/96, 24/176 and 24/192. Have tested it up to 4.5gb 24/192 loaded into ram and sounds ok (takes a while to load though).
A new version of sp.bat has also been uploaded to allow the files to be loaded.It won't play 24 bit without converting it to 32 bit as my dac can't play 24 bit.
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|3363
paste.exe, playerextreme.exe and sb.bat are required in the same directory eg c:\musicplayer. .net framework 4.0 is also required - if not already installed.
the default wasapi device is used. Operation is by selecting wav files or a folder (files of the same bitsize and resolution must be selected) with the mouse eg using explorer, right mouse click and select copy and then double clicking on sb.bat or an sb.bat shortcut on the desktop. To stop just close the console window.
have tested it on win7 home premium 64 and win8 pro 64
have aligned the period sizes so that only full pages of memory are handled ie 4096 bytes. Does this make a difference ? In theory it should as the OS is not having to load 2 pages where there is an overlap or keep track of partial pages. Also virtualalloc only deals in full pages where as the common way of assigning memory won't use full pages. I think this is an area where newer cpus are more optimal than before and thus speed and noise are reduced compared with previous versions. For resolutions above 24/96 the period is set to 2 pages.
Edits: 03/03/13 03/04/13
Small change that improves the balance and stereo imaging.
Change was to change the page protection on the buffer after it was loaded to read only, presumably means the system doesn't need to check for write access when accessing the buffer.
It really is the most entertaining music player I have heard, it allows one to get totally involved in the music.The dynamics, transients, depth of stage, lack of digital harshness, timing, excellent bass and subtlety of the music have to be heard to be believed. I guarantee you will not have heard anything like it. It really is a massive step up over other players out there (and I've tried 10+ of them), which it should be because it has been built from the ground up with special regard to the sound quality.
What has surprised me is just how much of an improvement it is over other players which sound harsh and 2d in comparison. I am now convinced that a lot of digital sound that people hear is produced by the player software itself, when you strip everything out you get the true sound.
To recap, here are the innovations I discovered which affected the sound.
1. preload the buffer in the render loop so that the data can be released immediately after the load buffer event is fired.
2. use fixed values in the render loop
3. use goto for the render loop
4. use optimised memcpy to copy data to the device buffer in the render loop
5. don't check for fileend, just let it read past the end and throw an exception.
6. no result checking in the render loop, just load the buffer, release the buffer and copy to the device.
7. use virtualalloc to get allocate the buffer instead of malloc so that full pages are allocated.
8. align the device period to the system memory page size 4096 bytes for x86 machines ie load whole memory pages into the device buffer.
9. change the buffer page protection to readonly after loading
10. gapless by appending wav data to the buffer rather than merging etc
11. play in 1 thread
12. single processor compilation
13. optimisations - inline function expansion, intrinsic functions, favor fast code, omit frame pointers, don't enable fiber safe, whole program optimisations, no string pooling, no buffer security check, enable function level linking, MT runtime library, no C++ exceptions, favor intel 64, opt ref and opt icf, target machine x64, embedded manifest.
14. no user interaction apart from start and shutdown.
The sound quality has reached such a high standard that I decided to rename it to MQn.
playerextreme is no more
Have uploaded a new version of MQn.exe and MQn.bat, the new MQn.bat is required because I have removed all screen output from MQn.exe and filenames are now output by MQn.bat.
the new link is
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
of course, the best page protection for sound quality is no page protection, found an undocumented setting which seems to remove page protection, it has transformed the sound anyway and sounds better than every other setting, but doesn't allow data to be written so must be set after the data load.
The other thing I tried was profile guided optimisation which has lifted the performance to a level I just couldn't have believed was possible.
I am now hearing a lot more coughs and off stage noises in live recordings than I heard before eg MJQ the last concert - summertime track. Overall the performance is on another level.
I am happy to say this is the final version in terms of sound quality. The only outstanding issue is handling filenames with unicode characters, which is harder than it should be.
why MQn, well I can deny that it has anything to do with the fact that when the sound get's really good people start to say it sounds just like the Linn Sondek LP12 and one of my favourite films is 2001 and n stands for the different formats.
the last change I made was something called use of MFC, I thought the setting I chose was an improvement, but after extended listening it became apparent something wasn't right - too strident which is always a sign something is stressed. So went back and tried the settings again and the best one is use mfc in a static library. so have rebuilt it and uploaded the new version which has a more balanced sound. Hopefully that is it as far as setting changes go.
there is a small update to MQn.bat so that just the filename of the file without extension is displayed.
Did some work to allow flac files to be played, well anything that sox can covert to wav, there would be a small delay while converting. Don't know if there is any interest in this feature.
comparison of the original render loop to the optimised one showing assembly code, would say the original is fairly typical of your average player. Note the last thing it does is release the buffer to the audio device. Normal players would also be checking for pause, stop, fwd, rew, feeding back bytes played etc as well as checking for end of track to queue the next one.
No wonder there is a digital sound to most players.
I guess my program is just following the ground rules set out by CICS and others except this time it is inside the program and there seems to be a corollary between a faster render loop and lower noise.
new loop
loop2496:
WaitForSingleObject(hNeedDataEvent, INFINITE);
000000013F8F31E2 or edx,0FFFFFFFFh
000000013F8F31E5 mov rcx,rbx
000000013F8F31E8 call qword ptr [imp_WaitForSingleObject (13F8B4070h)]
// need data
hr = pAudioRenderClient-> GetBuffer(nFramesInBuffer, &pData);
000000013F8B17BC mov rcx,qword ptr [rbp-1]
000000013F8B17C0 mov edx,dword ptr [rbp+6Fh]
000000013F8B17C3 mov rax,qword ptr [rcx]
000000013F8B17C6 lea r8,[rbp+0Fh]
000000013F8B17CA call qword ptr [rax+18h]
000000013F8B17CD mov edi,eax
if (FAILED(hr)) {
000000013F8B17CF test eax,eax
000000013F8B17D1 js 000000013F8B19CC
}
// is there a full buffer's worth of data left in the file?
if (nFramesPlayed + nFramesInBuffer > nFramesInFile) {
000000013F8B17D7 mov eax,dword ptr [rbp+6Fh]
000000013F8B17DA lea ecx,[rsi+rax]
000000013F8B17DD cmp ecx,r12d
000000013F8B17E0 jbe 000000013F8B17E7
// nope - this is the last buffer
nFramesThisPass = nFramesInFile - nFramesPlayed;
000000013F8B17E2 mov ebx,r12d
000000013F8B17E5 sub ebx,esi
}
UINT32 nBytesThisPass = nFramesThisPass * pWfx-> nBlockAlign;
000000013F8B17E7 movzx edi,word ptr [r14+0Ch]
LONG nBytesGotten = mmioRead(hFile, (HPSTR)pData, nBytesThisPass);
000000013F8B17EC mov rdx,qword ptr [rbp+0Fh]
000000013F8B17F0 mov rcx,qword ptr [rbp+5Fh]
000000013F8B17F4 imul edi,ebx
000000013F8B17F7 mov r8d,edi
000000013F8B17FA call qword ptr [__imp_mmioRead (13F8B41B8h)]
if (0 == nBytesGotten) {
000000013F8B1800 test eax,eax
000000013F8B1802 je 000000013F8B1985
} else if (-1 == nBytesGotten) {
000000013F8B1808 cmp eax,0FFFFFFFFh
000000013F8B180B je 000000013F8B197C
} else if (nBytesGotten != (LONG)nBytesThisPass) {
000000013F8B1811 cmp eax,edi
000000013F8B1813 jne 000000013F8B1968
}
// if there's leftover buffer space, zero it out
// it would be much better if we could intelligently fill this with silence
// ah well, c'est la vie
if (nFramesThisPass < nFramesInBuffer) {
000000013F8B1819 mov edx,dword ptr [rbp+6Fh]
000000013F8B181C cmp ebx,edx
000000013F8B181E jae 000000013F8B183D
UINT32 nBytesToZero = (nFramesInBuffer * pWfx-> nBlockAlign) - nBytesThisPass;
ZeroMemory(pData + nBytesGotten, nBytesToZero);
000000013F8B1820 movzx r8d,word ptr [r14+0Ch]
000000013F8B1825 movsxd rcx,eax
000000013F8B1828 add rcx,qword ptr [rbp+0Fh]
000000013F8B182C imul r8d,edx
000000013F8B1830 sub r8d,edi
000000013F8B1833 xor edx,edx
000000013F8B1835 call memset (13F8B30D6h)
000000013F8B183A mov edx,dword ptr [rbp+6Fh]
}
hr = pAudioRenderClient-> ReleaseBuffer(nFramesInBuffer, 0); // no flags
000000013F8B183D mov rcx,qword ptr [rbp-1]
000000013F8B1841 xor r8d,r8d
000000013F8B1844 mov rax,qword ptr [rcx]
000000013F8B1847 call qword ptr [rax+20h]
000000013F8B184A mov edi,eax
if (FAILED(hr)) {
000000013F8B184C test eax,eax
000000013F8B184E js 000000013F8B195F
nFramesPlayed < nFramesInFile;
nFramesPlayed += nFramesThisPass
) {
000000013F8B1854 add esi,ebx
000000013F8B1856 cmp esi,r12d
000000013F8B1859 jb 000000013F8B17B0
if (FAILED(hr)) {
000000013F8B185F mov edi,dword ptr [rbp-0Dh]
}
} // render loop
oops missed the new loop
loop2496:
WaitForSingleObject(hNeedDataEvent, INFINITE);
000000013F8F31E2 or edx,0FFFFFFFFh
000000013F8F31E5 mov rcx,rbx
000000013F8F31E8 call qword ptr [__imp_WaitForSingleObject (13F90D088h)]
hr = pAudioRenderClient-> ReleaseBuffer(512, 0);
000000013F8F31EE mov rcx,qword ptr [pAudioRenderClient]
000000013F8F31F3 mov rax,qword ptr [rcx]
000000013F8F31F6 xor r8d,r8d
000000013F8F31F9 mov edx,200h
000000013F8F31FE call qword ptr [rax+20h]
000000013F8F3201 mov dword ptr [hr],eax
hr = pAudioRenderClient-> GetBuffer(512, &pData);
000000013F8F3208 mov rcx,qword ptr [pAudioRenderClient]
000000013F8F320D mov rax,qword ptr [rcx]
000000013F8F3210 lea r8,[pData]
000000013F8F3218 mov edx,200h
000000013F8F321D call qword ptr [rax+18h]
000000013F8F3220 mov dword ptr [hr],eax
A_memcpy (pData, sound_buffer += 4096, 4096);
000000013F8F3227 add rdi,1000h
000000013F8F322E mov qword ptr [sound_buffer],rdi
000000013F8F3236 mov r8d,1000h
000000013F8F323C mov rdx,rdi
000000013F8F323F mov rcx,qword ptr [pData]
000000013F8F3247 call OVR_memcpy (13F8F6800h)
goto loop2496;
000000013F8F324C jmp $loop2496 (13F8F31E2h)
Have uploaded a new version of MQn.exe (called MQn.exe2012, so just rename it) which was compiled in VS2012, it has exactly the same settings as the original one compiled with vs2010.Sounds awesome, the previous version had a slight tendency to defuse the treble, but with VS2012 compile it is a much more complete sound with absolutely no digital harshness, some 16/44 albums I could hardly play before without getting a headache are now rendered in their full glory.
Did read they have spruced up the optimisations in VS2012 eg Auto-vectorizer. The compiler analyzes loops in your code and, where possible, emits instructions that use the vector registers and instructions that are present in all modern processors. This makes the loops run faster. (The processor instructions are known as SSE, for Streaming SIMD Extensions). You do not have to enable or request this optimization because it is applied automatically. There may be more tweaks to be had in VS2012, but this is an excellent first build.
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
oh, vs2012 use wide strings by default, so the unicode filename issue is solved.
did I say it sounds awesome, unbelievable.
Edits: 03/13/13
have uploaded a further optimised version for vs 2012 called MQn.exemc2012
there's also an atom version, but it hasn't had profile guided optimisation yet.
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
this one has try/catch removed as it has some overhead - uses a different method to handle the end of play exception,
it is compiled for multicore, uses the new parallelisation feature of vs2012 which creates threads on different cores to speed loop processing and has a switch called /Qfast_transcendentals with affects the precise floating point processing setting making it more like the fast setting. the fast setting always produced better atmospherics, but lacked the fidelity of the precise setting so am excited to hear if this produces the best of both settings.
Sounds beautiful on the headphones plugged into my laptop, seems to be a feature of the vs2012 version that there is no digital noise , getting very close to the performance now, may have to rethink the idea that running the player on 1 core is best, multicore was a no go when using vs2010, but 2012 sounds a lot better.
Hmm, sure there were a lot more posts in this thread yesterday, has it been moderated ?
I found 3 more options for optimisation and now the sound is really very good, piano sounds like a real piano and there is now fantastic sustain on string instruments etc
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
they are mqn.exev1 and mqnv2.exe, v1 I use for hdmi and the realtek hd driver for my laptop and v2 is for usb.
Sure JIrling won't mind me reposting his comments
SBGK Player [MQn]
------------------------------
I am one of the ones who have tried SBGK's MQn. I am very pleased with the
SQ on Win 7 64 completely 'out of the box' not optimised at all and so I am
sure there is more quality to be extracted.
I have come from CPlay, Foobar JRiver on Windows and mpdPup on Linux - the
latter being the best to my ears until MQn came along.
It only requires .NET 4 Framework installing if you don't have it already.
No Registry or other intrusive stuff to install. So what's against giving
it a whirl?
SBGK has certainly put an enormous effort into his focussed aim of
optimising the best Audiophile player code and I for one thought it well
worth giving it a go. I don't regret it and am very appreciative of his
efforts.
No I don't, as I am enjoying the fruits of your labour enormously.
1 version ago I made 3 optimisation changes, feedback received has pointed to one of these affecting the sound adversely, so have rebuilt the 3 versions with the best sounding option ie use MFC in a static library.Have rationalised the download folder to just hold the latest versions and moved everything else to an archive folder.
have also uploaded a readme filehttps://rapidshare.com/#users|459800...a4b6194c|11541
The use of MFC setting is completely counter intuitive as MQn doesn't use MFC, my thinking is that there are some windows libraries that are used and they sound better when imported as part of the static MFC library than when shared windows libraries are used.
Hopefully, that is the last of the changes as it now sounds pretty sweet.
cheers
Edits: 03/26/13
The one test I didn't do was current version which uses intel libraries vs current version built with VS2012 libraries, hard to decide which one is better, the intel ones seem to have better definition and the VS2012 sounds sweeter. Have posted mqn.exev2.2VS2012 for comparison against v2.2.
Have uploaded instructions on how to integrate MQn with foobar2000
mqnfoobar.txt and mqnfoobar.bmp
Found a magic setting, another veil has been removed from the sound. The instrument and voice articulation is now simply stunning, it's the first time I've been able to pick any instrument and follow it throughout the song/track.
You've had sirloin, now it's time for fillet with lobster, a feast for the ears
versions 1.3, 2.3 and 3.3 uploaded
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
I knew it!...I knew it!... That you transcend the edge every day...
Today this one, tomorrow the next.
Better and better for every day, and always the best player on earth.
Delighting the lobster just now. A feast for my ears with Beethoven´s
5. Later Mahler´s 2, then Schubert... Haydn... with string and pianos.
Nice holidays to you too.
Thanks for your gift
Juan
Unfortunately v1/2/3.3 had an issue in that the new setting introduced a very unsettling type of digital frequency which made it hard to listen to after a while, so had to remove that setting as couldn't find a satisfactory working setting.All is not lost though, as I found 2 more optimisations in the render loop (these have really tidied up the sound, should have spotted them before) and retested A_memcpy against memcpy and CopyMemory (A_memcpy still comes out top) and retested MFC static vs shared windows library setting and retested the vs2012 libraries vs intel c++ libraries and retested profile guided optimisation vs non pgo.
So all in all this should be the final release, the sound is now very together ie coherent, no real weaknesses, the digital sound of 1/2/3.3 has gone, plenty air, bass, detail, can follow instruments through the music and also place them better than previous versions ie it's a gorgeous sound and the better your system the better it should sound, though it sounds pretty good through headphones plugged into a laptop.
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
now I just need to see if I can control it remotely via foobar2000 and my samsung note 10.1, convenience of digital music with MQn sound quality, does it get any better ?
Edits: 03/30/13
Hi SGBK!
This one, version 1.5 is superb.
I make the Creation during the day (no 7 days)
and no fatigue at all.
The oratorio "The Creation".
Moscow International House, Concert Hall Radio "Orpheus", February 8 2013
Joseph Haydn - Composer
Artists: "Masters of Choral Singing," "Moscow Virtuosi"
Soloists:
Konstantin Wolff Baritone)
Benjamin Bruns Tenor
Julia Sophia Wagner - Soprano
Helmuth Rilling - Conductor
Thanks for the gift
Juan
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
Just released MQn version x.14
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.
oops, version 1.14 used copymemory for 16/44.1 instead of A_memcpy, have uploaded a corrected version and moved the old one to the archive in case anyone wants to compare.
versions 2.14 and 3.14 were not affected
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
version 22 - dialed back some of the optimisations that made the sound worse and added some newly discovered ones as my understanding improved.
Removed profile guided optimisation, removed prefer fast code, removed mfc static library, added MMCSS back in, aligned memory to cache, added string pooling, /vms /vmb switches
best version yet - detailed, dynamic, analogue like.
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
requires mmcss to be enabled and running
also recommend setting mmcss pro audio background only setting to True
regedit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Pro Audio
change Background Only to True
uploaded version 26, the final and best version for sound quality as verified by my testers.
Phew, don't think I tried all the thousands of combinations of build settings, but it felt like it, after a while you get a feeling for what effect a certain setting is going to have.
So, optimising the code is only half the story - getting the best sounding optimisation settings has proven to be harder to work out and I'm not giving them away.
no digital sound, fantastic detail and dynamics, timing and rhythm of a high end turntable, all in all an outrageously enjoyable sound
next release will introduce stop/pause/skip
needs mmcss enabled and set to start automatically
advise setting the background only setting of mmcss pro audio setting to True
regedit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Pro Audio
change Background Only to True
mqn v.27 uploaded to solve slight lack of bass
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
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.
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."
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 constantly 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
needless to say, no other player does it this way, yet.
Edits: 05/26/13
Think v 79 is a bit too balanced towards the bass, here is a version that is better balanced.
Edits: 05/28/13 05/28/13
Hi SBGK:
I get File no found on the link!!!!
I need your latest effort, please correct.
Best regards
Juan
try this onethe latest version is v80
Edits: 05/30/13
yup, think it's a keeper, listening to Johny Cash, quite hard for a player to get the depth of voice, sense of space, tone of instruments, bass and timing correct - MQnvx.5 does it with ease. It's amazing what it is retrieving from 16/44.1. I think you can tell when something falls into place, it just sounds right.
The important thing is does it make you tap your foot tap in time to the music.
uploaded a mqn.exev2.1 (usb devices)which uses intel specific files. The result is a slightly improved sound, less lean sounding. The old v2.0 is still there for comparison.
https://rapidshare.com/#users|45980080|0ae609ce616a35c8de7ac5fda4b6194c|11541
I tried using reclock and shanpcaudio reclock enhancements, initially an improvement, but soon gave me a headache, prefer the natural sound of MQn.
Interestingly he is selling the his high end player for £180, anyone tried it ? There is a free version of lesser quality, both integrated with foobar2000.
http://blog.sina.com.cn/shanpcaudio
He has an article further down the page where he mentions the intel c++ redistributable files
Hi SBGK!
Thanks for the very good player. I´m using daily, but
the last building reports:
Opening .wav file ""
mmioOpen <"", ...> failed. wErrorRet ==257
No frames in file.
Press any key to continue . . .
Whith the old one, the same files plays well.
Files.txt and param.txt show valid values.
Thanks in advance for your help
Regards
Juan
Hi,
The only thing I can think of is that the directory or file name has unicode characters in it. The latest changes can't cope with unicode, I shall change the code to solve this. Can you check with a file that has a normal text directory/filename. I noticed it with a directory/file name with the Ö and one with ¿.
cheers
Same error message even if i rename the file a.wav and is located in the same directory as sp.bat,paste.exe and playerextreme.exe.
The Os is Windows 7 Ultimate 64.
Regards
Juan
Hi,
did you see the instruction above ?
If a different directory is used then change line playerextreme --file "c:\musicplayer\Files.txt" in sp.bat to the new directory.
eg change to
playerextreme --file "c:\musicplayer123\Files.txt"
if the playerextreme.exe is in c:\musicplayer123
just tested it and it produces the 257 error you had if the directory isn't correct.
cheers
just change the line to
playerextreme --file ".\Files.txt"
and it will pick up the correct directory - have changed the file in the upload.
Thanks you, Thanks you, Thanks you, SBGK.
Doing the last modification in the sp.bat file make success.
Now i will try the new upload.
Thanks you again for your effort and help.
By the way i am very interested in a linux build and ASIO...
Regards
Juan
Hi,
That's great. Hope you like it.
the gapless implementation uses the best method you can get ie it just appends the tracks byte by byte into the same buffer before play starts, other players use different threads and constantly checks to see if the next track needs to be queued and then has to get the timing correct. With my method there are no timing issues and no extra processing required, the drawback is that only tracks of the same format can be played as the format is set by the first track.
Would really appreciate if you could give some feedback on the sound quality, timing, stereo sound stage width and depth etc and how it sounds in comparison to other players you have used.
Have not done anything with linux or asio, if people think it is a big enough step up over other players then I may try and do linux/asio or perhaps someone with those skills could create a linux/asio player using the same techniques.
cheers
I play classical music only with an Sennheiser HD650 For now in Windows 7, via a s/pdif port. Being at 16-bit resolution only,
giving more space for noise which makes the music sound grain.
I´m using the folloging minimalistic players.
For ASIO: MStreamPlayer http://www.tropicalcoder.com/MStreamPlayer.htm
For ASIO and WASAPi: StealhAudiPlayer http://andy-audioplayer.blogspot.fr/
For WASAPI: PurePLayer http://www.purediy.gr/downloads/pp.html
and Yours
YOURS IS THE BEST really
I never play the same playlist twice and allmost always i listen to music with
my (external) eyes closed, so no playlist or Audio Art for me.
I prefer Linux ALSA (Vortexbox) and this 24/192 USB Audio Class 2 (UAC2) DAC
http://www.qnktc.com/ab_12.php
I´m waiting for an DSD capable DAC: this one, treated in this tread
http://www.diyaudio.com/forums/group-buys/228755-dac-end-r-es9018-full-assembled-board.html
or this
http://www.audioasylum.com/cgi/vt.mpl?f=pcaudio&m=120962
from Matrix Audio
http://www.matrix-digi.com/en/products/49/index.html
or some similar in the £1K range.
So i need an player with more juice in it, up to 32bit/284kHz, to avoid foobar and similar
The hardware and the files are here, but the players are not...yet.
I will give you my impressions during the week
Regards
Juan
Hi,
can you post the contents of Files.txt
may have something to do with country settings, does your machine have any localisation settings ?
cheers
Thanks for the quick reply.
So to recap, sp.bat looks at the Clipboard to get its 'Playlist'? That's much easier! Will try that.
I think if you want others to join in, then it would be helpful to make the User instructions a bit more explicit.
Great to hear that you are powering ahead at such speed. Most impressive.
SBGK - people like you don't get enough thanks for sharing your results of an enormous amount of time & effort.
I will now spoil it by asking if you could compile a Win 7 32 bit version? Or is that a lot of work changing the code?
Cheers
Jonathan
Am pleased to hear of your success with MPD / linux pup. I am having trouble with permission problems and could use a little help getting MPD working Ubuntu 12.04.2. If it is not too much trouble, could you post your mpd configuration?
Bill
Bill - I am no Linux expert - that's why i chose mpdPup as my Linux basis. It is really small, boots off USB stick and wizards guide you through the config. Give it a try - the SQ is terrific.
Ubuntu is about ten times the size and impenetrable (to me). With mpdPup you have full admin permissions to do anything out of the box
Jonathan
Post a Followup:
FAQ |
Post a Message! |
Forgot Password? |
|
||||||||||||||
|
This post is made possible by the generous support of people like you and our sponsors: