Alsa loses AC'97 SPDIF output in Feisty

Bug #118861 reported by Petri
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Every now and then the sound output through PSDIF is lost. Re-installing alsa sometimes helps, sometimes not. Sometimes tweaking alsamixer settings back and forth helps, sometimes not. The last soundloss cound not be fixed with either of the above.

When the problem occurs, only multichannel (DVD) content audio can be heard when playing it in totem or xine, or sometimes totem only. No any kind of stereo or mono content provides sound out of the system.

The other indicator on the problem is that the input signal indicator in the amplifier disappears.
After the problem appears, the indicator appears when multichannel media is played and disappears again when
the media is exited.
If stereo content is played (with xine, totem, mythtv etc) there is no sound output from the Ubuntu setup.
Switching the IEC958 in alsamixer does not help.

The problem appears without
- any HW re-configuration
- rebooting
- software installation/upgrade/removal
- changing audio settings in the system itself of programs listed above
usually after running xine, totem and/or mythtv-frontend several times in the sytem

System: Asus P4P-800E, Ubuntu Feisty with SPDIF connection to amplifier.
uname -a:
Linux <hostname> 2.6.20-16-generic #2 SMP Wed May 23 01:46:23 UTC 2007 i686 GNU/Linux

lspci -v:
00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)
        Subsystem: ASUSTeK Computer Inc. Unknown device 812a
        Flags: bus master, medium devsel, latency 0, IRQ 22
        I/O ports at e800 [size=256]
        I/O ports at ee80 [size=64]
        Memory at febff800 (32-bit, non-prefetchable) [size=512]
        Memory at febff400 (32-bit, non-prefetchable) [size=256]
        Capabilities: [50] Power Management version 2

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ICH5 [Intel ICH5], device 0: Intel ICH [Intel ICH5]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ICH5 [Intel ICH5], device 4: Intel ICH - IEC958 [Intel ICH5 - IEC958]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

lsmod|grep snd:
snd_intel8x0 34332 1
snd_ac97_codec 98464 1 snd_intel8x0
ac97_bus 3200 1 snd_ac97_codec
snd_pcm_oss 44544 0
snd_mixer_oss 17408 1 snd_pcm_oss
snd_pcm 79876 3 snd_intel8x0,snd_ac97_codec,snd_pcm_oss
snd_seq_dummy 4740 0
snd_seq_oss 32896 0
snd_seq_midi 9600 0
snd_rawmidi 25472 1 snd_seq_midi
snd_seq_midi_event 8448 2 snd_seq_oss,snd_seq_midi
snd_seq 52592 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_timer 23684 2 snd_pcm,snd_seq
snd_seq_device 9100 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
snd 54020 12 snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore 8672 1 snd
snd_page_alloc 10888 2 snd_intel8x0,snd_pcm

Alsamixer:
Only Master and IEC958 enabled

cat /proc/asound/modules
 0 snd_intel8x0

Alsa drivers installed as described in chapter ' Getting the ALSA drivers from a *fresh* kernel' in
<http://doc.gwos.org/index.php/Comprehensive_Sound_Problems_Solutions_Guide>

System -> Preferences -> Sounds, Devices-tab: Everything set to ALSA

totem -> Edit -> Preferences -> Audio output type: AC3 passthrough
xine -> Settings -> Setup -> Audio -> Speaker arrangement: Pass Through
mythfrontend -> Utilities/Setup -> Setup -> General/Audio
     Audio output device: ALSA:default
     Passthrough output device: Default
     Enable AC3 to SPDIF passthrough -checkbox checked
     Enable DTS to SPDIF passthrough -checkbox checked

Revision history for this message
Petri (pet-iki) wrote :

With more digging it looks like that when totem is exited (always dumps a core), it sometimes somehow changes the alsa default device. So the problem seems to be totem?

Revision history for this message
Nelson Martins (nelson-m) wrote :

I had the same problem today. I was trying to put vlc playing in 5.1, and the same thing happened. Now I only have sound from the analogue output (headphones) or when I play anything with AC3 sound with totem. Everything was working perfectly before that. I've tried to put vlc with the original configuration, reconfiguring alsa, fiddle with the mixer settings, etc, but nothing worked... I will try to reinstall alsa.
My specs are similar
ASUS P4P800-E, SB Live with SPDIF to amplifier, Ubuntu Feisty with latest kernel

Revision history for this message
Klaus Weidner (kweidner) wrote :

I had the same problem (on a Fedora 6 system), for me upgrading the alsa drivers and tools to 1.0.14 fixed it. According to http://alsa.opensrc.org/index.php/Hda older versions may have known mixer-related problems.

I still need to reload the modules sometimes after playing passthrough digital audio (especially if the app doesn't quit cleanly), but now get the sound back properly after that.

Revision history for this message
Nelson Martins (nelson-m) wrote :

I've managed to solve the problem, with a full reinstall of alsa and all the sound-related packaged (this involved deleting the asoundrc, and all alsa related files...luckily I didn't borked the system completely); before this I've tried to do a purge/install of the alsa packages, as described in http://doc.gwos.org/index.php/Comprehensive_Sound_Problems_Solutions_Guide , but this didn't work...

Revision history for this message
tkoopa (tkoopa) wrote :

I have the same issue on a week old feisty + mythtv install with an audigy 2 ZS. All was smooth using spdif out, then after having played a DVD (not the for first time though), spdif out just stopped working. It's still connected (dual boot to win confirms that easily), and pluging headphones into the central analog out still gives sound in some apps (depends on settings).
this is what I've tried without any progress:
  - set all the mixers on max and unmuted (in gnome volume control and alsamixer)
  - reinstalled alsa-base, alsa-utlis and linux-sound... with purge,
   - copied .asoundrc.asoundconf, .asoundrc and /var/lib/alsa/asound.state from another box with identical hardware and similar setup

Revision history for this message
tkoopa (tkoopa) wrote :

I finally managed to resolve this using the following method :
- sudo apt-get --purge remove alsa-base alsa-utils linux-sound-base (also removes gdm ubuntu-desktop ubuntu-minimal ubuntu-mythtv-frontend)
- locate and delete files/folders with asound or alsa
- sudo apt-get clean
- reboot
- sudo apt-get install alsa-base alsa-utils linux-sound-base (gdm ubuntu-desktop ubuntu-minimal ubuntu-mythtv-frontend)
- sudo /etc/init.d/gdm restart
- go to synaptic, search for alsa, mark all alsa related installed packages for reinstallation
- reboot and spdif out is working again

Revision history for this message
Daniel T Chen (crimsun) wrote :

[User-induced] Configuration change based on user feedback.

Changed in alsa-driver:
status: Unconfirmed → Rejected
Revision history for this message
spaceman (spacedoubtman) wrote :

This happens to me too! I was able to fix it using solutions provided, then it broke again when I started freevo (which uses xine to play video) and I can't fix it again.

I find also that I can play ac3 videos and if I change my alsa device from default to spdif I get sound output only too fast. From what I read this is because mp3 are 44khz but spdif is 48 - but it should work when set on default - it used to. Why is this happening???

These solutions are not very safe.
The first time I followed tkoopa and I broke something deleting alsa folders but re-instaled asound and sound was working perfectly.
Now, I don't know how but I think I uninstalled almost everything on my system. I re-installed it, but all configurations are lost and I still don't have sound.

Revision history for this message
spaceman (spacedoubtman) wrote :

btw
My sound device is:
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)

and I'm running a fully updated 64bit fiesty

Revision history for this message
spaceman (spacedoubtman) wrote :

After ages and ages of googling, reinsalling alsa, restarting I tried this and it works again

Opened an ac3 video in xine
listened briefly
dragged an mp3 onto xine
pressed next
the mp3 played
closed xine
now my spdif works fine

might be random but hopefully... a solution

Revision history for this message
spaceman (spacedoubtman) wrote :

it broke again and the thing with xine I tried b4 is not working

I'm also finding that when playing ac3 sound (5.1 especially) I get the sound cut out every now and then.

Revision history for this message
Zach (zachary-burke) wrote :

I have hit this exact same issue on Feisty. I had been successfully using SPDIF output for the last couple months. I tried ripping a DVD for the first time the other day in mythtv and when I played the file back SPDIF no longer worked. I verified that the analog output works and the odd thing is that I can see the red laser light on the optical cable. I did not modify any system settings or volume settings, it just flat out stopped working.

I have been testing audio by going to Preferences->Sound and trying to play the test sound. So far I cannot get the sine wave to play using any of the devices. I have validated my stereo receiver and digital audio output from the computer using another bootable distribution. Something is broken here. This bug should be re-opened. I will provide any details you need.

Revision history for this message
tkoopa (tkoopa) wrote :

I lost spdif out again after the latest feisty updates (this time I hadn't been messing with configuration files for a while). I reproduced the steps I illustrated above and got it working again. I also believe this should be re-opened, because this time the problem occurred after official update.

Revision history for this message
jonaz__ (jonaz-86) wrote :

I lost spdif (only pcm not ac3) 2 days ago... ive been looking for a solution ever since... today i found this thread and tkoopa 's solution worked for me... gotta be an easier way? :)

Revision history for this message
muncrief (rmuncrief) wrote :

The only way I've ever been able to control SPDIF output with any Linux distribution using alsa is by installing aumix or a variant and controlling SPDIF with the "Digital1" control.

For Ubuntu Feisty you can install aumix (a terminal based mixer) or aumix-gtk (gtk GUI). I use the gtk version.

So for newbies do this:

1. Open a terminal.

2. Type "sudo apt-get install aumix-gtk" and hit enter. This will install the mixer you need.

3. Now type "aumix-gtk" and the mixer will pop up.

4. A. If you want SPDIF output enabled, set the "Digital1" slider all the way to the left (0).
    B. If you want SPDIF output disabled, set the "Digital1" slider all the way to the right (100).

Note: There is no in between setting, this control should really just be a toggle selection of some sort.

IMPORTANT NOTE: Every time you play a digital source (i.e. Dolby 5.1) and the source changes mode, for example if you're playing a DVD and the video switches from stereo previews to the Dolby Digital movie, the aumix "Digital1" slider will actually reset itself back to 100, disabling SPDIF! So you have to set it to 0 to enable SPDIF again. This is really a royal pain, and may be the cause of the mysterious loss of SPDIF some of you are experiencing.

In any case, I hope this helps. I'm just a user and discovered the "secret" of Linux SPDIF output years ago, and have complained to developers many times, asking them to please fix this ridiculous and user-stopper problem, but to no avail. The Linux developers of all relevant audio software components and distributions are equally guilty by the way, I'm not singling out Ubuntu.

It sure has lost Linux a lot of potential users who simply wanted to watch DVD's or Digital TV with SPDIF output though. It's really a shame.

Revision history for this message
tkoopa (tkoopa) wrote :

Thanks muncrief, after the latest kernel update I lost sound again, this time I just installed aumix, put all volume sliders to max and after relaunching mythtv all sound was back. Your solution is much quicker than mine, but obviously there's still something wrong if updates are making us lose our volume settings.

Revision history for this message
racerraul (racerraul) wrote :

In my system... all aumix does is mute and unmute the digital device in alsamixer, needless to say it didn't work for me and I removed aumix since it didn't seem to offer any further control of the digital output than already in alsamixer.

Still looking for a solution to this... the same thing happened to me as everyone else on the thread.
I had sound via digital out for all types of content until I played a DVD....

Now only DVD play's through the digital out put and everything else only works from the analog output.

I want all content to play on both simultaneously, since I use the analog out to play my music on a radio in another room.

reinstalling is not a real fix, since it is obvious that a files or conf file changed... I can't believe its been this long and no one has figured out what it is...

Revision history for this message
spaceman (spacedoubtman) wrote :

I found that /etc/init.d/alsa-utils was setting up my soundcard badly.

I take it it got in a bad state somehow and that was saved on shutdown and that script tries to restore it. Not sure how to stop it running so I just removed it and everything is working ok. It still happens sometimes after playing a ddvd but a restart fixes it.

Only problem was the volume was always set to zero on restart so I created my own custom script to do this:
/usr/bin/amixer -c0 sset 'IEC958',0 Playback on
/usr/bin/amixer -c0 sset 'IEC958 Output',0 Playback on
/usr/bin/amixer -c0 sset 'IEC958 Playback AC97-SPSA',0 0
/usr/bin/amixer -c0 sset 'VIA DXS',0 Playback 30
/usr/bin/amixer -c0 sset 'Master',0 Playback on
/usr/bin/amixer -c0 sset 'Master',0 Playback 25
/usr/bin/amixer -c0 sset 'PCM',0 Playback on
/usr/bin/amixer -c0 sset 'PCM',0 Playback 25

HTH,
Adam

Revision history for this message
racerraul (racerraul) wrote :

I noticed on my amp that what changed was the digital stream, in other words, no more PCM which is the digital stream used by most 2 channel sources...

so googled how to change the digital stream in linux... came up with this command to run in terminal...

iecset audio on

That fixed it for me... I am as I type this listening to my music and fav di.fm stations via digital out.

Hope it helps everyone.

I'm of to understand what it does, cause I still don't know.
http://linux.die.net/man/1/iecset

Revision history for this message
Zach (zachary-burke) wrote :

racerraul, I agree that this is ridiculous. I never discovered the internals of this issue but I did come up with a workaround that has worked for the last year. I noticed that after playing a DVD or listening to an MP3 through mythtv that I would lose my audio. Now, when I say lose audio, I mean that when I went into mythtv and watched a video, I would have no sound.

I figured out that if I left my video playing, opened up the sound panel and hit the test button that suddenly my sound would come back. I believe it is the test button that I am referring to, the one that plays the sine wave. So the 2nd time I got up to fix this, I figured it needed to stop. I wrote the following script and assigned it to a button on my remote:
#!/bin/bash
#Play an mp3 through gmplayer
gmplayer /home/burkza/fix.mp3&
#wait 3 seconds
ping 127.0.0.1 -c 3
#kill gmplayer
ps aux | grep fix.mp3 | gawk -F" " '{print $2}' | xargs kill -9

It still works for me. I'll add the caveat that one possible reason this works for me is the configured settings in gmplayer so ymmv. To my knowledge I have never touched the gmplayer configuration.

Note that this bug is marked as invalid so is not getting any attention. I plan on upgrading my server to 9.10 when it releases, doing a fresh install and if this behavior is still present I'm opening up a new bug. I feel everyone's pain, this should just work and it clearly does not.

Revision history for this message
racerraul (racerraul) wrote :

Zach... can you replicate the problem? I am curious that even though your problem is a bit diff (audio worked for me with DVDs only, thus s a DD 5.1 data stream) Instead of trying your fix right away run iecset in a terminal and post the contents... should look like this. if your Digital Output (iec958, aka S/PDIF) is on.

Mode: consumer
Data: audio
Rate: 48000 Hz
Copyright: permitted
Emphasis: none
Category: PCM coder
Original: original
Clock: 1000 ppm

If off, then your output would look like something like this...

Mode: consumer
Data: non-audio
Rate: 48000 Hz
Copyright: permitted
Emphasis: none
Category: PCM coder
Original: original
Clock: 1000 ppm

the switch for enabling the PCM data stream is
iecset audio on
iecset audio off

I don't think this is a bug, but rather a incredibly poorly documented aspect of the control over the Digital Signal stream\outputs.
And we just havent ran into the Linux Audiophiles (if they are out there) than know and can explain the ins\outs of this in Linux.

Revision history for this message
spaceman (spacedoubtman) wrote :

My alsa utils were re-enabled with the latest dist upgrade, the problem happened again so I ran iecset and it fixed it!

i@iii:~$ iecset audio on
Mode: consumer
Data: audio
Rate: 48000 Hz
Copyright: permitted
Emphasis: none
Category: PCM coder
Original: original
Clock: 1000 ppm

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.