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

Pd-0.52-1 on Windows11 crashes with ASIO #1532

Closed
Drugo23 opened this issue Dec 27, 2021 · 55 comments
Closed

Pd-0.52-1 on Windows11 crashes with ASIO #1532

Drugo23 opened this issue Dec 27, 2021 · 55 comments

Comments

@Drugo23
Copy link

Drugo23 commented Dec 27, 2021

I am not able to open Pd 0.52-1 on a Windows 11 PC. If I try to open a .pd file I get this message:

Screenshot (7)

@Lucarda
Copy link
Contributor

Lucarda commented Dec 28, 2021

Hi,

  • did you correctly un-installed any Pd previous version?

  • how did you install Pd?

  • does Pd opens via its app icon?

    • (I haven't experienced Win11 yet: there's no start menu right?)

If you open the windows registry and navigate to:

Computer\HKEY_CLASSES_ROOT\PureData\shell\open\command

What is the value of that key?

@Drugo23
Copy link
Author

Drugo23 commented Dec 29, 2021

did you correctly un-installed any Pd previous version? yes

how did you install Pd? with the automatic installer

does Pd opens via its app icon? no

If I open the windows registry and navigate to (not sure this is what you are looking for):
Screenshot (9)

@Lucarda
Copy link
Contributor

Lucarda commented Dec 29, 2021

did you correctly un-installed any Pd previous version? yes

Good. (see below: [1])

how did you install Pd? with the automatic installer

Good.

does Pd opens via its app icon? no

Oops (see below: [1])

If I open the windows registry and navigate to (not sure this is what you are looking for):

That looks good.


[1]:

I'm assuming that Pd less than 0.52-1 worked on Win11?

  • is this correct?

@Drugo23
Copy link
Author

Drugo23 commented Dec 29, 2021

I'm assuming that Pd less than 0.52-1 worked on Win11?

yes

@Lucarda
Copy link
Contributor

Lucarda commented Dec 29, 2021

I'm assuming that Pd less than 0.52-1 worked on Win11?

yes

I think (only think) that 0.52-1 should be Ok with Win11 given that earlier Pds worked on your system.

  1. Can you confirm that C:\Program Files\Pd\bin\pd.exe exist on your system?

  2. If it does exist: Double-click on it: Pd should at least start: (is this correct?)

@Drugo23
Copy link
Author

Drugo23 commented Dec 29, 2021

Can you confirm that C:\Program Files\Pd\bin\pd.exe exist on your system? yes

If it does exist: Double-click on it: Pd should at least start: No

@Lucarda
Copy link
Contributor

Lucarda commented Dec 30, 2021

Open the file explorer and navigate to C:\Program Files\Pd\bin.

On the location bar click over C:\Program Files\Pd\bin and type "cmd" the press the enter key: A terminal should open at C:\Program Files\Pd\bin.

Type pd -noprefs and press enter.

Does Pd starts?

@Drugo23
Copy link
Author

Drugo23 commented Dec 30, 2021

this way it works! How can I make it work by just clicking on the icon app?

@Drugo23
Copy link
Author

Drugo23 commented Dec 30, 2021

It actually works even without the -noprefs flag

@umlaeute
Copy link
Contributor

umlaeute commented Jan 1, 2022

It actually works even without the -noprefs flag

???
isn't this a direct contradiction to this entire bug report?

do you want to say that "it now works, regardless of how you start Pd? (probably because you started Pd with -noprefs once and that magically fixed something permanently; but maybe because of something else)"

or something else?

can this issue now be closed?

@Ant1r
Copy link
Contributor

Ant1r commented Jan 2, 2022

I believe @Drugo23 only said that Pd can be opened via the terminal, with or without the -noprefs flag.
But not that Pd can now be opened normally (by clicking on the app icon or by double clicking a patch file).

OTOH I cannot reproduce here: after installing Pd 0.52-1 on a brand new Windows11 computer, I can open Pd with both ways (clicking the app icon / opening patches though the file explorer).

@Drugo23
Copy link
Author

Drugo23 commented Jan 2, 2022

If I install pd 0.52-1 I am just able to open it with cmd and typing pd -noprefs. I think this might be related with the -noprefs flag. That needs to be loaded as startup flag to be able to open pd.

@Spacechild1
Copy link
Contributor

That needs to be loaded as startup flag to be able to open pd.

I guess you have corrupted preference settings in your registry then. Try to open Pd with -noprefs and then save all settings. After that you might be able to open Pd normally again. Otherwise, try to wipe the existing Pd preferences from the registry.

@Drugo23
Copy link
Author

Drugo23 commented Jan 3, 2022

The things is that now I can only only use pd with -noprefs. If I put any other flag as startup I am not able to open pd. I have also tried to delete REG_SZ and reinstalled pd but no luck.

@Lucarda
Copy link
Contributor

Lucarda commented Jan 3, 2022

Try:

pd -noprefs

navigate to Pd/file/preferences/forgetall

quit Pd

start Pd via the app icon.

@umlaeute
Copy link
Contributor

umlaeute commented Jan 3, 2022

i think there are some confusions in the report, which i would like to resolve...

going back to the original report on top of this page, @Drugo23 said:

If I try to open a .pd file I get this message

the screenshot posted relates directly to the opened laser_test.pd patch.
the screenshot also indicates, that the GUI is not fully built up while some commands are executed that rely on the entire GUI.

the rest of the description seems to indicate that Pd always fails to open (and I think everybody who tried to investigate assumed that Pd was opened "just so" without success).
this is confirmed by @Drugo23 's:

does Pd opens via its app icon? no

however, we have no error message for this case. could you provide one?

also, i still do not understand the -noprefs situation:

@Ant1r tried to clarify it with the (plausible) description that:

I believe @Drugo23 only said that Pd can be opened via the terminal, with or without the -noprefs flag.

however, @Drugo23 did not confirm this so far and instead said (later):

I can only only use pd with -noprefs

so what is the situation?

to me these are different kinds of trying to start Pd and i'm lost which errors you get for which...

If I put any other flag as startup I am not able to open pd

where do you put the "flag as startup"? what is the error message you get?

I have also [...] reinstalled pd but no luck.

re-installing Pd does not wipe any preferences, so if the problem is indeed related to that, so i understand that re-installing wouldn't actually help.

  • which exact version of Pd did you install (please provide a link to the download itself)?

  • which GUI-plugins are installed?

  • is it possible to get a dump of the registry (obviously only the Pd-part of the registry) (@Spacechild1 and @Lucarda might have a better idea than me how to obtain one)

  • are there any files in %AppData%\Pd\.config\org.puredata? if so, could you provide them?

  • full error logs (preferably in text format)

  • also add -stderr to your startup flags and see what is reported on the CLI.

@Lucarda
Copy link
Contributor

Lucarda commented Jan 3, 2022

@Drugo23

To export the Pd registry to a text file:

open the registry and navigate to

Computer\HKEY_CURRENT_USER\Software\Pure-Data

Right-click on the Pure-Data folder in the left column and select "export". Choose the .txt file extension and give it a name.

Then (probably zip it) and drop the file in your next post so we can get it.

@Drugo23
Copy link
Author

Drugo23 commented Jan 3, 2022

which exact version of Pd did you install (please provide a link to the download itself)?

0.52-1 downloaded here: http://msp.ucsd.edu/software.html

which GUI-plugins are installed?

none

are there any files in %AppData%\Pd.config\org.puredata? if so, could you provide them?

I can't find this directory

full error logs (preferably in text format)

I am not getting errors anymore, pd just doesn't start.

also add -stderr to your startup flags and see what is reported on the CLI

If I just add -stderr pd doesn't start if I add -noprefs -stderr pd starts and nothing comes out on CLI

is it possible to get a dump of the registry (obviously only the Pd-part of the registry)
preferences.zip

@Lucarda
Copy link
Contributor

Lucarda commented Jan 3, 2022

Your preferences.zip shows lots of troubles. (the registry went corrupted somehow, not your fault I believe.)

option 1:

You could try pd -noprefs and then

  • navigate to Pd/file/preferences/forgetall

  • quit Pd

  • start Pd via the app icon.

  • you should re-add all your old externals paths


option 2:

If you want a sane fresh-up (I think you should opt this) do the following:

  • go to Control Panel\All Control Panel Items\Programs and Features (not sure where this is located on Win11) and uninstall Pd.

  • check that C:\Program Files\Pd\ no longer exists

    • in your case it could exist since you had installed externals on the extra folder and this files won't be wiped by the uninstaller.

      • copy somewhere safe any .pd file of yours and delete the rest.
  • now that you are sure nothing important is in C:\Program Files\Pd\ delete the Pd folder.

  • on the registry navigate to Computer\HKEY_CURRENT_USER\Software\Pure-Data and delete the hole Pure-Data folder.

  • Install Pd.

Also sane:

I recommend you to use C:/Users/Paolo/Documents/Pd as the only place to install externals.

try to locate and wipe all externals not in C:/Users/Paolo/Documents/Pd

re-install all externals.


Hope this helps you.

PS: as of "how the registry got corrupted?": not sure. It can happen. I never expedience it myself but there were 2 or 3 reports of such thing in the past (6?) years.

PS2: Is your Win11 an update of Win10 or is it a plain new Win11 machine?

@umlaeute
Copy link
Contributor

umlaeute commented Jan 3, 2022 via email

@Drugo23
Copy link
Author

Drugo23 commented Jan 3, 2022

I followed the Option 2 and everything seems to work properly. Thanks!

Is your Win11 an update of Win10 or is it a plain new Win11 machine?

it is an update

please provide a link to the download itself

http://msp.ucsd.edu/Software/pd-0.52-1.windows-installer.exe

@umlaeute
Copy link
Contributor

umlaeute commented Jan 3, 2022

and everything seems to work properly.

so can we close this ticket?

@Drugo23
Copy link
Author

Drugo23 commented Jan 4, 2022

Hi, I'm sorry to bother again but I think all of this might be related to the -asio flag. I have tested other flags and everything works fine but if I put -asio as startup or on cmd line pd doesn't start.

@umlaeute
Copy link
Contributor

umlaeute commented Jan 4, 2022 via email

@Drugo23
Copy link
Author

Drugo23 commented Jan 4, 2022

Why would you put it on the cmdline or in the startup flags (as opposed to just selecting ASIO via the media menu and then saving the preferences)?

I didn't think out that..!

I actually just tested it and pd crashes after selecting (ASIO) portaudio with DSP off. If I turn on the DSP with standard (MMIO) and then I select (ASIO) portaudio I get this error:

Fatal Error

Failed to register menu window class

@Spacechild1
Copy link
Contributor

I suspect one of the ASIO drivers is misbehaving. Does ASIO work in other audio programs? Which ASIO drivers do you have installed on your system?

If you don't have a DAW installed, just quickly download and install REAPER (www.reaper.fm).
Then go to Options -> Preferences -> Audio -> Device and select "ASIO" as the "Audio System". Click into the "ASIO driver" list box and make a screenshot of the list (or type it out :-)

@Spacechild1
Copy link
Contributor

As a side note: the crash when selecting ASIO might also explain why your preferences got corrupted.

@Drugo23
Copy link
Author

Drugo23 commented Jan 4, 2022

Does ASIO work in other audio programs?

yes, as well with pd 0.51-4

Which ASIO drivers do you have installed on your system?

Screenshot (14)

@Spacechild1
Copy link
Contributor

At this point, the only thing we can do is run Pd in a debugger to find out where it crashes when you select ASIO.

Unfortunately, on Windows this is not really trivial because we would need to setup Msys2. Are you ready to put in some work?

@umlaeute umlaeute changed the title Can't Open Pd 0.52-1 on WIndows 11 Pd 0.52-1 on WIndows11 crashes with ASIO Jan 4, 2022
@umlaeute umlaeute changed the title Pd 0.52-1 on WIndows11 crashes with ASIO Pd-0.52-1 on Windows11 crashes with ASIO Jan 4, 2022
@Spacechild1
Copy link
Contributor

Great! First, download and install Msys2 as described in https://www.msys2.org/ and tell me when you're done.

@Drugo23
Copy link
Author

Drugo23 commented Jan 4, 2022

Hi, I have installed Msys2 but to make sure I did everything right I will tell you the steps I did:

  • installed mysys2
  • copied and pasted: pacman -Syu
  • typed Y
  • reopened Mysys2
  • copied and pasted: pacman -Su
  • typed Y

is everything correct? (steps 7-8-9 are not super clear to me)

@Spacechild1
Copy link
Contributor

Cool! Now open the Msys2 MINGW64 shell and install the GCC toolchain:
pacman -S mingw-w64-x86_64-toolchain
After that you should be able to type gdb -v and the console should print a version number.

@pure-data pure-data deleted a comment from Drugo23 Jan 5, 2022
@Drugo23
Copy link
Author

Drugo23 commented Jan 5, 2022

Ok that's what I get:

GNU gdb (GDB) 11.1
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

@Spacechild1
Copy link
Contributor

Spacechild1 commented Jan 5, 2022

Great! Now run Pd in gdb like this:

gdb --args pd.exe -noprefs

(If it can't find pd.exe, make sure that Pd's bin folder is in your PATH.)

Then in the (gdb) prompt, type run and press Enter. Pd should now start up.

When you select ASIO and Pd crashes, type bt in the gdb prompt and it will output the list of functions that have been called up to the crash. Copy this output and post it here (in code tags).

@Drugo23
Copy link
Author

Drugo23 commented Jan 5, 2022

Hi, it looks like MINGW64 cannot find pd.exe

(If it can't find pd.exe, make sure that Pd's bin folder is in your PATH.)

I am not sure what do you mean by that but I have also tried:
gdb --args C:\Program Files\Pd\bin\pd.exe -noprefs but it doesn't work

@Lucarda
Copy link
Contributor

Lucarda commented Jan 5, 2022

open the windows file explorer and navigate to C:\Program Files\Pd\ and leave this window open.

open msys2 MinGW64 shell and type cd and a space. Drag from the windows explorer the bin folder and drop it in the MinGW64 shell. press enter. Now the MinGW shell it at /c/Program Files/Pd/bin

run gdb --args pd.exe -noprefs

As @Spacechild1 said:

Then in the (gdb) prompt, type run and press Enter. Pd should now start up.

When you select ASIO and Pd crashes, type bt in the gdb prompt and it will output the list of functions that have been called up to the crash. Copy this output and post it here (in code tags).

@Drugo23
Copy link
Author

Drugo23 commented Jan 5, 2022

ok! I think I made it.
pd-debug.txt

@Lucarda
Copy link
Contributor

Lucarda commented Jan 5, 2022

@Drugo23 if you get results from gdb and all went good please try the following. (i see it went good as I type this :)

I'm uploading here a pd.dll with all debug symbols (the file is larger in size). It comes from a build I just did from http://msp.ucsd.edu/Software/pd-0.52-1.src.tar.gz

This will print more useful debug info.

to use it go to (in windows explorer) C:\Program Files\Pd\bin and rename pd.dll to pd.dll.orig. then download and extract:

pd.dll-debug-symbols.zip

to C:\Program Files\Pd\bin this new dll.

quit Pd and mingw and then do the replace.

Redo all the gdb thing with the new pd.dll.

when you get the crash type bt and then press 3 times more enter.

PS: you can later (not yet if we need more tests) delete pd.dll and go back to the original and rename it accordingly.

@Spacechild1
Copy link
Contributor

Spacechild1 commented Jan 5, 2022

@Drugo23 Thanks, this is very helpful!

I had a quick look at your output and it seems like ASIO drivers are loaded before COM is initialized (CoInitialize non ▒ stato chiamato). Maybe Pd accidentally tries to obtain device information before calling pa_init. Will have a look.

@Drugo23
Copy link
Author

Drugo23 commented Jan 5, 2022

@Lucarda I'm not able to open pd with your method. that's what I get:
pd-debug-2.txt

@Drugo23
Copy link
Author

Drugo23 commented Jan 5, 2022

CoInitialize non ▒ stato chiamato

@Spacechild1 if that might be helpful in italian it means: "Coinitialize is not been called"

@Lucarda
Copy link
Contributor

Lucarda commented Jan 5, 2022

I'm not able to open pd with your method

Oh yeah. the wish85 stuff.

give me 5 minutes.

:)

@Spacechild1
Copy link
Contributor

Spacechild1 commented Jan 5, 2022

@Drugo23 Grazie, ma ho studiato l'italiano in scuola :-)

@Lucarda
Copy link
Contributor

Lucarda commented Jan 5, 2022

@Drugo23 delete the large size pd.dll and rename pd.dll.orig back to pd.dll. We leave your standard Pd installation in peace.

here you can download a zip version of Pd:

https://nc.nubegris.com.ar/index.php/s/NKmCRQmEE6F7qok

extract it to the desktop (or anywhere you like).

Do a gdb with this version.

open the mingw64 shell and cd to the new bin folder.

lets see what you get.

:)

@Drugo23
Copy link
Author

Drugo23 commented Jan 5, 2022

@Lucarda here you go:
pd-debug-3.txt

@Spacechild1 bravo!

@Drugo23
Copy link
Author

Drugo23 commented Jan 5, 2022

when you get the crash type bt and then press 3 times more enter.

I forgot about this..but I don't think it really changes anything:
pud-debug-4.txt

@Lucarda
Copy link
Contributor

Lucarda commented Jan 5, 2022

@Drugo23

Thanks. just to confirm: you get this (crash) only when you tried to select the ASIO driver?

@Spacechild1
Copy link
Contributor

I had a quick look at your output and it seems like ASIO drivers are loaded before COM is initialized (CoInitialize non ▒ stato chiamato). Maybe Pd accidentally tries to obtain device information before calling pa_init. Will have a look.

False alarm, COM is initialized properly.

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ffae62073c9 in glist_getcanvas (x=0xfeeefeeefeeefeee) at g_graph.c:200
200     g_graph.c: No such file or directory.
(gdb) bt
#0  0x00007ffae62073c9 in glist_getcanvas (x=0xfeeefeeefeeefeee)
    at g_graph.c:200
#1  glist_retext (glist=0xfeeefeeefeeefeee, y=0x1c25d0a8e80) at g_graph.c:174
#2  0x00007ffae625ba0c in sys_flushqueue () at s_inter.c:911
#3  sys_poll_togui () at s_inter.c:934
#4  sys_pollgui () at s_inter.c:1000
#5  0x00007ffae625672f in sched_idletask () at m_sched.c:299
#6  0x00007ffae62571f7 in m_pollingscheduler () at m_sched.c:375
#7  m_mainloop () at m_sched.c:432

The stack trace doesn't make any sense. sys_flushqueue() shouldn't call glist_retext(). Something is messing with the stack...

@Drugo23
Copy link
Author

Drugo23 commented Jan 5, 2022

@Drugo23

Thanks. just to confirm: you get this (crash) only when you tried to select the ASIO driver?

Yes. When I select ASIO pd partially freeze. For example I can open audio preferences but I cannot open audio test.

@Spacechild1
Copy link
Contributor

Spacechild1 commented Jan 5, 2022

I know this is very annoying, but can you try to uninstall your ASIO drivers to see which one causes the crashes?

Alternatively, can you take another Windows machine and consecutively install the ASIO drivers from your current machine until you get the crash?

Personally, I never had issues with "ASIO4All" and "JackRouter", so you might start with the other two.

@Drugo23
Copy link
Author

Drugo23 commented Jan 6, 2022

found it! the one it was causing the issue was JACK. without that I am able to select ASIO

@Spacechild1
Copy link
Contributor

That's strange. JackRouter doesn't crash Pd 0.52 for me, but then again I'm still on Windows 7/10. Also, I don't know what could have possible changed between Pd 0.51 and Pd 0.52 that causes this issue...

@Drugo23
Copy link
Author

Drugo23 commented Jan 8, 2022

I’ve unistalled Jack and reinstalled the last version. Now Pd doesn’t crash anymore, it might be that there was an old version of jack installed.

@Spacechild1
Copy link
Contributor

Ok, cool! I think I can close this now.

@Spacechild1
Copy link
Contributor

In retrospect, this whole issue sounds a lot like jackaudio/jack2#380. I just remembered it now...

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

5 participants