Audio problems with ALSA

Bug #1029414 reported by Cleber Casali
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Kubuntu 12.04 here.

This system is built for heavy gaming and videos, it has a Zogis GeForce GTX 550 Ti which connected to my TV via HDMI.

I'm using the sound card that's integrated into the GPU, I have made it my primary card in alsa by changing "/usr/share/alsa/alsa.conf":

defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0

became:

defaults.ctl.card NVidia
defaults.pcm.card Nvidia
defaults.pcm.device 7

I have never liked pulseaudio, and alsa does everything I need faster, so pulseaudio is usually the first thing I remove in my installation.

sudo apt-get purge pulseaudio

However those are the problems I have without pulseaudio:

1) dolphin-emu produces some weird noises randomly.

2) The 2 games I have developed which use SDL for sound have sound distorted and failing a lot.
http://cmcgames.darkphear.com/2012/01/yagac.html
http://iceroyds.darkphear.com/
Other games that use SDL for sound seem to have the same behaviour.

When I run it in the console I have a LOT of: ALSA lib pcm.c:7339snd_pcm_recover) underrun occurred

3) MAME has serious latency in sound (about half a second). It uses SDL for sound too.

4) MAME running old games such as twinbee have a terrible crackling sound that makes it unplayable.
There are two lame workarounds for this; one is reducing sampling rate below 22050 (argh!); other is using the alsa oss wrapper : "aoss mame twinbee -audiodriver dsp" which is a little better.

I have tried removing the Ubuntu SDL packages and installing SDL from the official page, but it didn't change a thing. The problem seems to be deeper, maybe in libasound2 or in alsa itself.
---
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: user-kubuntu 1836 F.... kded4
                      user-kubuntu 2202 F.... kmix
 /dev/snd/controlC0: user-kubuntu 1836 F.... kded4
                      user-kubuntu 2202 F.... kmix
Card0.Amixer.info:
 Card hw:0 'PCH'/'HDA Intel PCH at 0xf6420000 irq 56'
   Mixer name : 'Realtek ALC892'
   Components : 'HDA:10ec0892,80862007,00100302'
   Controls : 38
   Simple ctrls : 19
Card1.Amixer.info:
 Card hw:1 'NVidia'/'HDA NVidia at 0xf6000000 irq 17'
   Mixer name : 'Nvidia GPU 15 HDMI/DP'
   Components : 'HDA:10de0015,10de0101,00100100'
   Controls : 25
   Simple ctrls : 5
DistroRelease: Ubuntu 12.04
InstallationMedia: Kubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120423)
NonfreeKernelModules: nvidia
Package: alsa-driver (not installed)
ProcEnviron:
 LANGUAGE=pt_BR
 TERM=xterm
 LANG=pt_BR.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 3.2.0-26.41-generic 3.2.19
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
Tags: precise
Uname: Linux 3.2.0-26-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
dmi.bios.date: 04/20/2012
dmi.bios.vendor: Intel Corp.
dmi.bios.version: BGP6710J.86A.2185.2012.0420.0057
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: DP67BG
dmi.board.vendor: Intel Corporation
dmi.board.version: AAG10491-306
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCorp.:bvrBGP6710J.86A.2185.2012.0420.0057:bd04/20/2012:svn:pn:pvr:rvnIntelCorporation:rnDP67BG:rvrAAG10491-306:cvn:ct3:cvr:
---
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: user-kubuntu 1836 F.... kded4
                      user-kubuntu 2202 F.... kmix
 /dev/snd/controlC0: user-kubuntu 1836 F.... kded4
                      user-kubuntu 2202 F.... kmix
Card0.Amixer.info:
 Card hw:0 'PCH'/'HDA Intel PCH at 0xf6420000 irq 56'
   Mixer name : 'Realtek ALC892'
   Components : 'HDA:10ec0892,80862007,00100302'
   Controls : 38
   Simple ctrls : 19
Card1.Amixer.info:
 Card hw:1 'NVidia'/'HDA NVidia at 0xf6000000 irq 17'
   Mixer name : 'Nvidia GPU 15 HDMI/DP'
   Components : 'HDA:10de0015,10de0101,00100100'
   Controls : 25
   Simple ctrls : 5
DistroRelease: Ubuntu 12.04
InstallationMedia: Kubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120423)
NonfreeKernelModules: nvidia
Package: alsa-driver (not installed)
ProcEnviron:
 LANGUAGE=pt_BR
 TERM=xterm
 LANG=pt_BR.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 3.2.0-26.41-generic 3.2.19
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
Tags: precise
Uname: Linux 3.2.0-26-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
dmi.bios.date: 04/20/2012
dmi.bios.vendor: Intel Corp.
dmi.bios.version: BGP6710J.86A.2185.2012.0420.0057
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: DP67BG
dmi.board.vendor: Intel Corporation
dmi.board.version: AAG10491-306
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCorp.:bvrBGP6710J.86A.2185.2012.0420.0057:bd04/20/2012:svn:pn:pvr:rvnIntelCorporation:rnDP67BG:rvrAAG10491-306:cvn:ct3:cvr:

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1029414/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Logan Rosen (logan) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command, as it will automatically gather debugging information, in a terminal:
apport-collect 1029414
When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

affects: ubuntu → alsa-driver (Ubuntu)
Changed in alsa-driver (Ubuntu):
status: New → Incomplete
Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : AlsaDevices.txt

apport information

tags: added: apport-collected precise
description: updated
Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : AplayDevices.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : ArecordDevices.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : BootDmesg.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card0.Amixer.values.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card0.Codecs.codec.2.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Amixer.values.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Codecs.codec.0.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Codecs.codec.1.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Codecs.codec.2.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Codecs.codec.3.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : PciMultimedia.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : ProcCpuinfo.txt

apport information

description: updated
Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : AlsaDevices.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : AplayDevices.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : ArecordDevices.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : BootDmesg.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card0.Amixer.values.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card0.Codecs.codec.2.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Amixer.values.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Codecs.codec.0.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Codecs.codec.1.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Codecs.codec.2.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : Card1.Codecs.codec.3.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : PciMultimedia.txt

apport information

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote : ProcCpuinfo.txt

apport information

Logan Rosen (logan)
Changed in alsa-driver (Ubuntu):
status: Incomplete → New
Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote :

This is fixed in 12.04 LTS.

I have a different problem with 13.04, so I have opened a new bug.

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote :

Well, for the record, the problem is back in 13.04. I have just figured out what actually fixed this issue.
I have changed:
/usr/share/alsa/pcm/dsnoop.conf -> period_size -> default -> changed from 512 to 1024
/usr/share/alsa/pcm/dmix.conf -> period_size -> default -> changed from 512 to 2048

Revision history for this message
Cleber Casali (cleberdemattoscasali-1) wrote :

Found a better fix. Added:

options snd-hda-intel enable_msi=1 bdl_pos_adj=1,48

to /etc/modprobe.d/alsa-base.conf

Explanation:
I had "hda-intel: IRQ timing workaround is activated for card #1. Suggest a bigger bdl_pos_adj." in my dmesg. So I had to increase "bdl_pos_adj" for my second sound card (Nvidia HDMI).
After this tweak, both the message and the crackling are gone.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in alsa-driver (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for alsa-driver (Ubuntu) because there has been no activity for 60 days.]

Changed in alsa-driver (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.