am_base->LogAudioServiceStartup(Why can't we log it in AM constructor?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
am_base->LogAudioServiceStartup(Why can't we log it in AM constructor?
We can and I have changed the design now.
It was easier to do it after AMB ctor was done since accessing the audio log factory directly in the ctor can be risky (breaks test and so on).
I tried to make a clean solution that should be safe.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +0 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// is deleted on the audio thread.Nothing says it's constructed on the same thread it's deleted on? Also AudioManagerBase destructor does not say anything about threading.
Can we log from AudioManagerBase::GetDeviceLogHelper() or from LogHelper constructor?
Nothing says it's constructed on the same thread it's deleted on? Also AudioManagerBase destructor does not say anything about threading.
Can we log from AudioManagerBase::GetDeviceLogHelper() or from LogHelper constructor?
Good catch. I agree that PostTask is unsafe here since the destructor makes no thread guarantees. Sorry for that.
Now moved the log to the DeviceLogHelper constructor as you suggested.
FYI: this means we will now log lazily on the first device enumeration rather than strictly at AudioManager construction (which we did in the version where I broke out the log to OwningAudioManagerAccessor), but since enumeration happens immediately after a process restart anyway, we are still good.
Logs are also emitted now if I crash the audio process and it restarts.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
am_base->LogAudioServiceStartup(Henrik AndreassonWhy can't we log it in AM constructor?
We can and I have changed the design now.
It was easier to do it after AMB ctor was done since accessing the audio log factory directly in the ctor can be risky (breaks test and so on).
I tried to make a clean solution that should be safe.
Now removed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Side question: why do we do
AudioLogFactory::AudioComponent::kAudioInputController for enumeration log?
// Emitted on the first device enumeration and at audio process restarts.Ok, so this is a bad place to have this log? Because output streams can be created before that?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |