(2012-05-31 22:51)Mild Fuzz Wrote: anyone have a fix for this?
I found that I was losing audio as well after a period of inactivity - basically when the display would enter a power saving mode, when it was woken back up, audio would be gone. I found that by running xrandr and changing the display parameters to 'something else', and then back again, my audio would be restored. I found a python script that someone else wrote (I can't find the site so can't attribute this to the right person), that was checking for sleep events in the output from dmesg, and then triggering the same kind of xrandr switching to keep the screen awake. No audio loss since then.
As a first test I'd try changing the display settings via xrandr and then back to the original settings to see if this 'restores' your audio. If so, then you may want to run the script below when the system starts:
#!/usr/bin/env python
import os
import time
valid = "ELD_Valid=1"
invalid = "ELD_Valid=0"
def executeCommand(the_command):
temp_list = os.popen(the_command).read()
return temp_list
def getDMESG():
return executeCommand("dmesg | grep -i hdmi | tail -n 10")
def needsRefresh():
list = getDMESG();
valid_index = list.rfind(valid)
invalid_index = list.rfind(invalid)
if invalid_index > valid_index:
return True
else:
return False
def doTest():
if needsRefresh() == True:
os.popen("xrandr -display :0 --output DFP2 --off; xrandr -display :0 --output DFP2 --mode 0x9c").read()
while True:
doTest()
time.sleep(5)
Note: The line xrandr -display :0 --output DFP2 --off; xrandr -display :0 --output DFP2 --mode 0x9c should be change to match the parameters that are necessary for your particular environment, as it probably won't match mine