Kodi Community Forum

Full Version: [atv] weird HDMI sound issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
My issue is that I cannot get HD files to play sound correctly, I either get a loud static hiss or the audio device fails to initialize. I'll try to explain what I have tried, but I am still pretty new at this.

So I tried to change the .asoundrc file (which was found in the xbmc heading) to the code found here (http://forum.xbmc.org/showpost.php?p=501974&postcount=5) and I lose menu sounds, but I still get audio from SD video files. However, I can't seem to get HD video files to give me any sound, depending on the settings in the audio output menu I either get static or pop-up that says 'audio device failed to initialize'

The .asoundrc code that seems to work better, as in I get menu sounds is:

pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:0,3"
}
}

With that last night I actually had sound through HD video after a fresh boot. but when I got up this morning I had no sound again.

I'm using an ATV with the crystal HD card, and dharma 10.1. The ATV is connected via HDMI to a samsung 50" plasma, the sound passes through the tv's optical out and goes to my LG surround sound. Is it possible that something could be going on with the HDMI handshake?

update: So I did a little more noob troubleshooting, If I reboot XBMC then everything works exactly like it should (audio output setting are: audio output HDMI, DOlby and DTS are checked, output device is Defaults, and passthrough is HDMI). So everything is working good, but as soon as I watch an SD video, then if I go back to watch an HD one I get no sound and a pop-up saying audio device failed to initialize.

Has this happened to anyone? If you need the debug or anything to help, then I am going to need some basic instructions on how to get that.
make your .asoundrc to look like this
Quote:pcm.!default {
type plug
slave {
pcm "plughw:0,3"
}
}

More info if needed:
Quote:ssh [email]xbmc@<ip.of.apple.tv[/email]>
$ cd /home/xbmc
$ vi .asoundrc
<paste or type in what I posted above>
press the esc key
type a colon (shift+Wink
type wq
reboot


*this is from user named pumkinut - thanks goes to him
other info that may help - if it is not already installed

To get ATV to reboot from xbmc
Quote:sudo apt-get install hal

and edit your /etc/PolicyKit/PolicyKit.conf file. It should look something like this if the users name is xbmc
Quote:<config version="0.1">
<match user="root">
<return result="yes"/>
</match>
<match user="xbmc">
<return result="yes"/>
</match>
<define_admin_auth group="admin"/>
</config>
*thanks goes to user DV3B on this

Something I did - keeps memory clear
Quote:sudo apt-get install atsar

sudo sh
cd /home/xbmc
vi freemem.sh

Quote:a=`free -m | grep Mem | awk '{ print $4 }'`
b=`atsar -u 4 | grep all | awk '{ print $9 }'`
if [ $a -le 90 ];
then
if [ $b -ge 70 ];
then
sync
echo 3 > /proc/sys/vm/drop_caches
fi
fi

chmod 777 freemem.sh

sudo crontab -e
add this line
Quote:# m h dom mon dow command
*/10 * * * * /home/xbmc/freemem.sh

What this does is every 10 minutes it checks to see if CPU is at least 70% idle (like it is not busy) and also checks to see that if there is less than 90 meg of free ram. If both are true - flush memory.

I did this as I noticed a memory leak and my memory being eat up. I think it may be my weather app as this happens in the middle of the night with no one watching tv. I am assuming it is getting updates. I dunno. But this script helps me keep my memory available.
*I know I shouldnt use chmod 777 on this file but - its my house I am the only hacker in here
Hi,

As of July update, an asound.conf is already bundled with the correct HDMI audio settings. You don't need to touch this. hal and policykit are already installed as of June update, and rebooting, shutdown work from the XBMC menu without customisation. Passthrough should never be HDMI, set it to plughw:0,3.
Is that reboot/shutdown fix part of Ubuntu 11 or a package you install?

-also Thanks Sam for all of your work you do for the community
I installed haldaemon and setup PolicyKit for shutdown, reboot and automounting USB. See my SVN.
very good - thank you for the info.
Sam.Nazarko Wrote:Hi,

As of July update, an asound.conf is already bundled with the correct HDMI audio settings. You don't need to touch this. hal and policykit are already installed as of June update, and rebooting, shutdown work from the XBMC menu without customisation. Passthrough should never be HDMI, set it to plughw:0,3.


Sam, So I changed the passthrough to custom and put the plug:0,3 in, but now when I got to play any HD file I get the static noise again. Menu sounds are there and SD video works right.

my asoundrc file looks like this atm:

pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:0,3"
}
}

I'm not sure if that is the default or not as this started as a friends atv. If that is not the correct coding, could you please post the correct one?
atari800 Wrote:make your .asoundrc to look like this


More info if needed:



*this is from user named pumkinut - thanks goes to him


I also tried this, but I get basically the same result as above. I reboot go to watch the HD video it all works good. Then I watch an SD video and go back to the previously working HD file and now I just get a static hiss...:confused2:
Hi guys,

I assume you are running Crystalbuntu with July update. Perhaps this issue has arose through the nightlies, try reverting to Dharma and see what happens.

Exit XBMC, then run this over SSH:

Code:
1. sudo -s
   2. wget http://download.stmlabs.com/bin/builds/xbmc-atv/builds/xbmc-10.1-10062011.tar.gz
   3. tar -xzf xbmc-10.1-10062011.tar.gz
   4. cp -R usr /
   5. rm -rf usr
   6. rm advancedsettings.xml
   7. mv /root/.xbmc/userdata/advancedsettings.old.xml /root/.xbmc/userdata/advancedsettings.xml
Sam.Nazarko Wrote:Hi guys,

I assume you are running Crystalbuntu with July update. Perhaps this issue has arose through the nightlies, try reverting to Dharma and see what happens.

Exit XBMC, then run this over SSH:

Code:
1. sudo -s
   2. wget http://download.stmlabs.com/bin/builds/xbmc-atv/builds/xbmc-10.1-10062011.tar.gz
   3. tar -xzf xbmc-10.1-10062011.tar.gz
   4. cp -R usr /
   5. rm -rf usr
   6. rm advancedsettings.xml
   7. mv /root/.xbmc/userdata/advancedsettings.old.xml /root/.xbmc/userdata/advancedsettings.xml


Out of curiosity do I lose my library when I do this? Again I am an uber noob, thanks for any help.
Thanks again Sam.

I tried that and I still get the same issue as before. I assume getting a different version of XBMC should reset the .asoundrc file, so that is the correct setting now. My audio output options are HDMI sound, 5.1, DTS and Dolby are checked (and both my tv and surround are new within 2 years and are compatible with both), audio device is defaults and passthrough is custom with plughw: 0,3 listed below.

Although a weird thing I noticed, the other night I tried to watch a .mkv version of True Blood the other night, it all worked as it should through the 'previously on true blood' portion, then as soon as the show starts, and what I assume is different audio format, it all goes to static.
Hi,

Unlikely TB had two different soundtrack codecs in one track stream. And by unlikely, I mean no way. Installing old XBMC does not change .asoundrc, and neither did the update. I changed asound.conf, if you have followed the instructions for removing that like I stated previously, it should be working
Sam.Nazarko Wrote:Hi,

Unlikely TB had two different soundtrack codecs in one track stream. And by unlikely, I mean no way. Installing old XBMC does not change .asoundrc, and neither did the update. I changed asound.conf, if you have followed the instructions for removing that like I stated previously, it should be working

I guess i misread, if i am understanding correctly then i do not need the asoundrc file because the asound.conf is already doing what I've been trying to replicate.
Pages: 1 2