Kodi Community Forum

Full Version: Audio devices list not updating in real time (17.6 from Ubuntu 18.04)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone

For past 2 years I was using OpenELEC with Kodi 16 on RPi.
During the day I was using AVR/HDMI sound, and at night, I would connect USB headphones.
The switching between them was seamless. On rare occasion I would need to select correct Audio output device in settings.

Now I'm trying to setup real HTPC using Ubuntu 18.04 with Kodi 17.6 from package in standalone mode.

The thing is - an audio output devices list seems to be generated once during Kodi startup, and not updated on the fly, when something changes (USB soundcard plug/unplug).
Tried using both Pluse and ALSA - same behavior.

Is this by design, and OpenELEC build has some special patches to allow automatic list update during run-time?
Or maybe this a problem with Pulse/Alsa/Ubuntu?

pulse should handle this, but might need some config that isn't there by default without a desktop
Well, I just checked - same behavior with kodi lanuched from normal desktop - need to relanuch Kodi to see new audio devices on the list.

Before I start ripping it all apart and dive into pulse configuration - wanted to confirm that this is not designed behavior (for example related to new AE in V17 vs V16)
I listen to changes of the sink: https://github.com/xbmc/xbmc/blob/master...E.cpp#L236 Please post a Debug Log that should "recognize" such change, please.
And I don't get a single event without having changed this code for a very long time :-) Let's find out if it's an ubuntu regression.
Fixed it: 14133 (PR) will push when it's build. Funny: I broke it more than 1.5 4 years ago :-) (Will be in tomorrow's nightly -> Leia v18)

1) After installing nightly: pulse hot plug is working - thanks. Any chance of backport for stable 17.6? I wonder how nobody noticed it for 4 years... Also it must have been fixed in OpenELEC builds, as I said in first post.
2) Problem with hotplug in ALSA mode persists:

Kodi launched with (from Wiki):
pasuspender -- env KODI_AE_SINK=ALSA kodi --standalone

Debug log:

During session i plugged and unplugged USB audio device (Motorola D200) few times. No changes on audio devices list.

Bonus fact:
If I kill pulseaudio daemon completely (not easy without uninstalling), and start Kodi without pasuspender, then ALSA hot plug works as intended.
Perfect - everything works as intended. For hackarounds fooling your pulseaudio daemon with pasuspender just for kodi to run ALSA I cannot support you. If you don't need pulseaudio, uninstall it.
Well if this is not officially supported - fair enough.

What about backport?
Can this fix be patched directly to 17.6 source and just compiled?
Yes, just cherry-pick it.