PDA

View Full Version : Sound no longer working


BLKMGK
2008-08-15, 00:16
Okay, have had this before and couldn't fix it - I reloaded instead. I have now had it happen again, this time on Hardy, and I don't have a recent backup. I recall others having had this happen but searches aren't bringing me any useful results. The last time this occurred I still had analog output if I used headphones but digital was cooked, I've not got headphones handy but ASSume this is much the same.

Scenario was this - went to watch a movie, menu came up, selected Play Movie, and XBMC crashed to desktop. Mouse was unresponsive, I rebooted via SSH. When XBMC was run again no audio. Play something in mPlayer and I'm not hearing audio there either. Menu sounds etc. all dead in XBMC. Digital output is *not* muted and volume is up. I *know* others have seen this and solved it but danged if I can find those posts, I'd appreciate a hand. Thanks!

tslayer
2008-08-15, 00:19
I've had this where only digital audio would output and NOT analog (still out of spdif).

What I usually do to fix in my scenario is:

0) Stop XBMC
1) Create a file in your home directory called .asoundrc that contains the following single line: pcm.!default spdif
2) Run: speaker-test -c 2
3) If you hear sound, you can stop.
4) Remove .asoundrc
5) Restart XBMC


Try that...

BLKMGK
2008-08-15, 00:52
Okay, let me tell you what I did and see if I've understood correctly...

1) In my home/blkmgk/ folder I created a folder named .asoundrc - like you I do not normally have this.
2) In .asoundrc I created an empty file and named it pcm.!default spdif
3) Ran the speaker test - no sound :(

I am using coaxial digital output if that matters. It almost seems like there's a corrupted file or something somewhere. The last time this happened I updated ALSA and tried to remove\reinstall it to no avail. Would love to track this issue down!

tslayer
2008-08-15, 00:54
Nono..

Create a FILE called .asoundrc in your home directory with the following contents in the .asoundrc file:

pcm.!default spdif

BLKMGK
2008-08-15, 02:28
Fixed!!! Thank you VERY much!

tslayer
2008-08-15, 02:30
You're welcome... Don't forget to remove the .asoundrc AFTER running speaker-test. It causes issues otherwise :)

arkay
2008-08-15, 05:30
When I tried the .asound method it cause me nothing but issues so I hunted around till I found this:

/usr/bin/iecset audio on

Fixes it every time for me. I experienced the problem daily as I have a script run by irexec to kill xbmc and run myth and vice versa. Every time you kill something with Digital Audio you lose PCM on my machine. The above line in the script before restarting xbmc/myth fixed all my issues.

Cheers,

Arkay

tslayer
2008-08-15, 05:36
I tried that iecset as well but it did not fix it for me.

Another thing that works *most* of the time but not as reliably as the asoundrc method is:

cat /dev/urandom | ac3dec -R

I have both run when starting XBMC just to be sure :)

arkay
2008-08-15, 09:26
Gotta love HTPC consistency :laugh:

Cheers,

Arkay.

tslayer
2008-08-15, 17:29
More like a dumb ALSA bug that has existed for a few years apparently.

BLKMGK
2008-08-15, 21:09
Weird thing is it takes a really severe crash of XBMC to trigger this for me and even then it's not consistent. All in all my system has been REAL stable and I've been pretty happy thus I did NOT want to have to reload. Think I might get around to backing it up though ;)

tslayer
2008-08-15, 21:11
I think it usually happens when you are watching some movie that has AC3 or some digital audio and then crashes while watching that.

insanerc
2008-09-21, 08:52
I still can't seem to figure out how to get my sound to work properly. Movies and digital (ac3) music work but mp3's don't. I tried Tslayers fix (thanks Treefour for explaining it) and no sound, but if I reboot with the .asoundrc file navigation sounds worked. I've been to the Ubuntu forums and found loads of info still no sound. Does anyone know how I can fix this?

TheBurner
2008-09-21, 18:52
weird i had sound working the past 2 months, had just updated via svn again which i do weekly and installed an esata card rebooted box and no sound. I have tried everything to get it working. I have no menu sounds and fast video / no audio playing even apple trailers. I see in log something about discontinuity. Please help. I notice my amp still says Aux 2.0 which it did when sound worked:)

tslayer
2008-09-21, 18:54
TheBurner: Maybe you knocked your sound card out when putting in your esata card.

Check dmesg or even try speaker-test to see if sound even works at all.

TS

TheBurner
2008-09-21, 19:29
Tslayer its actually onboard, and i checked connections thing is i get sound on boot up of ubuntu and tested all sounds seems to work fine, im not sure what could have changed just did svn update. Here is a bit of my log file.
08:27:34 T:2835483536 M:2784493568 DEBUG: CDVDPlayerAudio:: Discontinuty - was:441394.970322, should be:464399.092971, error:23004.122649
08:27:34 T:2835483536 M:2784493568 ERROR: CALSADirectSound::AddPackets - sanity failed. no valid play handle!

Not sure what is going on

tslayer
2008-09-21, 19:31
You know where to find me :)

Ping me and we'll see about debugging this.

But, if you can revert back to the previous revision to see if works, then that will tell us whether something changed in XBMC.

TS

TheBurner
2008-09-21, 19:40
Thanks TS im actually out the door so maybe tomorrow if you arent too busy laying around I mean working. Thanks again

odinb
2008-09-22, 04:33
When this happens, move /etc/init.d/alsa-utils to a backup folder somewhere else, and reboot.
Once you boot, copy it back to alsa-utils, run alsamixer to set up your audio again, and you should be good to go.

This happens to me frequently...

rodercot
2008-09-22, 15:52
Hey Guys,

Not sure if these are all the same, but for me. I tried the .asoundrc file with no luck. my chipset is a Cmedia and on a X-plosion 7.1 card.

I just hit ctl-alt-f2 and ran alsa mixer and although the PCM output was not muted the Volume was set to zero. I turned up the volume on that channel and voila I have all my analog audio back as well as my DD and DTS pass-through.

This is with the Live Version on a Sancruiser 2Gb USB stick.

Dave

davidw
2009-01-12, 23:24
Yesterday I played a DVD via VLC after that my SP/DIF didn't work at all.
Also a reboot didn't help!

It's a Alsa Bug - I used the following solution (German link: http://www.ubuntu-forum.de/artikel/39221/seit-heute-keinerlei-ton-mehr-%C3%BCber-alsa-spdif-funktioniert-nur-noch-halb.html):
# rename /etc/init.d/alsa-utils
sudo mv /etc/init.d/alsa-utils /etc/init.d/alsa-utils.x
# reboot your system
reboot
# rename /etc/init.d/alsa-utils.x back to /etc/init.d/alsa-utils
sudo mv /etc/init.d/alsa-utils.x /etc/init.d/alsa-utils
#start the alsamixer and activate iec958 output
alsamixer

regards,
David

Warpdrv
2009-02-21, 19:12
Hey guys, been using xbmc for a long long time, but this is the first time I have run into this....

I tried updating to 1-16-09 pimped and lost audio.

Volume level is up, check
switch from analog to digital, check
Deleted - oface stuff...

can't get it to work, I run spdif...

I found this through searching, don't know how to implement the fix, maybe you could help me....

# rename /etc/init.d/alsa-utils
sudo mv /etc/init.d/alsa-utils /etc/init.d/alsa-utils.x
# reboot your system
reboot
# rename /etc/init.d/alsa-utils.x back to /etc/init.d/alsa-utils
sudo mv /etc/init.d/alsa-utils.x /etc/init.d/alsa-utils
#start the alsamixer and activate iec958 output
alsamixer

TIA

Warp

nitroman
2009-02-21, 23:48
hi, at first thanks alot for this 'ultrageile' software!!!!

:oo:
but i'm having problems with sound, too
I've installed with howto - step by step xbmc on ubuntu 8.10..

when i try to play a divx movie, i have as 'user' no sound! menu sounds are ok on hdmi audio!!

there are no problems when i start xbmc under root, sound works!


sudo usermod -a -G audio nitroman




nitroman@vdr-desktop:~$ groups
nitroman adm dialout cdrom audio plugdev lpadmin admin sambashare


any suggestions?

uomiarz
2009-02-22, 03:48
Hey guys, been using xbmc for a long long time, but this is the first time I have run into this....

I tried updating to 1-16-09 pimped and lost audio.

Volume level is up, check
switch from analog to digital, check
Deleted - oface stuff...

can't get it to work, I run spdif...

I found this through searching, don't know how to implement the fix, maybe you could help me....

TIA

Warp

this fix work for me every time :)
first do this

sudo mv /etc/init.d/alsa-utils /etc/init.d/alsa-utils.x

then reboot you system
after reboot start alsamixer

alsamixer

if alsamixer gives just one slide for pulseaudio , quit it and start alsamixer like that

alsamixer -Dhw

and look for iec958 and activate it (press M once it is marked)

your sound should work now

move back init script
sudo mv /etc/init.d/alsa-utils.x /etc/init.d/alsa-utils

you are done

Warpdrv
2009-02-22, 06:32
Im sorry guys.... I posted in the wrong area...

It was for my Xbox...

I fixed it...

Thanks

pilluli
2009-03-04, 22:35
Oh God, after 5 days nearly throwing my computer through the window and two re-installs later I found this thread. My sound issues are all fixed. Stupid alsa bug and bumb me for not seeing an sticky thread!!! ;-)

Just wanted to say thanks to all! you just save me of yet another reinstall :-) Thanks!!!!!!!!!!!!!!!!!!!!!!!

Just to add something useful to the thread this has happened to me in both my 32 and 64 ubuntu installs. So I guess both 32 and 64 alsa packages are hit by this. Btw, is there an alsa bug ticket for this problem I can follow?

regards,

gquiring
2009-03-08, 23:03
Is there a file we can backup/restore when this issue occurs? I just had this happen to me today. The steps worked but I would like something more automated when it breaks.

xnappo
2009-03-09, 05:47
Argh! This issue was so annoying! Glad the sticky post was here so I only wasted an hour - but man that is a weird bug. The sequence above fixed my problem - I am running SPDIF only and MP3s and the menu sounds were not working.

xnappo

Haggy
2009-03-22, 12:50
xnappo: I also run spdif only, but i have xbmc audio out set to plughw:0,1 (which is my iec959 device) and passthrough set to iec958. That way incompatible samples (non 44.1/48Khz) get converted and sound plays also fine for youtube for example. ac3 goes directly through the iec958 device so it can be decoded by the avr.

i had that weird bug only once - and 'iecset audio on' fixed it for me.

zeltak
2009-03-24, 18:08
Hi Guys

Did all the above suggestions but none worked. I have no sound in any part of the OS (including xbmc of course)...alsamixer shows the iec958 as unmuted and full volume. i think the alsa ver is 1.0.17..should i try an upgrade?
any ideas where to go next..?

thx

Zeltak

tslayer
2009-03-24, 18:11
If it doesn't work anywhere, then please goto ubuntu forums to see if they can help you.

Thanks!

xnappo
2009-03-24, 18:47
xnappo: I also run spdif only, but i have xbmc audio out set to plughw:0,1 (which is my iec959 device) and passthrough set to iec958. That way incompatible samples (non 44.1/48Khz) get converted and sound plays also fine for youtube for example. ac3 goes directly through the iec958 device so it can be decoded by the avr.

i had that weird bug only once - and 'iecset audio on' fixed it for me.

Thanks Haggy, if it happens again I will try the 'iecset audio on'. Sorry to go off topic - but does 'output to all speakers' work for you with MP3s?

xnappo

tslayer
2009-03-24, 18:56
Output stereo to all speakers is only for xbox iirc.

You should be able to accomplish what you want with a customer .asoundrc file.

xnappo
2009-03-24, 19:29
Output stereo to all speakers is only for xbox iirc.

You should be able to accomplish what you want with a customer .asoundrc file.

Thanks - you actually already told me that here :blush:

http://xbmc.org/forum/showthread.php?t=46604&highlight=output

Unfortunately I tried the .asound suggestions in the Ubuntu post you linked and it messed up other stuff so I was wondering if Haggy had it working. If anyone does have this working, please move discussion to the thread above.

xnappo

fasteddy
2009-03-24, 21:11
[Edit: Sorry, missed the part where you asked for the discussion to move. Can a mod delete this?]

Haggy
2009-03-24, 21:39
Unfortunately I tried the .asound suggestions in the Ubuntu post you linked and it messed up other stuff so I was wondering if Haggy had it working.

Honestly, i never tried that because i don't like it. IMHO music has to be played as meant by the artist: In stereo :) But you may try the 'surround51' or 'surround40' plug device alsa created for you.

zeltak
2009-03-25, 18:09
Hi again

well it turns out that i did have sound but just digital and the only solution that worked for me is the .asoundrc by tslayer. The thing is if i remove the rc file after a reboot the sound is lost again..:( if i leave it it seems to work after a reboot..i understood it can cause problems if its left in the home dir...how big of an issue is this?

thx again

Zeltak

Ced2911
2009-03-26, 14:48
Hi ^^
I'm having a probleme with sound too
I got sound only with root user.
Seem to be a probleme with alsa ....
I've tried to chmod 666 /dev/snd/*, added user to audio groupe and .asoundrc but no sound at all.

I'am using a p5kpl-am (intel g31) with latest svn xbmc

debug line from my user:
ERROR: Initialize - pcm_open_lconf, alsa error: -2 - No such file or directory

thks for this great apps :)

Haggy
2009-03-26, 15:17
Ced2911: As you generally have no sound (or only with the root user), you might be better off asking for help in the ubuntu forums or whatever distro you're using. this is not an xbmc issue as with the other guys.

Ced2911
2009-03-26, 18:36
it's just happen with xbmc not with mplayer or vlc :s but i will try :)
thanks

Haggy
2009-03-26, 20:57
Sorry i misunderstood that. If it's only in xbmc, please enable debug logging and paste your entire debug log to http://pastebin.com. Then show us the url here.

toiva
2009-04-05, 11:33
I've had this where only digital audio would output and NOT analog (still out of spdif).

What I usually do to fix in my scenario is:

0) Stop XBMC
1) Create a file in your home directory called .asoundrc that contains the following single line: pcm.!default spdif
2) Run: speaker-test -c 2
3) If you hear sound, you can stop.
4) Remove .asoundrc
5) Restart XBMC


Try that...

Thanks a lot for this, audio playback was broken 1 day after installing Ubuntu, only DD/DTS worked :p

xanadu1979
2009-04-07, 05:56
# rename /etc/init.d/alsa-utils
sudo mv /etc/init.d/alsa-utils /etc/init.d/alsa-utils.x
# reboot your system
reboot
# rename /etc/init.d/alsa-utils.x back to /etc/init.d/alsa-utils
sudo mv /etc/init.d/alsa-utils.x /etc/init.d/alsa-utils
#start the alsamixer and activate iec958 output
alsamixer

Thank you so much!! I was just about to go back to Windows out of frustration until I found this solution.

Like a previous poster, the .asoundrc solution only worked for me until I rebooted. This solution seems to be working great even after a reboot.

Now I can keep my Ubuntu install!

fettan
2009-04-20, 18:36
I've had similar problems mentioned here, however none of the suggested fixes have solved it for me :(.

System specs: Gigabyte GA-E7AUM-DSH, 2.8GHz Intel c2d, Xbox Live 8.10, Kingston 4 gig USB drive.

All sound is output through the spdif to my amp, graphics goes to my plasma using hdmi.

At initial boot I had no sound unless I played directly from DD/DTS sources such as .mkv files, no menu sound, no mp3 sound etc. After doing the alsa-util substitution, rebooting and running alsamixer and activating iec958. After this I got sound in the menu and mp3, but the sound is distorted. In the menu it is lagging, sometimes not playing at all, sometimes all "at once". In mp3 or similar coded files the sound is stuttering, and has like a wave of distorsions coming and going ~every 4 seconds or so.

Even if I try the speaker-test setup I here sound, but the wave of distorsions are also there. The same sounds if I use the analogue output and listens with my headphones. I have set the default audio output to iec958.

I am running out of ideas to try, anyone knows what to do?

tslayer
2009-04-20, 18:55
If you have distortion using speaker-test, head on over to linux/ubuntu forums and post your issues as it doesn't sound XBMC related.

Haggy
2009-04-20, 20:21
it depends if one interpretes white noise as distortion :)

havel
2009-05-02, 17:04
I have just successfully updated my Ubuntu from Hardy to Jaunty, via Intreprid. My only problem is sound not working in XBMC...it works in all other apps like vlc or Rhytmbox. I had sound for a few hours in XBMC but it stopped working. I was able to make it work again doing this:

# rename /etc/init.d/alsa-utils
sudo mv /etc/init.d/alsa-utils /etc/init.d/alsa-utils.x
# reboot your system
reboot
# rename /etc/init.d/alsa-utils.x back to /etc/init.d/alsa-utils
sudo mv /etc/init.d/alsa-utils.x /etc/init.d/alsa-utils
#start the alsamixer and activate iec958 output
alsamixer

But after reboot, I lost my sound again. I then tried again the mentionned solution a few times without success. I am running XBMC 9.04-Beta1 r19616.

I'm now clueless. Anybody having sound problems with XBMC in Jaunty?

havel
2009-05-04, 16:24
I'm still having sound problems. I tried the 2 methods proposed here. Sometimes sound comes back. But as soon as I reboot, it's gone again.

I'm running XBMC 9.04-Beta1 r19616 (april 22 2009) on Ubuntu Jaunty 32b

Sound works on any other app.

http://www.pastebin.ca/1412086

Help would be very much appreciated.

havel
2009-05-04, 17:43
I think I might have found a solution on the Ubuntu forum. My guess is that the upgrade process from Hardy to Intrepid...to Jaunty probably left unnecessary files on my system. So I found a way make a fresh sound install instead of making a complete reinstall of Ubuntu.

(1) Remove these packages

sudo apt-get --purge remove linux-sound-base alsa-base alsa-utils

(2) Reinstall those same packages

sudo apt-get install linux-sound-base alsa-base alsa-utils


VERY IMPORTANT NOTE: Ubuntu (GNOME) users have reported that packages 'gdm' and 'ubuntu-desktop' are removed after removing the linux-sound-base packages. If this happens, then do the following

sudo apt-get install gdm ubuntu-desktop

(3) Reboot

I took this on this thread:

http://ubuntuforums.org/showthread.php?t=205449

Thanks to Lordraiden

boba23
2009-05-04, 17:46
Well a few days ago I had sound issues too. I think though it's definately a Ubuntu issue. I upgraded to Jaunty and my sound was fine. After a few days, suddenly my sound was gone. Only things I played with were X/Nvidia gfx related, though I am not sure if something touched my sound settings. Anyway sound was GONE, not only in XBMC, no sound in Ubuntu at all. Though everything driver/alsa related looked ok.
I tried several solutions from Ubuntu forums, and don't ask me why, suddenly sound was back. I can't reproduce what fixed it. Reinstalling alsa etc. stuff might have done it.

boba

davidw
2009-05-11, 15:48
For all with Ubuntu Intrepid I wrote a script to automatic restore the sound on the digital output without restarting the whole system just with restart xbmc!

Make sure that your xbmc-user is allowed to perform this commands without password inquiry (sudo visudo).


#!/bin/bash
##
# alsabug.sh
##

# Stop XBMC (type in here your command to stop your XBMC
/sbin/initctl stop tty2

# unload Alsa modules
/sbin/modprobe -r snd_seq_oss snd_seq_midi snd_seq_midi_event snd_seq_dummy snd_seq snd_rawmidi snd_pcm_oss snd_mixer_oss snd_hda_intel snd_pcm

# load Alsa modules
/sbin/modprobe -a snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_oss snd_rawmidi snd_seq snd_timer snd_seq_device snd

# activate the digital sound output
amixer -- sset IEC958 on

# Start XBMC (type in here your command to start XBMC)
/sbin/initctl start tty2



!! I tested it only with Ubuntu Intrepid !!

My problem is now: how can I include this into XBMC so that I can start this script via remote?!!

Cheers,
David

xnappo
2009-07-04, 02:08
My problem is now: how can I include this into XBMC so that I can start this script via remote?!!

Cheers,
David

I just included it in my .xsession:


export XBMC_PLATFORM_MODE=1
while [ 1 ]
do
/sbin/modprobe -a snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_se
q_oss snd_rawmidi snd_seq snd_timer snd_seq_device snd
amixer -- sset IEC958 on
/usr/share/xbmc/xbmc.bin
/sbin/modprobe -r snd_seq_oss snd_seq_midi snd_seq_midi_event snd_seq_du
mmy snd_seq snd_rawmidi snd_pcm_oss snd_mixer_oss snd_hda_intel snd_pcm
done

case "$?" in
0 ) # Quit
touch /tmp/noRestartXBMC
break ;;
64 ) # Shutdown System
sleep 10 ;;
65 ) # Warm Reboot
echo Restarting XBMC ... ;;
66 ) # Reboot System
sleep 10 ;;
* ) ;;
esac


xnappo

SubSense
2009-08-10, 18:18
"/usr/bin/iecset audio on" worked for me. I hope it stays working
The other method from Tslayer not (maybe I did something wrong).
The method is also a bit difficult te read for a complete linux newbe.

megadeth
2009-08-10, 20:04
I've had this where only digital audio would output and NOT analog (still out of spdif).

What I usually do to fix in my scenario is:

0) Stop XBMC
1) Create a file in your home directory called .asoundrc that contains the following single line: pcm.!default spdif
2) Run: speaker-test -c 2
3) If you hear sound, you can stop.
4) Remove .asoundrc
5) Restart XBMC


Try that...

what does it mean when you did that and get sound out of the speaker test, but can't get sound out of xbmc or playing any other file?

my spdif was playing fine. then i turned my computer on today and no sound anymore?

the only thing i did different was use the suspend mode when turning off xbmc.

megadeth
2009-08-11, 01:29
update!!

i went back and put xbmc in suspend mode again. turned the computer back on and the sound was back ???

some kind of bug maybe with suspend mode :oo:

crackers
2009-09-10, 21:24
I ran into this - but it wasn't limited to XBMC. I did find a very quick, non-reboot work-around elsewhere:

sudo alsa force-reload

This does essentially the same as the modprobe scripts mentioned above.

spozen
2009-09-10, 22:50
Why isn't this a sticky anymore? This is very helpful if you have alsa problems.