Draft: bluez5: handle Volume attribute going away
Sometimes BlueZ returns errors from setting the Volume property.
If setting the Volume property fails, assume HW volume is no longer functional, and switch back to software volume. The HW volume will get reactivated if the Volume attribute reappears.
Handle PropertiesChanged invalidation of Volume and Delay properties, by disabling the features when that occurs.
bluez5: retain volume level when changing between sw/hw volume
Add logic for retaining volume level when switching between HW and SW volume control.
This avoids large volume level changes, when hardware volume control becomes disabled or enabled.
This can be tested by a BlueZ patch that makes volume presence toggleable
This should reduce the number of cases where volume becomes un-adjustable, if BlueZ takes the Volume attribute down.
XXX: I'll still want to do something about the error messages that appear on codec switching, where it appears that the Volume attribute is usually not available early enough.
XXX: This is also something that should be partly fixed on the BlueZ side...