You are not logged in.

#1 2015-01-07 18:00:41

Dun
Member
Registered: 2014-12-28
Posts: 98

[SOLVED]ALSA configuration

I have problems with my system and ALSA. I can't play audio from multiple sources at the same time. I can only pause the audio, then have to wait ~5 seconds and  only then I can open an other file with audio.
It appears also that I'm not able to use mpd. NCMPCPP displays "Volume: n/a" and stays paused, nearly every other audio-output seems to be fine.
Is there maybe a way of reinstalling ALSA completely?

$ fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/pcmC0D0p:   dun       25578 F...m mplayer

Only aplay seems to not work as well. I get a grainy noise when I try to play a mp3 file.

$ aplay -f dat -D default .mp3

Here's my current ~/.asoundrc:

pcm.SB {
	type hw
	card 0
}

ctl.SB {
	type hw           
	card 0
}

The /etc/asound.conf is empty.

The installed ALSA packages:

$ pacman -Qs alsa
local/alsa-lib 1.0.28-1
    An alternative implementation of Linux sound support
local/alsa-oss 1.0.28-1
    OSS compatibility library
local/alsa-plugins 1.0.28-2
    Extra alsa plugins
local/alsa-utils 1.0.28-1
    An alternative implementation of Linux sound support
local/alsaplayer 0.99.81-6
    A heavily multi-threaded PCM player that tries to excercise the ALSA library and driver quite a bit
local/lib32-alsa-lib 1.0.28-1
    An alternative implementation of Linux sound support (32 bit)
local/zita-alsa-pcmi 0.2.0-2
    The successor of clalsadrv, provides easy access to ALSA PCM devices.

Codec and devices:

$ cat /proc/asound/card0/codec#0 | grep Codec
Codec: Realtek ALC892
$ lspci | egrep -i audio
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40)
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Barts HDMI Audio [Radeon HD 6800 Series]
$ aplay -l dump
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
$ lsmod | grep 'snd'
snd_hda_codec_realtek    67469  1 
snd_hda_codec_generic    63126  1 snd_hda_codec_realtek
snd_hda_codec_hdmi     49213  1 
snd_hda_intel          26387  0 
snd_hda_controller     26938  1 snd_hda_intel
snd_hda_codec         108536  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
snd_hwdep              17244  1 snd_hda_codec
snd_pcm                88487  4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
snd_timer              26614  1 snd_pcm
snd                    73436  8 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
soundcore              13031  2 snd,snd_hda_codec

~/.mpd/mpd.conf:

audio_output {
    type            "alsa"
    name            "My ALSA Device"
    format            "44100:16:2"    # optional
    mixer_type        "hardware"
    device            "hw:0,0"
    mixer_device        "default"
    mixer_control        "Master"
    options             "dev=dmixer"
}

I know I had Pulseaudio installed but I uninstalled it later after I realized that I actually don't need it. Now I think it could be maybe somehow connected to my problems. I still have packages installed but I don't really know if they could be error sources and I don't even know how to uninstall them without deleting other packages.

pacman -Qs pulse
local/libao 1.2.0-1
    Cross-platform audio output library and plugins
local/libcanberra-pulse 0.30-4
    PulseAudio plugin for libcanberra
local/libpulse 5.0-1
    A featureful, general-purpose sound server (client library)
local/pavucontrol 2.0-2
    A GTK volume control for PulseAudio

Could someone please help me?

Last edited by Dun (2015-01-08 21:41:52)

Offline

#2 2015-01-07 18:06:35

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: [SOLVED]ALSA configuration

pcm.SB {
	type hw
	card 0
}

ctl.SB {
	type hw           
	card 0
}

That's your problem right there. Should be something like:

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

If you want a crappy script to automate it: https://raw.githubusercontent.com/AladW … r/defsound

Last edited by Alad (2015-01-07 18:07:16)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#3 2015-01-07 18:09:49

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]ALSA configuration

I don't think aplay can play mp3s.

Your asoundrc might be the problem. See the red box at https://wiki.archlinux.org/index.php/Al … ive_method.

Read up on dmix/troubleshooting simultaneous playback problems in the wiki. https://wiki.archlinux.org/index.php/Alsa#Dmix https://wiki.archlinux.org/index.php/Al … k_problems

Last edited by lucke (2015-01-07 18:10:14)

Offline

#4 2015-01-07 18:50:51

Dun
Member
Registered: 2014-12-28
Posts: 98

Re: [SOLVED]ALSA configuration

Alad wrote:
pcm.SB {
	type hw
	card 0
}

ctl.SB {
	type hw           
	card 0
}

That's your problem right there. Should be something like:

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

Do you mean like this?

defaults.pcm.SB {

or this?

pcm.!card 0 {
lucke wrote:

I don't think aplay can play mp3s.

Ah ok, thanks smile

lucke wrote:

Your asoundrc might be the problem. See the red box at https://wiki.archlinux.org/index.php/Al … ive_method.

No wonder why I didn't see this "red (#ffdddd) box". I will try it tomorrow again, today I'm done with this :>

Thank you very much for the help guys!

Edit: Oh I just had low contrast on my second screen, #ffdddd is fine. I solved the problem as well.
I set the default sound card.
/etc/modprobe.d/alsa-base.conf

options snd_mia index=0
options snd_hda_intel index=1

And added this to ~/.asoundconf

pcm.!default {
    type plug
    slave.pcm "dmixer"
}

pcm.dmixer  {
     type dmix
     ipc_key 1024
     slave {
        pcm "hw:1,0"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 44100
    }
    bindings {
        0 0
        1 1
    }
}

ctl.dmixer {
    type hw
    card 0
}

Now it looks like this.

$ fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/pcmC1D0p:   dun         567 F...m chromium
                     dun        2229 F...m mplayer
/dev/snd/timer:      dun         567 f.... chromium
                     dun        2229 f.... mplayer

I still don't really know what I pasted there but I have not that much time for audio. Maybe later this year smile

Last edited by Dun (2015-01-07 20:25:43)

Offline

Board footer

Powered by FluxBB