[AE/CA] - add and handle devicechange notification #2144

Merged
merged 2 commits into from Jan 31, 2013

4 participants

@Memphiz
Team Kodi member

This basically registers the CA AudioEngine to OS notifications for device changes. Whenever the List of AudioDevices changes we reopen our CoreAudio Output Device (with last used format parameters). Our OpenCoreAudio method has an automated fallback to the OSX default output device. In case our current Output device vanishes we will be routed to the next OSX default output device.

This fixes the following behaviour (tested/reproduced by users and me):
1. OSX -> HDMI -> AVR -> HDMI -> TV
a. in this Constellation when turning off the TV our audio device will vanish. Without this fix - Audio output vanishes until a makestream was called with different format then before (mostly users just restarted XBMC for getting audio back)

  1. When using default output and attachng a bluetooth headset or earphnes there was no automatic switch to it (osx uses these kind of audiooutputs as default automatically). A stream had to bestarted for switching to the headset/earphones

  2. When using refreshrate adaption and pass through - on my hack audio just vanished and video stuttered (i had to select different audiostream for getting audio back).

With this PR all of those 3 issues are solved. Transition/reopen between/of devices even works when streams are played.

I consider this Frodo 12.1 food

@davilla and @huceke to comment (no - its not a hammer imo!)

Memphiz added some commits Jan 29, 2013
@Memphiz Memphiz [AE/CA] - on device change reinit coreaudio by calling opencoreaudio …
…with the last engine parameters (this will fallback to default device when our current output device vanishes and on the other hand will go back to that device if it re-appears).
6c00b75
@Memphiz Memphiz [AE/CA] - revert 7e64331 - not needed anymore d0cf53c
@davilla

ok to me.

@Memphiz
Team Kodi member
@amet

do it :)

@Memphiz Memphiz merged commit 7484699 into xbmc:master Jan 31, 2013
@gewli

Did not fix http://trac.xbmc.org/ticket/13407 for me, new debug log is attached there. The ticket should be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment