Kodi Community Forum

Full Version: Suspend changes audio device - > no multichannel playback
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Fresh bootup.
I start multichannel FLAC files.
Everything works fine.
Receiver reports 6ch input and spits 6ch out to speakers.
I suspend PC.
After wake up I start multichannel FLAC files
Only stereo playback.
Receiver reports 2ch input and spits 2ch out to speakers.

If I try same scenario without XBMC starting only using Ubuntu Rythmbox to play files it works OK (multichannel playback after suspend/wake). That leads me to believe XBMC is a suspect.

I noticed that after wake up XBMC shows different audio device and I cannot switch back to original that works OK (it is not on the list)
Fresh boot fixes the problem

PC running Ubuntu 12.04 with XBMC 12.1 from official stable PPA
PC->HDMI->Denon Amp


Screenshot of audio settings after freshboot

Screenshot of audio settings after suspend/wake
I think the nvidia driver looses the connection to the AVR.

DISPLAY=:0 xrandr --output HDMI-0 --off
followed by
DISPLAY=:0 xrandr --output HDMI-0 --auto

bring the device back? Change HDMI-0 to match your actual output.
Yup, that fixes the problem after suspend/wake.
Big Grin THX

Now, do I add these commands to some kind wake up file or there is other way?
It is basically a resume script, that you can put into /etc/pm/sleep.d/
name it 99-reviveaudio make it executable:
chmod +x /etc/pm/sleep.d/99-reviveaudio

and use something like this:
#change foobar to your username
case "$1" in
    # that defines the default primary output
    OUTPUT=`xrandr -display :0 -q | sed '/ connected/!d;s/ .*//;q'`
    #disable this output wait a second and enable it again
    su -c "xrandr -display :0 --output $OUTPUT --off" $mUSER
    sleep 1
    su -c "xrandr -display :0 --output $OUTPUT --auto" $mUSER

Change the foobar string
Thanks for this
Hardcoding the EDID is another chance you have with nvidia. That way you could also start without AVR / TV set on at all. I wrote some howto a bit back over at OpenELEC forum.