You are not logged in.

#1 2013-10-03 19:50:59

Degru
Member
Registered: 2013-10-03
Posts: 41

Audio randomly stops working when playing videos [SOLVED]

So I've been watching some videos using Mplayer, and I'm having some problems.

The command I use is:

mplayer -vo vaapi -ao pulse /path/to/video.mkv

Sometimes, when I switch windows, and sometimes on its own, the audio just quits working for the entire system. I also remember this happening with some Java-based videoconferencing app. EDIT: This happens regardless of which program; after a while the audio just stops working. Resetting alsa via

alsactl kill quit; alsactl init

doesn't work. The only fix is to reboot.

pavucontrol shows both the device and the input stream playing something, so I don't think this is pulse's fault.

This same problem happens if I use -ao alsa, but this time I get this error from mplayer:

[AO_ALSA] Write error: Broken pipe
[AO_ALSA] Trying to reset soundcard.

This error happens several times while the audio is not working, and the video keeps playing.

Any ideas?

Last edited by Degru (2013-10-23 23:48:50)

Offline

#2 2013-10-08 03:33:22

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Audio randomly stops working when playing videos [SOLVED]

Try killing pulse and then playing something directly through alsa freshly after a reboot. Are you running some other sound servers like jack? Also are you resampling? Show us your .asoundrc. This may be related to a too small buffer_size.

Offline

#3 2013-10-08 12:42:07

nospoons
Member
Registered: 2013-10-01
Posts: 4

Re: Audio randomly stops working when playing videos [SOLVED]

Hi

This sounds very similar to the problems I've been having, computer shows its playing sound but no sound comes out of the audio.  I posted it up here:

https://bbs.archlinux.org/viewtopic.php?id=170698

The fault seems to happen with anything playing audio, Mplayer, Audacious and Flash video's.  I thought it might be hardwear, but the sound very briefly comes back when you log out.

Offline

#4 2013-10-09 16:50:23

Degru
Member
Registered: 2013-10-03
Posts: 41

Re: Audio randomly stops working when playing videos [SOLVED]

emeres wrote:

Try killing pulse and then playing something directly through alsa freshly after a reboot. Are you running some other sound servers like jack? Also are you resampling? Show us your .asoundrc. This may be related to a too small buffer_size.

Here's my /etc/asound.conf file. Don't have .asoundrc in my home directory.

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

# vim:set ft=alsaconf:

Not sure what the problem could be...

Here's what aplay -l shows, for good measure:

**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: CX20582 Analog [CX20582 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I also do not have an alsa config file in /etc/modprobe.d.

Offline

#5 2013-10-09 20:29:03

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Audio randomly stops working when playing videos [SOLVED]

Try setting your SB card as default (I am assuming you want your sound out through this one) in .asoundrc (create the file) or reorder your soundcards in /etc/modprobe.d/10-alsa.conf. Use https://wiki.archlinux.org/index.php/Ad … l_settings, https://wiki.archlinux.org/index.php/Ad … k_problems and http://alsa.opensrc.org/MultipleCards#T … .22_method as reference.
Have you tried playing a sound directly with aplay?

aplay -D SB /usr/share/sounds/alsa/*.wav
#or
aplay -D plug:SB /usr/share/sounds/alsa/*.wav

Edit:
Do you have any Auto-Mute options on that card? Check alsamixer.

Last edited by emeres (2013-10-09 20:42:47)

Offline

#6 2013-10-09 22:19:56

Degru
Member
Registered: 2013-10-03
Posts: 41

Re: Audio randomly stops working when playing videos [SOLVED]

emeres wrote:

Try setting your SB card as default (I am assuming you want your sound out through this one) in .asoundrc (create the file) or reorder your soundcards in /etc/modprobe.d/10-alsa.conf. Use https://wiki.archlinux.org/index.php/Ad … l_settings, https://wiki.archlinux.org/index.php/Ad … k_problems and http://alsa.opensrc.org/MultipleCards#T … .22_method as reference.
Have you tried playing a sound directly with aplay?

aplay -D SB /usr/share/sounds/alsa/*.wav
#or
aplay -D plug:SB /usr/share/sounds/alsa/*.wav

Edit:
Do you have any Auto-Mute options on that card? Check alsamixer.

All Automute options have been disabled. Keep in mind that the sound does work for about an hour or two of playing audio, but then just stops. I don't think this is a problem with the card order or selection of the device or anything, but rather a problem with the driver or something like the buffer size which you mentioned. It could also be because of some random program, but that shouldn't be the case since I don't have any unusual audio-related things installed. I have already tried playing sound via aplay, and it does not work. When the sound is fully working, I can play things with aplay just fine without any extra options. When it stops, then aplay doesn't work either.

Last edited by Degru (2013-10-09 22:21:28)

Offline

#7 2013-10-09 22:44:10

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Audio randomly stops working when playing videos [SOLVED]

I would check any Power Management related settings, systemd services and pulseaudioserver itself. If you do not find anything obvious, best way to proceed is to dismantle every aspect of sound system/applications, starting with disabling pulseaudio.
I am running a jack server and had issues with many xruns in past. Realtime priority solved that.
There is an another option however. Does your hardware get hot in time? I had a northbridge failure every time one particular disk was on high disk I/O throughput. Eventually the semiconductor died - the cooler was not mounted tight enough on one side of the chip and therefore not easily visible. Most integrated circuits have overheating safety shutdown capabilities.

Offline

#8 2013-10-09 22:49:36

Degru
Member
Registered: 2013-10-03
Posts: 41

Re: Audio randomly stops working when playing videos [SOLVED]

emeres wrote:

I would check any Power Management related settings, systemd services and pulseaudioserver itself. If you do not find anything obvious, best way to proceed is to dismantle every aspect of sound system/applications, starting with disabling pulseaudio.
I am running a jack server and had issues with many xruns in past. Realtime priority solved that.
There is an another option however. Does your hardware get hot in time? I had a northbridge failure every time one particular disk was on high disk I/O throughput. Eventually the semiconductor died - the cooler was not mounted tight enough on one side of the chip and therefore not easily visible. Most integrated circuits have overheating safety shutdown capabilities.

So... how would one go about doing all this? Any things to check for? Sorry, I'm just not used to configuring system stuff like this after coming from Ubuntu...

Offline

#9 2013-10-09 23:15:39

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Audio randomly stops working when playing videos [SOLVED]

You have to read a lot for starters: https://wiki.archlinux.org/index.php/Power_Management. Check for failures, errors and Power Management related information in systemd logs with:

sudo journalctl -x

Well one waterproof way of disabling pulseaudio is to remove it.
Realtime prioritizing https://wiki.archlinux.org/index.php/Realtime_for_Users and:

man limits.conf

although I would first try to increase audio buffers in .asoundrc https://wiki.archlinux.org/index.php/Ad … igurations, eventually in pulseaudio (does it even have such options?).
To check a hardware failure, I would go with a live-cd of mint or something similar, since you are already familiar with Ubuntu. Just use the system as usual for a extended period of time and if nothing happens, it is probably software related.
My machine has no audio after suspending/hibernating, but that is because I still did not implement any hooks for clean sound shutdown before sleep. Maybe something is trying to powersave your soundcard/system.

Offline

#10 2013-10-11 02:46:38

Degru
Member
Registered: 2013-10-03
Posts: 41

Re: Audio randomly stops working when playing videos [SOLVED]

Well, this appears to be a problem with Alsa in general. I ran a system update in Xubuntu 13.04, and same problem. Pavucontrol shows audio playing, but no audio comes out after about an hour of playing audio. Mplayer also throws an error (see above). Looks like I'll have to be using Windows for the time being...

What would be the best place to go to report this issue?

Offline

#11 2013-10-11 03:23:28

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Audio randomly stops working when playing videos [SOLVED]

So you have increased buffer_size in .asoundrc? How old is this card? Maybe the drivers are not mature enough, if it is a recent model. Have you tried setting the cards model to following?

options snd-hda-intel model="olpc-xo-1_5"

Have you tried unplugging and then plugging in jacks? According to Conexant DS CX2058x have a jack autodetect feature. That would suite your description.

I ran a system update in Xubuntu 13.04, and same problem.

So there was no problem before update? Why not install a previous version of alsa? As for bug reporting, search for alsa bug reporting.
As last resort I would try OpenSUSE if I were you. Yast does a pretty good job at setting things up. It was the only distribution, that played well with my audio setup without user intervention.

Offline

#12 2013-10-11 06:06:08

Degru
Member
Registered: 2013-10-03
Posts: 41

Re: Audio randomly stops working when playing videos [SOLVED]

I haven't really tried anything yet; busy day. I'll try increasing buffer size and all that tomorrow. The issue is probably not the driver, since this card isn't that new and it worked just fine before on all Linux variants. I'll have to try the jack thing, though. I play sound through the speakers, but it may be randomly switching to the headphones for some reason. One thing I found in the ALSA wiki page was this: https://wiki.archlinux.org/index.php/Al … g_playback

Could that have anything to do with it? I think I remember seeing something hda_intel when running lsmod...

Offline

#13 2013-10-11 08:42:45

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Audio randomly stops working when playing videos [SOLVED]

Yes it could. Try what the article in question suggests - disable powersaving, also try loading modules with your specific model, or a similar one like I suggested. Start with that. And keep this in mind:

If you use a laptop, pm-utils will change power_save back to 1 when you go onto battery power even if you disable power saving in /etc/modprobe.d. Disable this for pm-utils[...]

Offline

#14 2013-10-11 17:05:32

Degru
Member
Registered: 2013-10-03
Posts: 41

Re: Audio randomly stops working when playing videos [SOLVED]

emeres wrote:

Yes it could. Try what the article in question suggests - disable powersaving, also try loading modules with your specific model, or a similar one like I suggested. Start with that. And keep this in mind:

If you use a laptop, pm-utils will change power_save back to 1 when you go onto battery power even if you disable power saving in /etc/modprobe.d. Disable this for pm-utils[...]

Yeah, that's what I was gonna do. This laptop has a nearly-broken battery anyways, so I'm not too worried about power-saving. I only take it off the charger when I need to move it somewhere. The problem with this issue is that it takes like an hour to see if any fixes actually worked, so this is quite difficult to troubleshoot. I'll try just playing some Pandora radio in the background.

Offline

#15 2013-10-14 18:57:21

Degru
Member
Registered: 2013-10-03
Posts: 41

Re: Audio randomly stops working when playing videos [SOLVED]

So I tried disabling powersaving following the instructions on the wiki, and have finally isolated this as a hardware issue. I used the touch command and alsa-base.conf to disable powersaving, and I also defined the correct snd_hda_intel model in the same file. Meanwhile, I've been using Windows, and it has the same problem. The difference is that the driver recovers after about 5-10 seconds (maybe it powercycles the card?) and audio resumes. I was probably noticing it before, as it probably happened when not playing audio. The Linux driver apparently does not have this recovery feature, and the only fix is to reboot the computer. Perhaps the ALSA devs could add this in?

Welp, this thing is a piece of junk anyways. I'll see what I can replace it with.

Marking this as solved.

EDIT: Erm.. How does one mark a thread as solved?

Last edited by Degru (2013-10-14 19:00:43)

Offline

#16 2013-10-23 21:16:36

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Audio randomly stops working when playing videos [SOLVED]

Offline

#17 2013-10-23 23:49:59

Degru
Member
Registered: 2013-10-03
Posts: 41

Re: Audio randomly stops working when playing videos [SOLVED]

Welp, that's over. I dug my old Inspiron out from my closet and cleaned it, and it's running even faster than the Thinkpad. No audio issues now.

Offline

Board footer

Powered by FluxBB