(In reply to Jonathan Lennox from comment #6) > Created attachment 9143094 [details] > Moz-cubeb-crash.txt > > Here's the requested output, with the crash. Thanks for the help! (In reply to Jonathan Lennox from comment #7) > I'm not changing the audio output device on purpose, but it's possible that opening or closing the laptop lid changes the default device? My normal default audio output device is my external monitor. From the log, it seems the *DisplayPort* audio output (the external monitor) is added and removed again and again, and *DisplayPort* is the default output device so the default output device is changed when that happens, which makes the underlying audio streams re-initialize to follow the new default output device. I am not clear what causes the crash actually. But I do spot something weird 1. If the underlying audio stream is being reinitialized while the default output device is changing, sometimes the new default would [return `kAudioObjectUnknown`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) instead of a valid `AudioDeviceID` even the system still have valid devices. 2. The above leads to a failure of reinitializing the audio stream and log the error messages [here](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) and [here](https://searchfox.org/mozilla-central/rev/b9a814e53b3b6f5cb665a78f4777868e7a16bfcd/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3316) From the log, I am not able to infer which line causes the crash. But I guess the Firefox crashes when trying to [initialize the new audio stream](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2136) since the last log is [`"Fail to create device info for output"`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2182). I do spot other defects in our code. I will leave other things in the following comments.
Bug 1631814 Comment 8 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Jonathan Lennox from comment #6) > Created attachment 9143094 [details] > Moz-cubeb-crash.txt > > Here's the requested output, with the crash. Thanks for the help! (In reply to Jonathan Lennox from comment #7) > I'm not changing the audio output device on purpose, but it's possible that opening or closing the laptop lid changes the default device? My normal default audio output device is my external monitor. From the log, it seems the *DisplayPort* audio output (the external monitor) is added and removed again and again, and *DisplayPort* is the default output device so the default output device is changed when that happens, which makes the underlying audio streams re-initialize to follow the new default output device. I am not clear what causes the crash actually. But I do spot something weird 1. If the underlying audio stream is being reinitialized while the default output device is changing, sometimes the new default would [return `kAudioObjectUnknown`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) instead of a valid `AudioDeviceID` even the system still have valid devices. 2. The above leads to a failure of reinitializing the audio stream and log the error messages [here](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) and [here](https://searchfox.org/mozilla-central/rev/b9a814e53b3b6f5cb665a78f4777868e7a16bfcd/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3316) From the log, I am not able to infer which line causes the crash. But I guess the Firefox crashes when trying to [initialize the new audio stream](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2136) since the last log is [`"Fail to create device info for output"`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2182). I do spot other defects in our code when reading the logs. I will leave other things in the following comments.
(In reply to Jonathan Lennox from comment #6) > Created attachment 9143094 [details] > Moz-cubeb-crash.txt > > Here's the requested output, with the crash. Thanks for the help! (In reply to Jonathan Lennox from comment #7) > I'm not changing the audio output device on purpose, but it's possible that opening or closing the laptop lid changes the default device? My normal default audio output device is my external monitor. From the log, it seems the *DisplayPort* audio output (the external monitor) is added and removed again and again, and *DisplayPort* is the default output device so the default output device is changed when that happens, which makes the underlying audio streams re-initialize to follow the new default output device. It seems *Firefox* would crash if this process is repeated frequently. I am not clear what causes the crash actually. But I do spot something weird 1. If the underlying audio stream is being reinitialized while the default output device is changing, sometimes the new default would [return `kAudioObjectUnknown`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) instead of a valid `AudioDeviceID` even the system still have valid devices. 2. The above leads to a failure of reinitializing the audio stream and log the error messages [here](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) and [here](https://searchfox.org/mozilla-central/rev/b9a814e53b3b6f5cb665a78f4777868e7a16bfcd/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3316) From the log, I am not able to infer which line causes the crash. But I guess the Firefox crashes when trying to [initialize the new audio stream](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2136) since the last log is [`"Fail to create device info for output"`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2182). I do spot other defects in our code when reading the logs. I will leave other things in the following comments.
(In reply to Jonathan Lennox from comment #6) > Created attachment 9143094 [details] > Moz-cubeb-crash.txt > > Here's the requested output, with the crash. Thanks for the help! (In reply to Jonathan Lennox from comment #7) > I'm not changing the audio output device on purpose, but it's possible that opening or closing the laptop lid changes the default device? My normal default audio output device is my external monitor. From the log, it seems the *DisplayPort* audio output (the external monitor) is added and removed again and again, and *DisplayPort* is the default output device so the default output device is changed when that happens, which makes the underlying audio streams re-initialize to follow the new default output device. It seems *Firefox* would crash if this process is repeated frequently. I am not clear what causes the crash actually. But I do spot something weird 1. If the underlying audio stream is being reinitialized while the default output device is changing, sometimes the new default would [return `kAudioObjectUnknown`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) instead of a valid `AudioDeviceID` even the system still have valid devices. - For example, when the *DisplayPort* is unplugged, we get this error in the log @ 4880 line states > [..thread 0x182d04420]: E/cubeb mod.rs:207: Could not find default audio device for OUTPUT - but actually there are other devices in the system - (The *DisplayPort* is plugged back soon) 2. The above leads to a failure of reinitializing the audio stream and log the error messages [here](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) and [here](https://searchfox.org/mozilla-central/rev/b9a814e53b3b6f5cb665a78f4777868e7a16bfcd/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3316) From the log, I am not able to infer which line causes the crash. But I guess the Firefox crashes when trying to [initialize the new audio stream](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2136) since the last log is [`"Fail to create device info for output"`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2182). I do spot other defects in our code when reading the logs. I will leave other things in the following comments.
(In reply to Jonathan Lennox from comment #6) > Created attachment 9143094 [details] > Moz-cubeb-crash.txt > > Here's the requested output, with the crash. Thanks for the help! (In reply to Jonathan Lennox from comment #7) > I'm not changing the audio output device on purpose, but it's possible that opening or closing the laptop lid changes the default device? My normal default audio output device is my external monitor. From the log, it seems the *DisplayPort* audio output (the external monitor) is added and removed again and again, and *DisplayPort* is the default output device so the default output device is changed when that happens, which makes the underlying audio streams re-initialize to follow the new default output device. It seems *Firefox* would crash if this process is repeated frequently. I am not clear what causes the crash actually. But I do spot something weird 1. If the underlying audio stream is being reinitialized while the default output device is changing, sometimes the new default would [return `kAudioObjectUnknown`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) instead of a valid `AudioDeviceID` even the system still have valid devices. - For example, when the *DisplayPort* is unplugged, we get this error in the log @ 4880 line states > [..thread 0x182d04420]: E/cubeb mod.rs:207: Could not find default audio device for OUTPUT - but actually there are other devices in the system - (The *DisplayPort* is plugged back soon) 2. The above leads to a failure of reinitializing the audio stream and log the error messages [here](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) and [here](https://searchfox.org/mozilla-central/rev/b9a814e53b3b6f5cb665a78f4777868e7a16bfcd/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3316) From the log, I am not able to infer which line causes the crash. But I guess the Firefox crashes when trying to [initialize the new audio stream](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2136) (when the stream reinitialization fails) since the last log is [`"Fail to create device info for output"`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2182). I do spot other defects in our code when reading the logs. I will leave other things in the following comments.
(In reply to Jonathan Lennox from comment #6) > Created attachment 9143094 [details] > Moz-cubeb-crash.txt > > Here's the requested output, with the crash. Thanks for the help! (In reply to Jonathan Lennox from comment #7) > I'm not changing the audio output device on purpose, but it's possible that opening or closing the laptop lid changes the default device? My normal default audio output device is my external monitor. From the log, it seems the *DisplayPort* audio output (the external monitor) is added and removed again and again, and *DisplayPort* is the default output device so the default output device is changed when that happens, which makes the underlying audio streams re-initialize to follow the new default output device. It seems *Firefox* would crash if this process is repeated frequently. I am not clear what causes the crash actually. But I do spot something weird 1. If the underlying audio stream is being reinitialized while the default output device is changing, sometimes the new default would [return `kAudioObjectUnknown`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) instead of a valid `AudioDeviceID` even the system still have valid devices. - For example, when the *DisplayPort* is unplugged, we get this error in the log @ 4880 line states > [..thread 0x182d04420]: E/cubeb mod.rs:207: Could not find default audio device for OUTPUT - but actually there are other devices in the system - (The *DisplayPort* is plugged back soon) 2. The above leads to a failure of reinitializing the audio stream and log the error messages [here](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#207) and [here](https://searchfox.org/mozilla-central/rev/b9a814e53b3b6f5cb665a78f4777868e7a16bfcd/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3316) From the log, I am not able to infer which line causes the crash. But I guess the Firefox crashes when trying to relaunch [a new audio stream](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2136) when the stream reinitialization fails, since the last log is [`"Fail to create device info for output"`](https://searchfox.org/mozilla-central/rev/54f965e51e4f77866bec42737978d40d4c1fdfc5/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#2182). I do spot other defects in our code when reading the logs. I will leave other things in the following comments.