|
Audio Asylum Thread Printer Get a view of an entire thread on one page |
For Sale Ads |
82.17.209.1
In Reply to: RE: cPlay - the open source high-end audio player using ASIO posted by cics on May 05, 2008 at 12:31:58
Hi fellow cMPers!
Have to say this is quite an amazing forum. Been trying to read every post here but taking a very long time. Fascinating though how cPlay has developed and evolved over time, especially the introduction of gapless playback and the teething problems which were sorted along the way.
My name is Mark. I would like to write some software over time which may help others using cMP2. Either utilities or ways of automating set-up. Thinking of using Auto-it for most of it. Why that language you may ask? Well it's free, no restrictions on license, creates stand alone executables (ok if you've stripped every single dll out then I can't guarantee these projects will all work? After-all, Windows applications are all basically a load of calls to various dll modules). Also Auto-it is powerful enough to manipulate other Windows software (like clicking a button for example). I am very wary of sound quality issues software could create, so these will mainly be 'sleeping giants' so to speak. Most of the time you probably won't run them, unless you need their function, so it won't get in the way of that sublime cMP2 sound.
As an example, Serge (steppe) found a way of stripping out resources from cicsMemoryplayer.exe creating the infamous 1.exe! This had an improved sound and removed the need for winspool.drv module. The unfortunate side-effect is that we lost our options page. Well I've managed to re-create this in an Auto-it gui. This directly writes to the mysterious cicsMemoryPlayer.ini file. If you want to know the structure of the ini, pretty much worked it out. It is in binary so you can't edit it in a normal text editor. The options can be adjusted outside of cMP (XP mode) too if you wish with this gui program. Still need to finish all this off, but if anyone is interested or wants to know how the ini file works please let me know.
Another thing I intend to do is automate some of the reduction methods (software strip-down) others have come up with. Doing this manually proved horrendous! The pc can do much of this for you with the right script ;). Finally was working on a little script to do all the cMP setup. Initially this did mainly registry changes, but I was always left disappointed with the end sonic results. So the new version actually stripped down XP, as if you were clicking all the gui buttons yourself, including the re-boots! Took about 20 minutes but you could just leave it going... So maybe another project there for the future (still some bugs to iron out there).
Anyway, a final taster- and on to the topic of this post at last!
Disabling WFP (Windows File Protection) has always been a bit of a pain. I've always thought that a nice little batch (.bat) file would be the best way, if possible? So spent a while trying to research it. Well hopefully the solution is below!
Okay here's what you need to do:
1. Open up notepad.exe
2. Copy and paste the script below- everything inside (in between) the two - - - - - lines (but not the - - - themselves!) into the notepad window
3. Choose Save-As from the notepad file window. Make sure you change save as type to 'All files' as we need to save this as '.bat' and NOT '.txt'
4. (Choose a folder you can find again.) Type in the Filename as: Disablewfp.bat and click 'Save'
Then you can either double click this file to run it, or preferably run this from a command (cmd) prompt so you can see the visual feed-back. (You can add a 'pause' line to the bottom of the script if you want to use the double-click method though).
What this will do is disable WFP permanently after the next reboot. Okay, we've all done this one way or another, but this is an easy way and might help someone new to setting up a cMP machine and configuring it?
The script uses two command line programs which are built into XP. reg.exe and debug.exe. Script should work okay, but I strongly recommend you run this on a clean machine (with nothing to lose!) to test. If you want to know how it does it, I can explain all (big believer in supplying source code to projects, so others can edit or improve on the work).
Just a final note:
This is for Windows XP with Service Pack 2 or Service Pack 3 only. It will exit without modifying anything, if run on any other versions. This has not been tested on anything other than Professional, though it should work if sfc_os.dll is the same file on those versions- proceed with caution! If your XP is a different language to English, the checking part of the file (at the start) may need to be edited, as it's looking for English text (like 'Service Pack 2' for example). Please let me know if you find any issues.
Hope this is useful for somebody anyway. I apologise if somebody else has already done this in the past, but not got to that part of the forum yet as starting at the beginning working towards the present (and reading only the cPlay forum currently).
All the best,
Mark
Copy the text below to create the bat file:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@echo off
:: Disablewfp.bat written by taste in September 2013. Freely distributable
:: Function: To disable Windows File Protection system for use in a cMP environment
:: Only for Windows XP Professional SP2/3. Not tested on XP Home or other XP versions!
:: Creates backup copy of %windir%\System32\sfc_os.dll stored as: sfc_os.dll.bak
:: Patches sfc_os.dll so this registry key\value will operate correctly:
:: [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
:: "SFCDisable"=dword:ffffff9d -Disable WFP, "SFCDisable"=dword:00000000 -Enable WFP
:: Reboot required to take effect when setting above value, initially set to Disabled
:: Use at your own risk. No liability for loss or damages accepted!
setlocal
for /f "tokens=*" %%a in (
'reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName'
) do (
set productname=%%a
)
if not "%productname:~-10%"=="Windows XP" goto incompatible
for /f "tokens=*" %%a in (
'reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDVersion'
) do (
set servicepack=%%a
)
if "%servicepack:~-14%"=="Service Pack 2" (
set patchaddress=EDE9
goto startprocess
)
if "%servicepack:~-14%"=="Service Pack 3" (
set patchaddress=ED89
goto startprocess
)
goto incompatible
:startprocess
if not exist %windir%\System32\sfc_os.dll.bak (
copy /b %windir%\System32\sfc_os.dll /b %windir%\System32\sfc_os.dll.bak /y
)
copy /b %windir%\System32\sfc_os.dll /b %windir%\System32\sfc_os.bin /y
echo E cs:%patchaddress% 90 90 90 > %temp%\disablewfp.tmp
echo W >> %temp%\disablewfp.tmp
echo Q >> %temp%\disablewfp.tmp
type %temp%\disablewfp.tmp | debug %windir%\System32\sfc_os.bin
del /q %temp%\disablewfp.tmp
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
/v SfcQuota /t REG_DWORD /d 0x00000000 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
/v SFCDisable /t REG_DWORD /d 0xffffff9d /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
/v SfCScan /t REG_DWORD /d 0x00000000 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
/v SFCDllCacheDir /t REG_SZ /d "%windir%\system32\DLLCache" /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
/v SFCShowProgress /t REG_DWORD /d 0x00000001 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" ^
/v AllowProtectedRenames /t REG_DWORD /d 0x00000001 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager" ^
/v PendingFileRenameOperations /t REG_MULTI_SZ /d ^
"\??\%windir%\System32\sfc_os.bin\0!\??\%windir%\System32\sfc_os.dll" /f
echo.
echo DONE. Please reboot computer now for WFP to be disabled permanently
echo Do not try renaming/deleting any files in System32 folder before the reboot!
goto cleanup
:incompatible
echo.
echo Aborting- This is only for Windows XP with Service Pack 2 Or Service Pack 3
:cleanup
endlocal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Follow Ups:
I have source files for both cMP and cPlay (latest version) in case you need them. There are a few features that could be implemented in either of them.
Yes please Bibo, I'd love to see the source code, mainly to see how cics implements some of the Windows trimming and footprint reduction on cMP.
Does the cPlay source have the four versions, or is this just a compiler directive to create the sse2, sse3, ssse3 and sse4 varieties?
I'm assuming this is in C or similar language?
I can send you a PM with my email address.
Thanks.
All the best,
Mark
Please, send me code cmp and cplay.
I love cplay 2.36 sse2
Edits: 09/30/13
I will send code to both of you. I just have to put my backup back online.
Oleg,
if you are interested in AMD optimized cPlay, I have cPlay_2_0b7 which is the last AMD SSE2 optimized version.
Thanks again Bibo01.
I also will try the AMD optimized version (I have an Athlon 64 processor). Hope the features of 0b39 are mainly present (at least gapless playback)?
Many thanks,
Mark
Thank you Bibo01! An important goal is to transfer control to the keyboard cmp (very important to turn off PC). I will take you to any (all) of the information
and then you can get rid of lots more useless stuff.
Hi Rick,
Yes I agree, Nlite sounds very interesting. I've tinkered with it in the past but never quite worked out how to create the best stripped down image. One time I removed so much stuff, that once the image was installed, it just seem to sit there with a blank background screen and nothing else :(
Only problem is obviously a stripped down image file containing Windows could not be distributed directly. I'd be very interested if you've got some set-up scripts for Nlite configuration though?
This forum is huge so my apologies if this has all been done to conclusion in the past...
All the best,
Mark
and what you expect and I would be glad to give you my advice.
One can strip almost everything with nLite. And once you get everything running you can strip out A WHOLE LOT MORE.
But it depends on how much of a purist you are and what you are using for a sound card. At the moment I am using the WAVE-IO usb card instead of JULI@.
Well I have tried a full specked cMP machine, pretty much what cics recommended, apart from I had 2 fanless PSUs. Now it may have been to do with the PSUs, but I could never get it to match the sound of an AMD machine I had used previously.
The AMD one just outputs to a USB dac, Russ Andrews DAC 1, using AQVOX USB ASIO drivers. This is the machine I still use.
It could have been that the DACs input was more geared up for USB than COAX / Optical (has those inputs too). I also had some issues with the Juli@ and that awful breakout cable, the weight of this cable used to sometimes cause a bad connection, resulting in a sound that was a bit like Theo's distortion / metallic sound problem I suspect?
So the AMD PC is the one I still use. Even after preparing the recommended cics board and using it's USB output, I could still not match the AMD board for some reason, no idea why though! I still have both machines available to experiment with.
So the build I would need would contain no network, would use internal graphics card, no sound card, USB output to dac and I use a wireless USB keyboard with a adaptor that plugs into a USB port. Also I seem to get better results with XP SP3 than SP2. AMD unit I have can only use the first sse2 version of CPlay due to it being Athlon 64 CPU.
I do use my own software to do the software modifications, but I get variable results. Occasionally it really sings, often doesn't though. The sound also seems to 'go off' and sound a bit sloppy and vague after 5 days or so, not sure why either!?
My amps are about 12 years old though now so probably all needing a service, I think that this is the main reason the sound isn't fulfilling most of the time (using Naim amplification, bi-amping, this system can be very revealing, which has its good and bad points).
Thanks for your assistance. Please let me know if you want any more specifics about my system. I can probably find the model / type number information of the PC components if that helps...
All the best,
Mark
While this is remarkable work I must say this approach would be invaluable for migrating to minlogon. I did the hard way 2 times before I got it right...had to reload windows and reset everything.Well done!
Edits: 09/17/13
Hi Theo,
I believe this is something you wanted all in one script- minlogon install and WFP disable without the need of additional files or manually setting up.
I have now managed to come up with a batch script that both installs minlogon and does the WFP disable all in one go. Just needs a reboot afterwards. Unfortunately it will need building as below, as I am wary of giving out anything directly that creates the file.
TO CREATE THE BATCH SCRIPT: Just place my createminlogonbatch.exe file in the same folder as a minlogon.exe file (it must have the name minlogon.exe NOT renamed to winlogon.exe). Run it and it will create the batch file in the same folder.
After this you can just store the batch file and forget about the other files (minlogon.exe gets 'built in' to the batch file and will be created just by running the batch file).
Run this and it will install minlogon and do the WFP disable- including all registry patches needed. Then re-boot.
See the link below for where to get the files (all you'll need is the createminlogonbatch.exe file as you have minlogon.exe already- just see step 3 and 4).
While I appreciate your effort, for me it is unnecessary. I am already there plus I have many copies of my OS on Snapshot files which always allows me to recover after an attempt to 'process improve' my OS goes awry. For newbies though this is a very useful thing to have.
Yes, I thought you'd be sorted regarding this, no worries.But you can take the credit for coming up with the idea. Only ever thought about just making a script to disable WFP. But this one is much better.
For anyone tinkering with their cMP builds though, I suggest making yourself a copy of 'The Ultimate Boot CD for Windows'. [Not my work this time.] You just need an XP installation disk and the software from their webpage (link below). It builds an ISO which can be burnt as a bootable CD.
Whenever any tweeks cause the cMP machine to not boot up, and safe-mode fails, boot to this disk (takes about 5 minutes) then you can rename files and even edit the registry without needing a working hard disk image. Saved me from re-installing many times while developing tests. Also contains DriveImage XML (I think it's called) for making / restoring partition backups.
Just one caution though: You need to have your PC set to IDE mode as AHCI will cause a blue screen on booting to the CD.
Edits: 10/07/13
Anything that eases the task of getting the various optimisations under way for cMP has got to be good news. A set of scripts that ensures that the right steps are taken in the right order is something that I for one would love to have. Just one suggestion. It wouldn't be a bad thing to have complimentary scripts to undo the optimisations. Just a precaution!
Not directly connected with the sonic optimisation, but something that I think is badly needed. Has anybody figured-out how to have the monitor switch off until it's re-called by mouse action. I find it a big distraction to have the monitor constantly glaring at me.
You can minimize the cplay window for the monitor to minimize the effect. Also there were some posts by jack wrong who showed how to reset display colors to simulate a totally black screen. This also improved sonics by minimizing emi/ rfi.
Edits: 09/17/13
Thanks for these pointers. It would be nice, though, if the screen blanked during inactivity and then woke-up at the touch of the mouse.
Thanks Theob and Andy222 for your positive feedback! I'll discuss a few of your comments below.
Andy, I've been looking into your 'screen always on' dilema. It started out as a rather mind-boggling problem. Even if I set power management to 'turn off monitor' after one minute, it stayed on all the time. At first I thought it may be to do with disabled services so I re-started a few (of what I thought might be) relevant ones back up again. No luck!Then I started looking at Device Manager and re-enabling some system devices, still no joy. Even in Windows XP mode the power management still would not turn off the display! I even tried sending commands to user32.dll and still the display remained lit.
I tried, on one of my spare PCs, a fresh XP build with no drivers installed and this is what I've discovered. It's all to do with us 'disabling' / not having display drivers installed for the graphics card in use. With no driver (or indeed with or without if the device is disabled) the system call to turn off the monitor is effectively ignored, Windows cannot communicate that command to the hardware.
So here are your options:
1. You could re-enable and re-install all the graphic card display drivers. Then set up power management to turn off the display on inactivity. Now, if you wanted a shorter timer, like say 10 seconds, I can find you a way of achieving this (usually one minute is the quickest time as an option). But the downside may be that the sound quality suffers by having the graphics devices installed? You'd have to test it and see?
2. Look into Jack Wong's method. I haven't seen these pages so have no idea what Mr Wong did. But if it was changing palate colours that may be a great solution, without adding any extra system load which may degrade sound?
3. I am in the process of writing a solution for you. I'd be interested if you wanted to try it. It will be an application that starts up when you boot and runs in the background. It will mainly wile away doing nothing so as (hopefully) not to add load. This will (every 1/4 of a second by default) look at the 'inactivity timer' in Windows (Kernel32.dll). After 10 seconds of inactivity the screen will appear to go black. What actually will happen is a window with a black background will cover you entire display so making it look like the screen has switched off. Bear in mind that the backlight will still actually be lit though as there seems no-way (without display drivers) of turning this off (I could write similar software to do this otherwise, or leave it to 'power management'). On moving mouse or touching keyboard display will re-appear as normal (for a key press, first press will make screen come on, 2nd will issue the command to cMP/CPlay).
Now the downside to no. 3. This may or may not effect sound quality with the program running, though it has been made to be low on resource use. Something you'd have to assess maybe? Last thing I'd want to do is upset the sound in any way! Maybe it won't?
If you want to give it a go, I'll make sure it will have a method of clean install/uninstall and it will activate in cMP mode, in XP mode will exit, as otherwise will drive you mad going blank so quickly when you're adjusting something! Of course 10 seconds is just an idea of how long I'd have it lit for, if it was for me. Could do it for any length of time you like, also the amount of 'inactivity checks' per second could be adjusted. Bear in mind that if it's not checking often, then when you move the mouse it may appear sluggish to bring the screen 'back to life'?
Theo, the 'disabling WFP' batch file could easily be modified to do the minlogon swap (though for licensing reasons the user would have to obtain 'minlogon' file as that can't be distributed legally by one of us). I could update this if you want? But the minlogon file would need placing in the same folder as the batch say (or in System32 folder as another example), then the script could be made to do the swap.
Andy, On your point of making automated cMP set-up scripts, the software I put together does do this but before releasing, I'd have to polish it up and make it more functional.
The problem is two parts:
1. A 'one item fits all' dilemma! Some people are using juli@, some USB dacs, some others ASIO sound cards etc. All these would need to be accommodated for. Some have system boards which blue screen if some devices are disabled, others are fine. Then there's the people who use networks, the people who don't etc. I think we could safely create something where it works with XP or nothing, so to speak. As it seems the general consensus that XP sounds better in a fully stripped down set-up?
2. Some of the files needed to achieve the results (e.g. the command utility that disables devices) are freely obtainable, but are Microsoft products, so cannot be directly distributed with the program / script files. These could though be maybe automatically downloaded by the setup software, assuming that user's pc is set up to access a network and the links to the items remained consistent. My cMP machine though was never put on the network, to keep it as clean as possible, so this would need to happen on another PC which was!
Anyway, both those points I think are pretty minor, and it would be good for something to automate the, let's face it, tedious process of all the Windows adjustments that need to be made. I think last time I did it manually, it took something like about 4 hours of grief lol.
Just a question too... Does anybody find that the sound of their setup goes off after a few days using cMP/CPlay (this includes re-booting / powering on / off over that period of time)? I find after about 5 days a rebuild / set-up 'freshens' the sound up again (starts sounding a bit loose in timing / grainy). May be my set-up, or something to do with using USB? Also, think my amps are needing a service desperately, so may all be to do with that? I'm using the AQVOX ASIO usb drivers. Not cheap, but they sound amazing! There's a free trial on their site for anyone who wants to give them a go (you just have to put up with it making an annoying 'beep' once every minute while in trial-mode, goes if you purchase license key).Anyway, thanks again for the feedback. I'm a bit of a hobbyist on the programming side, but find it so enjoyable none the less. Is the cMP2 project still 'open source' as I've never seen the source code to any of this? Wonder where you get it from? Looks like cics hasn't been posting here for a long time too... Still, his (or is it her?) legacy lives on! This forum and the cMP one is huge and still growing!
All the best,
Mark
Edits: 09/19/13 09/19/13 09/19/13 09/19/13
Thanks for the explanation for the monitor not turning off. I am slightly reluctant to get the facility back by re-enabling the display drivers because I fear for the sonic impact. Minimising cPLAY and playing with the palate colours is an option, as Theob has highlighted, but a big problem for me is that minimising only works once following the launch of a file. Once the window is maximised again (to take a quick peek at the track listing, perhaps) it stays that way until the file is closed and re-opened.
Your possible solution sounds pretty interesting and I’ll be more than happy to try it. Just as soon as you’re ready.
I fully appreciate the difficulty that differing hardware poses for automated set-up scripts. I myself have deviated a little from the “classic” cMP hardware. I started with the juli@ sound card, but I’ve moved across to asynchronous USB because I thought it sounded a little nicer.
If you do get around to producing some scripts, please count me in as a willing body for trials.
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: