![]() ![]() |
Audio Asylum Thread Printer Get a view of an entire thread on one page |
For Sale Ads |
86.140.106.238
In Reply to: RE: Linux Build? posted by SBGK on March 10, 2013 at 05:54:30
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.
Follow Ups:
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
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: