Comment 8 for bug 1853584

Revision history for this message
hugh chao (hugh712) wrote : Re: [18.04]Not able to adjust Audio input UI volume after connecting headset

@Sebastien,

No, it's not from upstream, due to the code is quite different from upstream.

If there is only one input device with only one input port, and this input port is active_port, e.g. there is no internal mic, just a mic jack on the machine, this issue will happen.

For this kind of machines, if users plug mic in the jack, the function active_input_update() is called ahead of the function add_input_ui_entry(), then we will see "No devices in the tree, so cannot set the active output" from syslog, this issue will be reproduced.

On other machines, the add_input_ui_entry() is called ahead of active_input_update(), then there is no problem.

So for this patch, just checking if there is only one input item in the treeview, call active_input_update(). And call gtk_widget_set_sensitive() to gray out the input volume bar if there isn't any input item in the treeview.