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

Hard crash with Python 3.12 and simpleaudio #725

Open
eRnEgIi opened this issue Nov 8, 2024 · 4 comments · May be fixed by #730
Open

Hard crash with Python 3.12 and simpleaudio #725

eRnEgIi opened this issue Nov 8, 2024 · 4 comments · May be fixed by #730

Comments

@eRnEgIi
Copy link

eRnEgIi commented Nov 8, 2024

Environment
AYAB software version: main / 1.0.0-beta3 / 02d2c5d
Computer/OS: Ubuntu LTS 20 + Python 3.12 (not 3.11 as recommended)
Knitting machine: simulator
AYAB hardware: simulator

Describe the bug
After starting the knitting simulator the first three lines have been 'knitted' by the simulator.
Every time after the third row is done, the application crashed hard.
No exit code, no error log, no noting.
Even when running it from vscode with the debugger enabled, it crashed without any hint.

To Reproduce

  1. Use latest ayab-desktop (1.0.0-beta3) with python 3.12 an
  2. Load an image
  3. Select the simulator
  4. Start knitting

Expected behavior
The application simulates the knitting process. No crash expected.

Additional context
I am using pythoon 3.12 instead of the recommended version 3.12. Using 3.11 would have been much more work, as it is not the default python version that comes with Ubuntu 24.04. (and I am not so familiar with using differen python environments in parallel)
However I could understand that this is not a "real" bug, if I am not using the recommended pyhton version.
But for future releases I wanted to point to this problem, as it might help another developer who works on the next version.

I was able to point the Problem down to this issue: hamiltron/py-simple-audio#72
The described fix (pip install -U --force git+https://github.com/cexen/py-simple-audio.git) worked for me.

But as already mentioned. I am by far no expert in python or the implications of using different PyMem_* functions.
(I could try to create a pull request if this helps)

So maybe one of the maintainers has a better idea for the future?
(and if it is only to write a debug message and hint the user to mute sounds in the settings page)

@jonathanperret
Copy link
Contributor

Thank you for the feedback and congratulations on finding a workaround. This is a helpful warning for something we’ll need to consider as we eventually move off Python 3.11.

I understand you’re running AYAB from source, not using the AppImage build for Linux. Any reason why you didn’t use the build? If it can be made more useful please let us know.

For the specific simpleaudio bug you hit, this is now the second thing that makes me want to get rid of simpleaudio entirely (the first was that there are no Windows binaries available so it has to be built from source, requiring additional tooling). I already investigated a bit a while ago and it turns out Qt already includes facilities to play sounds — and this is code we are already bundling with AYAB so we may as well use it.

As you said though this is not an immediate priority — we may not change this before 1.0 is out.

@eRnEgIi eRnEgIi linked a pull request Nov 25, 2024 that will close this issue
@eRnEgIi
Copy link
Author

eRnEgIi commented Nov 30, 2024

Thank you for your fast reply :)

I was not using the AppImage because I didn't know that it existed. Otherwise I would have used it :)
Maybe because I was stuck in hold habits.

I tried to convert your hint to the Qt replacement into a pullrequest.
Maybe it helps in the future. Otherwise I am not upset If your ignore it :)

@elislo
Copy link

elislo commented Dec 2, 2024

I am running into the same problem, but I am trying to install AYAB on Raspbian. It's giving an error that the package simpleaudio is deprecated. Presumably there is an updated audio package that would be better to call on instead? I followed the linux install instructions in the AYAB manual. Thanks!

@eRnEgIi
Copy link
Author

eRnEgIi commented Dec 2, 2024

@elislo I provided a PR (#730) addressing this issue, by replacing simpleaudio with QSoundEffect.
However this is for the main branch. If you really want to use this version you can try one of the images from https://github.com/eRnEgIi/ayab-desktop/releases/tag/v1.0.0-test20243011 (build based on the current main branch with the linked PR).

Alternatively you could try one of the offical versions from https://github.com/AllYarnsAreBeautiful/ayab-desktop/releases

I would assume that the appimages are already containing the needed version.

@dl1com dl1com linked a pull request Dec 13, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants