talonvoice / beta

Issue tracker for the private Talon Beta
10 stars 0 forks source link

Linux: appear to leak audio streams when switching microphone input #42

Closed zarvox closed 4 years ago

zarvox commented 4 years ago

When running talon-linux-89-0.0.8.29-1196-g2d07a86 on Fedora 31, I've noticed a bunch of surprising streams hanging around in the "Recording" tab of pavucontrol when I use the Talon tray icon to switch microphone inputs.

At startup:

>>> import gc
>>> [a for a in gc.get_objects() if isinstance(a, talon.vad.Vad) or isinstance(a, talon.cubeb.Context) or isinstance(a, talon.cubeb.Stream) ]
[<talon.cubeb.Context object at 0x7f99a07cdfd0>, <talon.vad.Vad object at 0x7f996ab61590>, <talon.cubeb.Stream object at 0x7f996aa8e7d0>, <talon.cubeb.Context object at 0x7f99900d45d0>, <talon.cubeb.Stream object at 0x7f996a707a50>, <talon.cubeb.Context object at 0x7f996a707910>]

pavucontrol shows two capture streams, one named voice activity and one named noise recognition. This seems fine.

After switching from "System Default" to "None" through the tray icon -> Microphone menu:

>>> [a for a in gc.get_objects() if isinstance(a, talon.vad.Vad) or isinstance(a, talon.cubeb.Context) or isinstance(a, talon.cubeb.Stream) ]
[<talon.cubeb.Context object at 0x7f99a07cdfd0>, <talon.vad.Vad object at 0x7f996ab61590>, <talon.cubeb.Stream object at 0x7f99a07d5b90>, <talon.cubeb.Context object at 0x7f9968c40f10>, <talon.cubeb.Stream object at 0x7f996aa8e7d0>, <talon.cubeb.Stream object at 0x7f996a707a50>, <talon.cubeb.Context object at 0x7f996a707910>, <talon.cubeb.Context object at 0x7f99900d45d0>]

pavucontrol shows three capture streams -- the original two, plus one additional one named noise recognition. I'd expect there to be zero streams at this point.

After switching from "None" back to "System Default" through the tray icon -> Microphone menu:

>>> [a for a in gc.get_objects() if isinstance(a, talon.vad.Vad) or isinstance(a, talon.cubeb.Context) or isinstance(a, talon.cubeb.Stream) ]
[<talon.cubeb.Context object at 0x7f99a07cdfd0>, <talon.vad.Vad object at 0x7f996ab61590>, <talon.cubeb.Stream object at 0x7f996aa8e7d0>, <talon.cubeb.Stream object at 0x7f996a707a50>, <talon.cubeb.Stream object at 0x7f9969dc3f10>, <talon.cubeb.Stream object at 0x7f99694f8510>, <talon.cubeb.Context object at 0x7f9969e1ab50>, <talon.cubeb.Context object at 0x7f99900fbd90>, <talon.cubeb.Stream object at 0x7f9969563250>, <talon.cubeb.Context object at 0x7f9969563750>, <talon.cubeb.Stream object at 0x7f99a07d5b90>, <talon.cubeb.Context object at 0x7f99900d45d0>, <talon.cubeb.Context object at 0x7f996a707910>, <talon.cubeb.Context object at 0x7f9968c40f10>]

pavucontrol now shows six capture streams -- the three from before, plus three more, labelled voice activity, noise recognition, and voice activity, in that order. I'd expect there to be just the last two (the most recently created).

chobeat commented 4 years ago

Can confirm I experience the same behavior on multiple setups.

lunixbochs commented 4 years ago

fixed in 1274