millerjs / modelm

Mechanical keyboard sound simulator in Rust
53 stars 2 forks source link

When run with sudo, modelm blocks out all other sound from playing with PulseAudio #10

Open different55 opened 6 years ago

different55 commented 6 years ago

When modelm is run as root with sudo, no other sounds can play on the system. To be more specific, all other audio (and even video) across the entire system refuses to play until modelm is shut down. At that point, if any of the audio sources are still waiting, it all plays at once.

This applies to remote and local files, and I've tried mpv, ffplay, rhythmbox, totem, even YouTube videos within Firefox, basically anything that plays media that I can think of. Even Discord holds its notification tones until modelm is killed, then releases them all in one big deafening burst.

On the terminal, MPV reports this error:

[ao/pulse] The stream is suspended. Bailing out.

I haven't seen any other programs spit out errors when this happens.

Temporarily chmod'ing /dev/input/event0 so my user has permissions, and then running as my normal user fixes this problem.

millerjs commented 6 years ago

Thanks for reporting, I have been able to reproduce the issue and investigate a solution.