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

EarTrumpet holds some programs in use (Twitch, Spotify, Telegram, etc.) #273

Closed
shinji257 opened this issue Jul 26, 2018 · 32 comments
Closed
Labels
status: blocked Something is preventing us from continuing on this item type: windows-bug A bug in Windows that impacts EarTrumpet

Comments

@shinji257
Copy link

I actually don't know what is happening here but when Twitch goes to update it throws a sharing violation in its logs on Twitch.exe even though the app isn't running at all. I thought it was due to a bugged self-updater but I tried running the actual updater directly and it still halted. At that point prior diagnosis (Using Process Explorer) showed that EarTrumpet did hold a handle on Twitch.exe even when the program was closed so I closed EarTrumpet this time (after the manual update attempt) and it went straight through.

There are a few possible scenarios here and I'm not sure how easy it is to test. Note that this has literally only happened with Twitch so if there is anything you want me to do then please ask.

  1. A handle is grabbed when the app starts playing audio (aka stream) and is failing to release the handle for some reason when the app is killed by the updater.
  2. A handle is grabbed when EarTrumpet redirects the audio for the app.

Most likely the next opportunity to debug will be when it needs to update but in the meantime I'll try to see if I can get the issue to trigger. If memory serves I think I had trouble deleting the file even via Windows Explorer so...

@shinji257
Copy link
Author

shinji257 commented Jul 26, 2018

Already got a reproduction but my original diagnosis may have been wrong. The issue happens after the audio has been redirected even if the app is closed properly. It does seem to release the handle eventually but while it is holding it is blocking file interactions.

Anyways to make it not blocking? I will have to wait for the next update to see if the message does clear eventually or if I was just impatient.

@riverar
Copy link
Contributor

riverar commented Jul 26, 2018

Related #257

Fixed this in ba9b3d1; we'll get this uploaded to the Store so it can go out in the next few days. Thanks for your patience! This happens for Win32 apps that emit audio and we go to retrieve the icon from its executable. Should see a lingering handle in Process Explorer, if you're interested.

@shinji257
Copy link
Author

Ahh ok. That makes sense. I did mention earlier I saw the open handle after the executable closed so now that explains why. Thanks for the update. 👍

@riverar riverar added the type: bug A bug in EarTrumpet label Jul 27, 2018
@gate1975mlm
Copy link

I have a simular issue when trying to update Spotify too.

When I try and update Spotify it keeps giving me some kind of error and says Spotify is in use and I should close it even though it already is closed and not running. Now that I think about it I think this issue started around the time I first started using EarTrumpet.

Hopefully the new EarTrumpet update fixes this issue with updating Spotify too.

@whoiskevinrich
Copy link

Any update on this? I'm still having the issue. From this reddit thread it seems like it's fairly common.

I installed the windows app, but haven't seen an update that resolves the issue yet.

@riverar
Copy link
Contributor

riverar commented Aug 7, 2018

Hey all! This got fixed in EarTrumpet 2.0.5.0, went out August 1. Are you still seeing this issue in that version?

@gate1975mlm
Copy link

gate1975mlm commented Aug 7, 2018

Not fixed for me with EarTrumpet 2.0.5.0 and latest update from Spotify!

I am using EarTrumpet 2.0.5.0 and I just tried updating desktop version of Spotify and it gave men an error and just hanged. As soon as I exited EarTrumpet and restarted Spotify the update installed.

riverar can you please install desktop version of Spotify and then try updating it with EarTrumpet 2.0.5.0 running and you should see the same issue as I am seeing. There was a new Spotify update just released to get it click the 3 white dots in the upper left corner and then highlight Help and then about Spotify and it will say "update available" or something like that next to the version number.

@gate1975mlm
Copy link

Actually now that I think about it my issue with Spotify not updating may be be a completely different issue then shinji257 with his Twitch issue?

Even if I am not playing any music but still have Spotify open it is showing in EarTrumpet. So I guess that is why Spotify will not update. Can this be fixed are will I always need to make sure EarTrumpet is not running before attempting to update Spotify?

@stevehoek
Copy link

Still an issue for me as well in 2.0.5 when trying to update Spotify

@shinji257
Copy link
Author

Sorry for the late response but I forced an update on Twitch finally and it is still present on 2.0.5.0 here as well.

@rebel2k
Copy link

rebel2k commented Aug 22, 2018

I second that, it's still present for me too, at least for Spotify (I didn't have problem updating the Twitch app recently).

@riverar
Copy link
Contributor

riverar commented Aug 22, 2018

I've seen many instances where Spotify is locked by the Windows kernel, probably a result of some driver or anti-virus. Does closing EarTrumpet still fix the problem? If so...

Whenever this locking occurs, please do the following:

  1. Download/run https://live.sysinternals.com/procexp.exe as Administrator
  2. Find EarTrumpet.exe and click it
  3. Ensure the bottom pane is showing open handles (View > Lower Pane View > Handles)
  4. File > Save As > EarTrumpet.txt (or anything)
  5. Drag/drop that file into this GitHub issue.

Optional: Repeat the steps above for Spotify.exe.

Thanks!

@shinji257
Copy link
Author

So I checked and the Twitch.exe file handle is on PID 4. However it doesn't go away until EarTrumpet exits even when the program is closed for updating.

@riverar
Copy link
Contributor

riverar commented Aug 22, 2018

I can reproduce this, thank you. How strange. Investigating further.

Repro steps:

  1. Start Twitch
  2. Start EarTrumpet
  3. Exit Twitch
  4. Note System has open handle to Twitch.exe
  5. Exit EarTrumpet, note handle is closed

@rebel2k
Copy link

rebel2k commented Aug 23, 2018

Yep, for the record, I also did the following test:

  1. Start Spotify, update available.
  2. Click on download update and restart.
  3. Install never ends.
  4. Kill it, restart Spotify. Install doesn't go further.
  5. Close EarTrumpet.
  6. Restart Spotify ==> Install works.

Hope you'll be able to find what's wrong! :)

@xintron
Copy link

xintron commented Aug 28, 2018

Also having these issues with some applications like Spotify and Telegram (after media playback has been used). Closing EarTrumpet allows both Spotify and Telegram to successfully upgrade.

@riverar riverar added type: windows-bug A bug in Windows that impacts EarTrumpet status: blocked Something is preventing us from continuing on this item and removed type: bug A bug in EarTrumpet labels Sep 1, 2018
@riverar
Copy link
Contributor

riverar commented Sep 1, 2018

We've identified the problem and contacted Microsoft. Will provide more info as we receive it. (It's a holiday weekend for us, so likely won't hear anything until Tuesday sadly.)

@riverar riverar changed the title EarTrumpet holds some programs in use (Twitch app) EarTrumpet holds some programs in use (Twitch, Spotify, Telegram, etc.) Sep 1, 2018
@gate1975mlm
Copy link

Is this fixed yet?

Thanks

@riverar
Copy link
Contributor

riverar commented Sep 19, 2018

Not yet, still working with Microsoft on this.

@ghost
Copy link

ghost commented Nov 24, 2018

@riverar Do you know anything about the status of the fix?

@riverar
Copy link
Contributor

riverar commented Nov 24, 2018

Microsoft is aware of the issue but only have a fix for the next release of Windows 10 (19H1). I'm still pushing them to get a patch for us on Windows 10 October Update (1809).

@riverar
Copy link
Contributor

riverar commented Jan 11, 2019

Microsoft has confirmed a fix cannot be made for Windows 10 October Update (1809). We're researching potential workarounds. 😓

@whoiskevinrich
Copy link

Thanks for updating us. Keep up the good work!

@WhAtEvErYoUmEaN
Copy link

WhAtEvErYoUmEaN commented Feb 3, 2019

@riverar You could try (Icon)Icon.FromHandle(iconHandle).Clone() which immediately releases the handle at the expense of storing an icon copy in your own memory space.

I haven't tried it with EarTrumpet yet but had a similiar problem with a viewer i wrote to get icons out various windows DLLs.

Edit: To add, it seems like you're also calling DestroyIcon from IconUtils.cs in finally after you return. Meaning in a successful scenario it'd never be executed. (Correct me if i'm missing something obvious here.)
Since i'm now hooked on the issue because i'm affected myself i'll try it on my end.

@WolfganP
Copy link

WolfganP commented Feb 3, 2019

I was suffering a similar case (Spotify couldn't finish update due to system having spotify.exe file locked) and I was going crazy trying to troubleshoot the cause (even sysinternal tools don't show spotify.exe handle as being locked).

I tried closing EarTrumpet and the update proceeded OK, good to know the root cause now :-) and I hope it's being resolved by Microsoft.

@shinji257
Copy link
Author

I'm going to add that Twitch seems to have resolved it on their end. I got an update just recently to their launcher and it went through without closing EarTrumpet first or throwing an error. I don't believe it could have been anything else yet given the information in this thread.

@riverar
Copy link
Contributor

riverar commented Feb 3, 2019

@WhAtEvErYoUmEaN Appreciate you looking into it, however Microsoft has confirmed this is a fundamental issue with Desktop Bridge and the way they shim file system access. We are, however, considering a workaround that involves running our icon logic through an external broker. Just waiting for Microsoft to get back to us.

@ghost
Copy link

ghost commented Feb 27, 2019

@riverar Is there any hope that a fix will be included in 19H1?

@DeVaulted
Copy link

Any news for this bug? Otherwise it might be nice for a little pop-up or similar to be triggered the first time you start Spotify/any affected app with EarTrumpet running, it took me ages to figure out why Spotify wasn't updating properly.

@stevehoek
Copy link

I don't experience this problem anymore on Windows 10 1903 and latest version of EarTrumpet.
Amazon Music and Spotify both update correctly while EarTrumpet is running.

@DeVaulted
Copy link

@stevehoek Interesting, for some reason my Windows hadn't automatically updated to 1903. Doing that right now, will report again in case the issue still happens. Until then, ignore everything I said 😬

@riverar
Copy link
Contributor

riverar commented Aug 22, 2019

Yep, upgrading to 1903 will resolve this for you. Going to close this as 1903 is available for download.

@riverar riverar closed this as completed Aug 22, 2019
riverar pushed a commit that referenced this issue Nov 20, 2020
#273 has been closed, updating to 1903 resolves it.
#367 has been closed in 5810482.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked Something is preventing us from continuing on this item type: windows-bug A bug in Windows that impacts EarTrumpet
Projects
None yet
Development

No branches or pull requests

10 participants