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

App crash when using specific Windows utilities #25

Open
JavideSs opened this issue Feb 25, 2023 · 4 comments
Open

App crash when using specific Windows utilities #25

JavideSs opened this issue Feb 25, 2023 · 4 comments

Comments

@JavideSs
Copy link

JavideSs commented Feb 25, 2023

Hi,
I tried just_playback and it worked! But I have a problem integrating it with my app.

When there is an instruction where a specific Windows component is used, it crashes.
Can't open tkinter filedialog, application freezes.
Also, my module ported from c++ to use the Taskbar Thumbnail Toolbar causes the application to terminate when the ThumbBarSetImageList() function is called.

Working on Windows 10 with Python 3.10.

Example

from just_playback import Playback
from tkinter import filedialog
playback = Playback()
playback.load_file('music-files/sample.mp3')
playback.play()
filedialog.askdirectory(title="Select folder")
@cheofusi
Copy link
Owner

The sample code runs fine on my Linux machine.

This seems to be a problem with tkinter on Windows as discussed here and here. Try issuing all calls on the Playback object in a separate thread.

@JavideSs
Copy link
Author

It isn't an interface freeze error. The tkinter app works fine.
Crash when there is a call to a particular windows utility. Maybe a bad interaction with a dll.

Windows 10,11. In linux works fine.

from just_playback import Playback
from tkinter import filedialog
playback = Playback() #removing this initialization the problem disappears
filedialog.askdirectory(title="Select folder") #not shown, crash
print("not executed")

No problem with a new thread. I don't know why it works, but it's not the right way

@cheofusi
Copy link
Owner

No problem with a new thread. I don't know why it works, but it's not the right way

So it does work in a separate thread? And if it does why do you feel it's not right?

@JavideSs
Copy link
Author

It worked with the pygame.mixer module without the need for a new thread.
The tkinter app works fine, it even plays songs with just_playback and everything works fine. Except when I use filedialog() or Taskbar Thumbnail Toolbar in Windows.
A non-blocking call such as Playback() should not crash specific functions.
I can't do ctrl+c to terminate the example program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants