Error opening sound device. A scenario and workaround but not a good solution [SOLVED]

First things, first: My Mac is OS, Big Sur, V11.4 and my Audacity is 3.0.2. I hope I did this right.

Scenario:
Launch Audacity with headphones, with output set to ‘external headphones’, record then playback recording. Result: works correctly.
I unplug the headphones and close the app.

I come back later and open the app BUT have not plugged in the headphones yet. I open the recording, press the ‘play’ button - intending to just listen through the speakers. I am unaware that the output retained the setting of ‘external headphones’ from the last session. I get the error message: “Error opening sound device. Try changing the audio host, playback device, and the project sample rate.”

Fast forward beyond the usual troubleshooting of trying to adjusted the ‘Audio Midi Setup’ to the following sequence of events:

Launch Audacity from an app restart. At this point, no external devices.

Record, playback on speakers, save file, close app. Result: works correctly

Repoen app, add headphones but check output to find they are not recognized

Follow instructions to ‘Rescan audio device’ then verify the external device is recognized. Change output to ‘external headphones’
Record, playback on headphones. Result: works correctly.

Save file, close app and remove headphones

Reopen app but haven’t plugged in headphones yet, open recording then press ‘play’. Result: error message
Check output to find it retained the output of ‘external headphones’ from last session.

Change output to internal speakers, play. Result: works correctly.
Plug in headphones, switch back to ‘external device’. Result: error message.

Close app, reopen app this time with headphones, and attempt to listen to audio again using headphones, with output set on ‘external device’. Result: error message.

The only way I found to clear this message is to ‘quit’ then ‘restart’ Audacity. Not a lot of steps but something that users have to be aware of. Is there any other way to clear this message without quitting and restarting?

Thanks.

It “should” be sufficient to just “Rescan for audio devices” and then select the appropriate devices in the Device Toolbar.

If you rescan too quickly after changing something in the sound system, the sound system might not have finished it’s reconfiguration, in which case you may need to rescan again (or just wait for a bit before rescanning the first time).

Ah, very good. I think I understand and will give it a try. Appreciate your help and quick turnaround. Thanks.

It “should” be sufficient to just “Rescan for audio devices” and then select the appropriate devices in the > Device Toolbar> .

If you rescan too quickly after changing something in the sound system, the sound system might not have finished it’s reconfiguration, in which case you may need to rescan again (or just wait for a bit before rescanning the first time).

Okay. So I ran a few scenarios where I deliberately orphaned the ‘External Headphones’ setting and in each scenario, I was able to successfully use the ‘Rescan’ to restore the headphones. Huzzah!

Thank you for your help.

Super :smiley:
Glad to hear it’s working for you.

I’ll close this topic as “solved”.