cea-sec / sanzu

Graphical remote desktop solution
GNU General Public License v3.0
183 stars 29 forks source link

Audio lost on windows after session lock / user switch #128

Open serpilliere opened 1 year ago

serpilliere commented 1 year ago

The bug is triggered with the following steps:

The sanzu_client then loses its connection to the audio output. Windows seems to 'disconnect' the audio sound card (to give access to the new logged user)

If the second user disconnect and the first user re-login, sanzu still runs, but without sound.

serpilliere commented 1 year ago

The error is catch here: https://github.com/cea-sec/sanzu/blob/aa769ded52c41d1650a0e203599f7489b72ee568/sanzu/src/sound.rs#L261

We may mark the decoder as in error mode, which may later be catched in : https://github.com/cea-sec/sanzu/blob/aa769ded52c41d1650a0e203599f7489b72ee568/sanzu/src/sound.rs#L304

which in turn may be catched in the main code. This will allow the main process to be aware that the sound is in error state, and try to re init the sound output.