You are not logged in.

#1 2011-03-19 17:40:26

drahnr
Member
Registered: 2011-03-14
Posts: 73

[SOLVED] Alsa for root, but not for any other user

I just set up Arch Linux on my workbox. It all went fine till to the point of sound, where I seem to get stuck by now. I can mplayer play audio fles from root, but from nowhere else, aplay refuses to work at all, but read more ... ↓here↓below↓

I tested mplayer and aplay:

Results of aplay as root or user, no matter:

# aplay /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1065: Channels count non available
mplayer

gives me sound when run as root - but not as regular user.

speaker-test -c 2

gives me noise on my speakers (I hope the noise is intended, but AFAIK it is)

# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: SB [HDA ATI SB], device 0: ALC888 Analog [ALC888 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 1: ALC888 Digital [ALC888 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

As you see, device 0 is a USB webcam with integrate mic, SB is the one from which I want to squeeze some noise

# cat /proc/asound/cards
 0 [U0x46d0x809    ]: USB-Audio - USB Device 0x46d:0x809
                      USB Device 0x46d:0x809 at usb-0000:00:12.2-3, high speed
 1 [SB             ]: HDA-Intel - HDA ATI SB
                      HDA ATI SB at 0xfe024000 irq 16
 2 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfbffc000 irq 19
# cat /etc/asound.conf 
pcm.!default  {
    type hw
    card SB
}
ctl.!default {
    type hw
    card SB
}

I installed these packages:

alsa-lib
alsa-utils
# lsmod | grep 'snd'
snd_hda_codec_hdmi     22857  4 
snd_seq_dummy           1479  0 
snd_seq_oss            29240  0 
snd_seq_midi_event      5516  1 snd_seq_oss
snd_seq                50562  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss            39509  0 
snd_hda_codec_realtek   295685  1 
snd_mixer_oss          17730  1 snd_pcm_oss
snd_hda_intel          21837  0 
snd_hda_codec          74609  3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
snd_usb_audio          87447  0 
snd_hwdep               6222  2 snd_hda_codec,snd_usb_audio
snd_usbmidi_lib        18516  1 snd_usb_audio
snd_pcm                72321  5 snd_hda_codec_hdmi,snd_pcm_oss,snd_hda_intel,snd_hda_codec,snd_usb_audio
snd_rawmidi            19525  1 snd_usbmidi_lib
snd_timer              19537  2 snd_seq,snd_pcm
snd_seq_device          5281  4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd                    58906  15 snd_hda_codec_hdmi,snd_seq_oss,snd_seq,snd_pcm_oss,snd_hda_codec_realtek,snd_mixer_oss,snd_hda_intel,snd_hda_codec,snd_usb_audio,snd_hwdep,snd_usbmidi_lib,snd_pcm,snd_rawmidi,snd_timer,snd_seq_device
snd_page_alloc          7361  2 snd_hda_intel,snd_pcm
soundcore               6161  1 snd
usbcore               139240  9 uvcvideo,snd_usb_audio,snd_usbmidi_lib,usbhid,usb_storage,xhci_hcd,ohci_hcd,ehci_hcd
# ls -l /dev/snd/
total 0
drwxr-xr-x 2 root root       60 Mar 19 18:07 by-id
drwxr-xr-x 2 root root      100 Mar 19 18:07 by-path
crw-rw---- 1 root audio 116,  4 Mar 19 18:07 controlC0
crw-rw---- 1 root audio 116, 11 Mar 19 18:07 controlC1
crw-rw---- 1 root audio 116, 21 Mar 19 18:07 controlC2
crw-rw---- 1 root audio 116, 10 Mar 19 18:07 hwC1D0
crw-rw---- 1 root audio 116, 20 Mar 19 18:07 hwC2D0
crw-rw---- 1 root audio 116, 19 Mar 19 18:07 hwC2D1
crw-rw---- 1 root audio 116, 18 Mar 19 18:07 hwC2D2
crw-rw---- 1 root audio 116, 17 Mar 19 18:07 hwC2D3
crw-rw---- 1 root audio 116,  3 Mar 19 18:07 pcmC0D0c
crw-rw---- 1 root audio 116,  9 Mar 19 18:07 pcmC1D0c
crw-rw---- 1 root audio 116,  8 Mar 19 18:07 pcmC1D0p
crw-rw---- 1 root audio 116,  7 Mar 19 18:07 pcmC1D1c
crw-rw---- 1 root audio 116,  6 Mar 19 18:07 pcmC1D1p
crw-rw---- 1 root audio 116,  5 Mar 19 18:07 pcmC1D2c
crw-rw---- 1 root audio 116, 16 Mar 19 18:07 pcmC2D3p
crw-rw---- 1 root audio 116, 15 Mar 19 18:07 pcmC2D7p
crw-rw---- 1 root audio 116, 14 Mar 19 18:07 pcmC2D8p
crw-rw---- 1 root audio 116, 13 Mar 19 18:07 pcmC2D9p
crw-rw---- 1 root audio 116, 12 Mar 19 18:07 seq
crw-rw---- 1 root audio 116,  2 Mar 19 18:07 timer

Maybe some of the gurus can give me a hint... I am out of options. I re-read the alsa tutorial multiple times.

The only interesting thing may be the fact that root is _not_ within the audiogroup but my user "dummy" is in the audio group.

Thanks for any help, tipps and ofc - stabbing in the dark smile

Last edited by drahnr (2011-03-20 17:07:14)

Offline

#2 2011-03-19 17:42:42

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: [SOLVED] Alsa for root, but not for any other user

Did you logout/login after adding yourself to the audio group?

Offline

#3 2011-03-19 17:43:56

drahnr
Member
Registered: 2011-03-14
Posts: 73

Re: [SOLVED] Alsa for root, but not for any other user

I did not imediatly, but I did several times afterwards and also rebooted.

Edit: Oh damn... I did not test mplayer as regular user after reboot. That seems to have made a change.

Edit 2: aplay still fails hard with the above message whereas mplayer just plays it fine.

Last edited by drahnr (2011-03-19 17:48:21)

Offline

#4 2011-03-19 18:08:47

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: [SOLVED] Alsa for root, but not for any other user

drahnr wrote:

# cat /etc/asound.conf
pcm.!default  {
    type hw
    card SB
}
ctl.!default {
    type hw
    card SB
}

I don't think "card SB" is a correct way to do it.
It's possible your mplayer tried to output to a different card due to this.
Try this instead.
device 0 for analog, 1 for digital.

pcm.!default {
type hw
card 1
device 0
}
ctl.!default {
type hw
card 1
device 0
}

tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#5 2011-03-19 18:14:22

drahnr
Member
Registered: 2011-03-14
Posts: 73

Re: [SOLVED] Alsa for root, but not for any other user

From the germany archlinux alsa wiki page:

0 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                     HDA ATI HDMI at 0xfe9ec000 irq 19
1 [Bt878          ]: Bt87x - Brooktree Bt878
                     Brooktree Bt878 at 0xfdffe000, irq 21
2 [Audigy2        ]: Audigy2 - Audigy 4 [SB0610]
                     Audigy 4 [SB0610] (rev.0, serial:0x10211102) at 0xe800, irq 20
pcm.!default {
    type hw
    card Audigy2
}
ctl.!default {
    type hw
    card Audigy2
}

link: https://wiki.archlinux.de/title/Alsa
Edit:
So it should be possible to do it by device name, shouldn't it?

Edit 2: Pidgin sound works also, I guess the only question left open is why aplay fails hard.

Last edited by drahnr (2011-03-19 18:19:48)

Offline

#6 2011-03-19 19:18:24

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: [SOLVED] Alsa for root, but not for any other user

OK, got it, read it a second times and I understand what you meant big_smile
So can you also have sound with firefox?
and error output of mplayer if possible.

Last edited by lives2evil (2011-03-19 19:21:34)


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#7 2011-03-19 20:33:39

drahnr
Member
Registered: 2011-03-14
Posts: 73

Re: [SOLVED] Alsa for root, but not for any other user

lives2evil wrote:

OK, got it, read it a second times and I understand what you meant big_smile
So can you also have sound with firefox?
and error output of mplayer if possible.

works:
firefox
pidgin
mplayer

works not:
aplay


for my daily usage it does work and the thread can be marked as solve, though I would be interested why aplay still keeps failing.. but maybe it is targeting the usb webcam mic for output - maybe.

Hint: Maybe editing and adding the hint to not only log out of [insert favorite DE] but also from tty*, I think this was my initial mistake and the reason why a reboot fixed my (main) issue.

Thanks for your help people smile

Offline

#8 2011-03-25 05:17:41

darenw
Member
From: Trego Montana
Registered: 2008-07-04
Posts: 106
Website

Re: [SOLVED] Alsa for root, but not for any other user

I had the exact same problem.   I think adding myself to the audio group is what fixed it, but can't be sure.  I wasn't bright enough to re-login, instead diddling with thirty other things to get audio to work.   Didn't want to shut down X and lose all my other apps up for half-done projects.  Then I discovered I can open an xterm (actually gnome-terminal, but that shouldn't matter) and do this: 

  bash>   login -

and then firefox, started from that xterm, had sound and all other wonderful things of audioesque nature worked.  That hyphen is vital.

Last edited by darenw (2011-03-25 05:19:52)


Artist/Physicist, Herder of Pixels, Photons and Electrons

Offline

Board footer

Powered by FluxBB