Exception Code 0xb, Audacity won't record if "Audible Input Monitoring" selected

Hi

4 days ago I started to get this warning whenever I closed a large project without saving:
“Exception code 0xb”.

I tried updating but did it through the software centre and didn’t get the snap version.
It didn’t fix the problem so I uninstalled and downloaded the snap version again from the Audacity website.

Now I have a new intermittent problem, sometimes I can’t monitor recordings from the PC Audio input, if I check “Audible Input Monitoring” the record button has no effect except that the icons in the Audacity window momentarily clear and reload, and my Pulse program says that nothing is recording. Sometimes this resets and behaves properly, sometimes I have to restart the computer.

How do I fix this?

My OS is Ubuntu 22.04
I use pulse audio
I have Audacity version 3.7.3 but I updated while I had the problem and can’t remember what version I had before. When I updated through the software centre I had the version that starts from the task bar but my latest update is via the Audacity website and I have the snap version. I think it’s snap. It’s the one that only works direct from the downloaded AppImage icon, and you have to check “allow executing file as program” before you can run it.
I tried 3.6.4 and it is the same.