ORelio / Sound-Manager

Manage and share Windows sound schemes, restoring missing sounds on recent Windows versions
79 stars 5 forks source link

Add support for patching startup sound on Windows 11 #6

Closed aryanchoudharypro closed 2 months ago

aryanchoudharypro commented 3 months ago

for context win 11 also has the sound embedded in a file named imageres.dll. this is use full because the startup sound takes time to play after the pc is booted so we can insted use that event as logon sound and change the start up sound

ORelio commented 3 months ago

Though this was a Pull request upon reading the notification 🙃

Patching the startup sound always has been finicky due to the OS trying to prevent us from doing so.

On Windows Vista and 7, it was still somewhat worth it because all sounds were working apart from that, and the OS had few major updates (service packs) so it was easy to have support for system modifications.

Starting with Windows 8, some sounds were removed so patching the system would not be enough. A background process was required for restoring the missing sounds anyway, so patching system files on later Windows versions became lass relevant.

Starting with Windows 10, Microsoft pushes major updates frequently, one or twice a year. These updates are a pain for any system customization tools, because system files can change drastically on each update. In our case, major updates would likely restore the system file imageres.dll back to its initial state (requiring to re-apply the sound scheme after every major update), but updates could even break the patching process, requiring to update the app.

As discussed in issue #1, since version v3.0.2 the startup sound is implemented using a scheduled task that should launch with a nearly imperceptible delay. I'll try check again if everything works as intended on Windows 11 as I'm delaying the upgrade due to multiple annoyances and still using Windows 10 on a daily basis.

TL;DR: Modifying system files comes with its own set of problems and should be avoided whenever possible.

aryanchoudharypro commented 3 months ago

o well i found a workaround wich works for me first, make your sound theme as you wish. second, enable the startup sound from settings wich gets disabled when installing the app. therd, change the sound using startup sound changer. and you have 2 sounds, the native windows sound initily on boot and then a login sound as soon as you login. note, i'll aappreciate if you could gide me to an open sorce startup sound changer, as the current one i use has issues with the screen reader i use. and thanks for makeing your app intirely accessable for blind user cause its had the best nvda screen support i have ever sean in any apps, thanks for this ossem thing

aryanchoudharypro commented 3 months ago

a recommendation for though's who mite be reading this issue. use the logon event if you have the start up sound enabled from windows

aryanchoudharypro commented 3 months ago

also, the logoff sound should play when i hiber nate my pc but it doesn't seam to happen and also the sounds for lock and unlock stop working for sometimes after i resume it from hibernate the login sound does not play when i resume it from hibernate

ORelio commented 3 months ago

Hi,

i found a workaround wich works for me

Indeed, to test patched startup sound you could:

  1. Disable startup sound in SoundManager (right click > Remove sound)
  2. Re-enable startup sound in mmsys.cpl > Sounds tab
  3. Patch startup sound using a third party utility

I'll investigate third party patching utilities such as startup sound changer. If I find some generic and reliable enough approach, I may consider implementing it in SoundManager. No promises or estimated deadlines.

use the logon event if you have the start up sound enabled from windows

Note that the login event is different from startup event. Windows plays a different sound on first logon after booting the system, which is called startup sound. Then on subsequent logons, it plays the login sound. There's an exception to this: Windows Vista. Vista plays the startup sound before you even reach the logon screen, then plays the logon sound for each logon. While you could set your startup sound as login event to have it played on subsequent logons, it's not the "standard" behaviour. Well, SoundManager is there to let you customize your system, so that's fine 😁

and thanks for makeing your app intirely accessable for blind user cause its had the best nvda screen support i have ever sean in any apps, thanks for this ossem thing

Honestly, I didn't even think that SoundManager would be more popular with blind users than most apps. Since it's all about sounds, it actually makes sense. I used the standard Windows Forms technology, which is very friendly with screen readers. I guess adding proper labels to each element did the trick. Thanks for your feedback about accessibility. I'll make sure to keep labelling the UI elements.

the logoff sound should play when i hiber nate my pc but it doesn't seam to happen and also the sounds for lock and unlock stop working for sometimes after i resume it from hibernate the login sound does not play when i resume it from hibernate

Regarding issues you have with logoff/lock/unlock sounds, I don't have them on Windows 10. These sounds always play even after hibernating Windows, so I guess something is broken with Windows 11. SoundManager subscribes to the workstation lock/unlock events, and uses the shutdownblockreason API to avoid being killed too early and have the chance to play the shutdown or logoff sound. I'll also have a look at how SoundManager performs on recent Windows 11 builds, to see if I can reproduce your issues. Again, Microsoft can make major changes once or twice a year, so things can break. Although breaking standard Windows APIs would be bad for other apps too...

aryanchoudharypro commented 3 months ago

thanks for responding, and yeah its true that blind windows users use this app, cause we have sounds to custimize our pc, so why not. i came here to this app for an intirely veard reason though, but i liked the idea, so, i have even told my friends about this app.

aryanchoudharypro commented 3 months ago

If you cannot install windows 11 as a daily driver, you could make a dual boot setup with windows 10 and 11 if you have enough space available ,that's what I do. You can then for example go to windows 11 to test whatever you want to test and then come back to windows 10 when you want to use your PC normally

ORelio commented 3 months ago

I'm using virtual machines since I need to test on XP, Vista, 7, 8, 10 and 11.

aryanchoudharypro commented 2 months ago

ok, so i found another thing that needs to be fixed but i am not shure about weather to create a sepret issue, could you gide me?

ORelio commented 2 months ago

@aryanchoudharypro There is no "Secret issue" feature but it seems like Github added a feature to report vulnerabilities. Never used it, but enabled it just for you: Security > Report a vulnerability. The report should be private. Here is a direct link: https://github.com/ORelio/Sound-Manager/security/advisories/new

ORelio commented 2 months ago

I'm happy to let you know that after significant reworking, you can now patch the startup sound of Windows 8, 10 and 11. This involved totally rewriting the patch routine, improving related features and translations to make them more generic to all Windows versions, and intensive testing under Windows XP, Vista, 7, 8, 10 and 11. But it was worth it, since there is now zero delay in playing custom startup sounds on any windows version. During my testing, I noticed that the current workarounds for reducing startup delay (#1) worked well under Windows 10, but not under Windows 8 or 11.

:arrow_forward: As per Sound Manager v3.3.0, simply launch SoundManager as administrator, check [X] Patch the built-in system startup sound under the Settings tab, and you're ready to go.