Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ear Trumpet loses applications after mode switch and wake up from sleep (Sound BlasterX AE-5) #574

Closed
BuongiornoTexas opened this issue Oct 29, 2020 · 10 comments
Labels
type: bug A bug in EarTrumpet

Comments

@BuongiornoTexas
Copy link

I have a highly reproducible issue with a Sound BlasterX AE-5. This sound card has a software switch between speaker mode and headphone mode. The issue is:

  • If I switch between headphone and speaker mode or vice versa, Ear Trumpet loses all applications - the volume mixer shows just the master volume for the AE-5.
  • If I switch back, applications remain lost.
  • The applications appear correctly in the Windows legacy mixer after any mode switch.
  • If I exit and restart Ear Trumpet, applications are reinstated correctly.
  • Ear Trumpet also loses all AE-5 applications after waking from sleep, regardless of the mode I'm in (this is the real problem for me - I normally only use the headphone mode, so I'm only seeing the wake after sleep issue).

This is only a problem for the AE-5. I also have a Realtek onboard and a Focusrite Audio interface which do not lose applications after waking from sleep.

I think this may be related to #529. I've raised as a separate issue given the repeatability and specific hardware.

@riverar
Copy link
Contributor

riverar commented Nov 11, 2020

@BuongiornoTexas Interesting, thanks for the report. Open Start > type "sound mixer options" and hit Enter. Leave the [App volume and device preferences] window open and use that switch of yours. Does it correctly show apps in all cases?

I'll see if I can get a card to reproduce the issue with.

@riverar riverar added the type: bug A bug in EarTrumpet label Nov 11, 2020
@BuongiornoTexas
Copy link
Author

When I use the switch, the apparent behaviour is that apps are reassigned to the new device mode in [App volume device preferences]. So if I switch from speaker to headphones, all apps appear to switch to from speaker to headphone mode.

However, I should clarify the AE-5 behaviour. The software switch changes the device operating mode between headphone and speaker mode, but as far as I can tell Windows sees this as a change in a single audio output device - the device name stays the same in the legacy Playback devices and the app volume device preferences, and its order in the playback devices doesn't change. That is, switching does not disable/enable separate devices, but rather looks as though it is changing the internal states of a single device such as master volume and output path - but per app volume does not change with mode. (My apologies for the somewhat vague terminology - I don't have the right driver background to explain properly).

I suspect that what is actually happening is that the per app device assignments don't change because as far as Windows is concerned, something internal to the device has changed. (again, apologies for vague terminology)

If you need more detail on this, I can put together a set of screen shots.

@kachunkachunk
Copy link

Just want to add that this also occurs on the AE-9. And probably will continue to happen for Creative products that can switch to a dedicated headphone amp and back. Relaunching EarTrumpet is indeed the only workaround I've seen or used.

@riverar
Copy link
Contributor

riverar commented Dec 3, 2020

I'm trying to source hardware for a decent price to reproduce/fix. I missed out on a rare cheap AE-5 on eBay. You two got some serious hardware there!

@BuongiornoTexas
Copy link
Author

I needed something to fix a serious RF noise problem and was lucky enough to find an AE-5 on a deep discount.

I'll raise a parallel thread on r/SoundBlasterOfficial to see if we can get some hints from other users or maybe even something from the Creative reps (will be a couple of days though!).

@kachunkachunk
Copy link

Just FYI, it should be reproducible via #587, without needing to source specific hardware.

@M-Ryba
Copy link

M-Ryba commented Sep 17, 2021

I'm trying to source hardware for a decent price to reproduce/fix. I missed out on a rare cheap AE-5 on eBay. You two got some serious hardware there!

It also happens on the Creative X G6. I don't know where you live and where this is avaible but in Europe at least, Creative is selling b stock ones for cheap.

@HydrantHunter
Copy link

HydrantHunter commented Jul 18, 2022

After a bit of searching and testing, I've cobbled together an 'automated' workaround that saves the (admittedly minor) effort of having to quit and restart EarTrumpet after waking from sleep.

I realize the following instructions look like an impenetrable wall of text, but they aren't that complex - I just tried to be detailed enough so that nearly any skill level will be able to do it.

First is to get a shortcut/link to EarTrumpet. The only location I'm aware of that has a 'link' to EarTrumpet that you can create a shortcut from is the 'magic' Applications folder. To open that, use CMD/PowerShell/Start-Run and enter the following command:

explorer.exe shell:::{4234d49b-0245-4df3-B780-3893943456e1}

(That command was found at: https://superuser.com/questions/960406/where-are-all-locations-of-start-menu-folders-in-windows-10)

Find EarTrumpet in the folder that is opened, right click on EarTrumpet and select 'Create Shortcut', then select where you want the shortcut to be placed. Make sure you save it to a location you can find (I have a folder that I use for all my 'custom' shortcuts and other stuff that I don't just want 'lying around').

You can now close the "Applications" folder that you opened with the explorer.exe command from step 1.

Next, you'll want to create a batch file or script that handles killing and restarting EarTrumpet. I used a batch file named "restart_eartrumpet.bat" that I also placed in my 'custom' folder alongside the EarTrumpet shortcut created in the last step. To make a batch file, simply create a blank text file (via right click/New/Text Document) and replace the .txt extension with .bat when you name the file - you can still right click on the file and select 'Edit', just like with a text file. When double clicked, a batch file will execute any commands that are in the batch file, rather than opening the file in notepad for editing.

IMPORTANT NOTE: If you don't see the .txt extension, you'll need to tell Windows Explorer to show file extensions (or you can rename the file via a command line interface). In a typical Explorer window, you'll want to click on 'View' (near the top left, just under the main title bar), then (in the right most section called "Show/hide") make sure the checkbox next to "File name extensions" is checked.

Once your batch file is created and named, right click on it and select "Edit". When your editor (typically notepad) opens, copy and paste the following 3 lines into the document:

@echo off
taskkill /F /IM eartrumpet* /T
timeout /T 3 /NOBREAK

You'll need to add one more line, based on the following example:

start "" /B cmd "<path to your custom folder, including drive letter>\EarTrumpet.lnk"

for example: start "" /B cmd "C:\custom\EarTrumpet.lnk"

Save the file.

Now we need to automate the execution of this file whenever the computer wakes from sleep.

Click Start, then start typing the words Task Scheduler - once you see Task Scheduler offered as an option, click on it.

This link will guide you through how to create the task/trigger that will allow your PC to run your batch file whenever it wakes from sleep. See the second post, by DavidE for the custom XML script and how/where to enter it for your custom task, then continue reading this guide for the missing pieces:

https://www.sevenforums.com/general-discussion/308855-using-task-scheduler-restart-program-upon-wake-sleep.html

Set the task to use your user account (you may have to check the "Run with highest privileges' box if it is unable to stop the currently running instance of EarTrumpet), and to only run when the user is logged on. Configure for Windows 10.

In the Actions tab, click the 'New' button. In the 'New Action' pop-up dialogue make sure the defined Action is "Start a program". Then click the 'Browse' button next to the Program/script input box and navigate to where you placed your batch file and select the batch file.

On the Settings tab, I select the following 4 items, everything else is unchecked:

  • Allow task to be run on demand (this will allow you to manually execute the task from Task Scheduler via a right click/run should it not trigger for any reason)
  • Run task as soon as possible...
  • Stop task if it runs longer than 1 hour
  • If the running task does not end when requested, force it to stop

From the bottom pull-down menu, I select "Stop the existing instance"

Click the OK button at the bottom right of the dialogue box.

You can now test the scheduled event to ensure it works on your machine by right clicking on the entry and selecting 'Run'. The only problem I've seen so far tends to be timing based. You may need to edit the batch file and change the 3rd line (timeout...) to include a longer wait period (change the 3 to a higher number - this is the number of seconds the batch file will wait before starting the new instance of EarTrumpet after terminating the previous instance).

Once you have it working, it should trigger any time you wake from sleep. You will probably notice 2 EarTrumpet icons in the system tray. Windows does not remove system tray icons for programs that are terminated abnormally. Just swipe your mouse over the icons and the 'dead' one will vanish.

If I missed anything, ping me and I'll update this with any necessary corrections.

@kachunkachunk
Copy link

kachunkachunk commented Jul 18, 2022

That's a fine workaround. On that note, can Ear Trumpet be made to detect audio device additions and removals, and optionally kill and relaunch itself when this occurs? May be a desirable workaround for switching devices like the Creative line.

@riverar
Copy link
Contributor

riverar commented May 26, 2023

Tracking via master issue #1305, closing this one. (Feel free to keep the discussion going. We'll get this fixed up soon.)

@riverar riverar closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A bug in EarTrumpet
Projects
None yet
Development

No branches or pull requests

5 participants