Sound works...sometimes

Suse 11.2 - KDE 4.3.5

I have only one sound card. The only Pulse software that is installed is libpulse0 and libxine1-pulse. All sound applications work. Amarok, vlc, kaffeine, Skype etc. But then every say 6th. or 7th. boot the sound dies. On everything. Even the startup melody. When I go to Yast>Hardware>Sound everything looks in order but the test on the card makes no sound. But if I delete the active card then re-enable it everything works again.

I saved the working /etc files as *.works and ran the following script…

#!/bin/bash

echo Checking sound

cmp /etc/modprobe.d/50-sound.conf /etc/modprobe.d/50-sound.conf.YaST2save

cmp /etc/asound.state /etc/asound.state.works

cmp /etc/sysconfig/sound /etc/sysconfig/sound.works

The only difference was a slight volume difference in asound.state (23 vs 27).

I thought I might try to diagnose it by doing a file search for file changes in the last 5 minutes immediately after I run the Yast re-enable. But where should I be looking?

That suggests to me that some application has seized the audio device, and refuses to let it go, and will NOT share it.

What you could do is learn a bit more about the files that are open when an application is using the audio device. You can do that with the “lsof” (list of open files) command. And that way by examining the open files when this happens, you can confirm if indeed my assessment is correct that an application has seized the audio device.

The way to do that is to run this command:

 lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*

(note the “snd/*” is different from the rest) and run that command on these occasions:

  1. after PC 1st boots with no audio playing
  2. when successfully playing audio with Amarok, vlc, kaffeine, Skype etc,
  3. when audio stops working
    In EACH case save the output to a text file. Label the file (or add some text) so you know what app was playing when the command run and output saved). Keep that file. Then after complete (when audio does not work, and also after you restart teh sound) compare all the files. And then deduce if any any application is accessing the audio device when sound does not work.

I also suspect that instead of going into YaST to restart the sound device, you could type:

su -c 'rcalsasound restart'

and enter root password, and restart your mixer (kmix in kde) and that will do the same to restarting sound and clearing any inappropriate lock on your audio device.

Thank you. This is exactly what I needed. A method to track it down and learn along the way. I should have some results in a few days.

The frustration continues. Here are some results.

After PC 1st boots with no audio playing

lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*
lsof: status error on /dev/dsp*: No such file or directory
lsof: status error on /dev/audio*: No such file or directory
lsof: status error on /dev/mixer*: No such file or directory
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
knotify4 2607 ion 12u CHR 116,7 0t0 3923 /dev/snd/controlC0
kmix 3195 ion 10u CHR 116,7 0t0 3923 /dev/snd/controlC0

When successfully playing audio

Sound working vlc running Sun Jun 6 23:32:49 CEST 2010

lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*
lsof: status error on /dev/dsp*: No such file or directory
lsof: status error on /dev/audio*: No such file or directory
lsof: status error on /dev/mixer*: No such file or directory
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
knotify4 2164 ion 12u CHR 116,7 0t0 3997 /dev/snd/controlC0
kmix 2343 ion 10u CHR 116,7 0t0 3997 /dev/snd/controlC0
vlc 7638 ion mem CHR 116,5 3972 /dev/snd/pcmC0D0p
vlc 7638 ion 15r CHR 116,2 0t0 3809 /dev/snd/timer
vlc 7638 ion 16u CHR 116,5 0t0 3972 /dev/snd/pcmC0D0p

When audio stops working (first time)

lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*
lsof: status error on /dev/dsp*: No such file or directory
lsof: status error on /dev/audio*: No such file or directory
lsof: status error on /dev/mixer*: No such file or directory
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
knotify4 2202 ion 12u CHR 116,7 0t0 4083 /dev/snd/controlC0
kmix 2381 ion 10u CHR 116,7 0t0 4083 /dev/snd/controlC0

When audio stops working (second time)

lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*
lsof: status error on /dev/dsp*: No such file or directory
lsof: status error on /dev/audio*: No such file or directory
lsof: status error on /dev/mixer*: No such file or directory
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
knotify4 2548 ion 12u CHR 116,7 0t0 3948 /dev/snd/controlC0
kmix 3082 ion 10u CHR 116,7 0t0 3948 /dev/snd/controlC0

I executed su -c ‘rcalsasound restart’ to reset as suggesated. It did not affect anything. Kmix was not showing on the panel (normally does). Kmix showed a blank screen when started from the CLI.

But when I started to shut down for a reboot a small window opened over my panel (right hand side). I couldn’t read it all before it disappeared, but it did say something like " Phonon ICE1724 not working falling back to xxxxx" and on the next boot my sound came back. So did Kmix on my panel.

Still a mystery to me.

did not affect anything? Now I’m confused.

It will restart your sound driver! You saw no messages about the sound driver shutting down and starting up ??? Then I also advised you must restart your mixer after running that “rcalsasound restart” command. ie do so from the menu, or by typing “kmix” as a regular user.

Your post confuses me and I can NOT tell if you typed that to restart your mixer!

Please, with your PC connected to the internet, also run the diagnostic script:

/usr/sbin/alsa-info.sh

and select the SHARE/UPLOAD option. That will upload your PC information to the web, and give you the URL/website where it is located. Please provide that URL/website address.

If you can not find that, then run:

/usr/sbin/alsa-info.sh --no-upload

which will create an /tmp/alsa-info.txt file. Open that file with a text editor and copy / paste it to New - Pastie, and press “paste” and that will create a web page with the script output. Post here the website/URL address that it gives.

Maybe that information will show something to provide a hint on things.

Please also provide the output of running:

rpm -qa '*alsa*'
rpm -q libasound2

Maybe that information will also show something to provide a hint on things.

When I executed su -c ‘rcalsasound restart’ it did restart and return me to my prompt. Then when as user I tried to click on Kmix which is normally showing in my panel, it was not there. Then I tried from the CLI which produced a mostly blank Kmix window with only three menu choices. I believe they were “File”, “Settings” and “Help”. None of them were selectable. After the reboot my sound came back and Kmix appeared in the panel.

URL=http://www.alsa-project.org/db/?f=9ef5b2e38f2354f9c3b600d45c2fb38ef7d4d103

~> rpm -qa ‘alsa
alsa-utils-1.0.21-3.1.i586
alsa-oss-1.0.17-25.2.i586
alsa-1.0.21-3.2.i586
alsa-plugins-1.0.21-3.3.i586

~> rpm -q libasound2
libasound2-1.0.21-3.2.i586

By the way, when I executed /usr/sbin/alsa-info.sh I was told that a newer version of Alsa-info was available but I did not choose to update.

I notice in the alsa-info data…

!!ALSA Version
!!------------

Driver version: 1.0.20
Library version:
Utilities version: 1.0.21

…is that possibly a problem?

I note this:

!!Soundcards recognised by ALSA
!!-----------------------------

 0 [ICE1724        ]: ICE1724 - ICEnsemble ICE1724
                      ICEnsemble ICE1724 at 0xb000, irq 16

ie an ice1724

No.

This is strange. Typically those directories ARE in place. I’m not famliar with an ice1724 hardware audio codec, so this could be associated with that, or it could be a problem.

I did a search for the ice1724.

I see some updates since 1.0.20 and 1.0.21 of alsa:

45.Changes v1.0.20 v1.0.21 (515,911 bytes)
   ALSA: ice1724 - Add ESI Maya44 suppor 
   Add build stub for ice1724 maya44 suppor 
   ALSA: ice1724 - Patch for suspend/resume for Audiotrak Prodigy ... 
   ALSA: ice1724 - Add ESI Maya44 suppor 
   ALSA: ice1724 - Allow spec driver to create own routing control 
46.Changes v1.0.21 v1.0.22 (243,199 bytes)
   ALSA: ice1724 - aureon - modify WM8770 Master & DAC volume 
   ALSA: ice1724 - make some bitfields unsigned 
   ALSA: ice1724 - Fix section mismatch in prodigy_hd2_resume() 
   ALSA: ice1724 - Patch for suspend/resume for ESI Juli@ 
   ALSA: ice1724 - Infrasonic Quartet support 
47.Matrix:Vendor-Sims (545 bytes)
   [Matrix:Module-ice1724|Details]] 
48.Changes v1.0.22 v1.0.23 (266,921 bytes)
   ALSA: ice1724 - aureon - fix wm8770 volume offset 
   Based on ice1724 suspend/resume work of Igor Chernyshev. 
   ALSA: ice1724 - aureon - fix wm8770 volume offset 

are those relevant to your observations? I don’t know. Possibly not. Possibly yes.

You could try an update to 1.0.23 of alsa. There is guidance here: SDB:Alsa-update - openSUSE … be VERY careful when following that guide. BEFORE updating check your alsa and libasound2 version numbers. AFTER you “think” you have done a sucessful update, check again your alsa and libasound2 version numbers. If they are the same , you FAILED in doing the update. In which case READ the guide again, as it does provide the necessary instructions, but too many users ignore the guide’s advice, think they know better how to do this, and they mess it up.

Thanks for the sound advice (pun intended). It will take some time to work through all this. If I wasn’t so stubborn I would probably pull out the card and run on the on board sound (which is inferior for a variety of reasons) or buy another card. But the card worked just fine while I was running 10.3 on this computer, and it’s only been since I installed 11.2 that the problems started. I’d like to think that the newer version is an improvement in this area, which is why I keep beating my head against the wall.

Sorry I’ve taken up so much of your time, better spent on more serious problems.