Bug 177660 - (illeta) ALSA device "default" had an error
ALSA device "default" had an error
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: alsa-lib (Show other bugs)
4
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Martin Stransky
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-12 13:28 EST by Juan segura
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-31 03:43:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
root-etc-alsa-pcm files (9.95 KB, application/x-zip-compressed)
2006-01-17 10:57 EST, Hugh Sparks
no flags Details
user-etc-alsa-pcm files (9.95 KB, application/x-zip-compressed)
2006-01-17 10:58 EST, Hugh Sparks
no flags Details

  None (edit)
Description Juan segura 2006-01-12 13:28:54 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051202 Fedora/1.5-0.fc4 Firefox/1.5

Description of problem:
when I try to configure sound system using ALSA, system returns:
"Sound server informational message:
Error while initializing the sound driver:
device: default can't be opened for playback (Invalid argument)
The sound server will continue, using the null output device."

Using OSS there are no problems and ALSA mixer works fine. But Totem video player do not works.

When I type  "#rpm -q alsa" system returns: "package alsa is not installed" 

Version-Release number of selected component (if applicable):
kernel-2.6.11-1.1369_FC4

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.
  

Additional info:
Comment 1 Martin Stransky 2006-01-13 05:45:36 EST
Can you check "$aplay /usr/share/sounds/phone.wav" ?
Comment 2 Juan segura 2006-01-13 11:56:18 EST
[root@fedora2 ~]# aplay /usr/share/sounds/phone.wav
ALSA lib conf.c:1592:(snd_config_load1) _toplevel_:51:23:No existe el fichero o
                                           el directorio
ALSA lib conf.c:2837:(snd_config_hook_load) /etc/alsa/cards/aliases.conf may be
                                           old or corrupted: consider to remove
or fix it
ALSA lib conf.c:2700:(snd_config_hooks_call) function snd_config_hook_load retur
                                          ned error: No existe el fichero o el
directorio
ALSA lib pcm.c:1969:(snd_pcm_open_conf) Invalid type for PCM default definition
                                           (id: default, value: cards.pcm.default)
aplay: main:544: audio open error: Argumento inválido
Comment 3 Martin Stransky 2006-01-15 01:43:47 EST
Please login as a common user (no root) and check it again.
Comment 4 Hugh Sparks 2006-01-15 03:01:38 EST
I have identical results running aplay
as root or as a regular user.

Versions:

   kernel 2.6.14-1.1656_FC4
   arts-1.5.0-0.2.fc4
   alsa-utils-1.0.10-1.FC4
   alsa-lib-devel-1.0.10-2.FC4
   alsa-lib-1.0.10-2.FC4

Results from aplay: (root or user)

***************************
aplay pop.wav
ALSA lib conf.c:1592:(snd_config_load1) _toplevel_:51:23:No such file or 
directory
ALSA lib conf.c:2837:(snd_config_hook_load) /etc/alsa/cards/aliases.conf may be 
old or corrupted: consider to remove or fix it
ALSA lib conf.c:2700:(snd_config_hooks_call) function snd_config_hook_load 
returned error: No such file or directory
ALSA lib pcm.c:1969:(snd_pcm_open_conf) Invalid type for PCM default definition 
(id: default, value: cards.pcm.default)
aplay: main:544: audio open error: Invalid argument

*******************

I believe the alsa system was damaged by a fairly
recent use of up2date.

Running as root, I ran these commands:

    ainit root stop
    ainit root start

After that, aplay worked normally and I was
able to configure alsa as the kde sound handler.
Alsa sound contined to work normally after a reboot.

Alsa sound does not work when running as a regular
user. I get these messages:

************************
aplay pop.wav
ALSA lib confmisc.c:672:(snd_func_card_driver) cannot find card '0'
ALSA lib conf.c:3493:(_snd_config_evaluate) function snd_func_card_driver 
returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3493:(_snd_config_evaluate) function snd_func_concat returned 
error: No such device
ALSA lib confmisc.c:1072:(snd_func_refer) error evaluating name
ALSA lib conf.c:3493:(_snd_config_evaluate) function snd_func_refer returned 
error: No such device
ALSA lib conf.c:3962:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2099:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:544: audio open error: No such device

***************

I tried:

    chmod go+rw /dev/dsp /dev/mixer /dev/audio

Ordinary users still can't use sound. The error
messages are the same as listed above.


Comment 5 Martin Stransky 2006-01-16 04:17:02 EST
Please check the latest update for FC4 (alsa-lib-1.0.10-3.FC4). It should be
available tomorrow.
Comment 6 Hugh Sparks 2006-01-16 23:23:39 EST
I installed the alsa-lib update to 1.0.10-3.
There was no update for alsa-utils.

I rebooted just for good measure.

Now "aplay" on any audio file produces a hail
of loud (white? pink?) noise - it is totally broken.
Destroyed might be the right word.

I tried this running as root and as a regular user.
My ears hurt.

Low(er) level sound tools still work fine:
mpg123 works perfectly and so does OSS in kde.

I logged into kde as an ordinary user (with alsa
configured as the sound hander) and got this error
message in a window:

    Informational - artsmessage

    Sound server informational message:
    Error while initializing the sound driver:
    device: default can't be opened for playback (No such device)
    The sound server will continue, using the null output device.

Then I went to the kde control center and changed the output
hardware to OSS. At that point, sound worked again. (This does
require /dev/dsp to be a+rw.)

Ah! Here is an interesting result: Running as
root, I ran Amarok and it played an mp3 perfectly.
It is using the arts engine. I had alsa selected as
the kde sound handler. Using ps, I see
that artsd is routing through alsa and apparently
working...

So it looks like aplay (alsa-utils) needs an update?
And something is broken with the permissions
so that a non-root user can't use alsa.
Could this be a pam weirdness?

This is pretty much where we were with Juan Segura's
original report. Except now aplay itself is broken.

...
Comment 7 Martin Stransky 2006-01-17 03:07:12 EST
I believe aplay is fine and there is a problem with ALSA config files in
/etc/alsa/pcm. Could you please attach these files? There is a difference when
you're logged as root and as a common user, so I need these files from both
situations.
Comment 8 Hugh Sparks 2006-01-17 10:57:20 EST
Created attachment 123301 [details]
root-etc-alsa-pcm files
Comment 9 Hugh Sparks 2006-01-17 10:58:17 EST
Created attachment 123302 [details]
user-etc-alsa-pcm files
Comment 10 Hugh Sparks 2006-01-17 11:02:07 EST
Above you will find attachments for my /etc/alsa/pcm
files running as root and as a user.

Here is another interesting result:
Logged into kde as root, I can configure alsa
sound and the Test button plays a sound correctly.
I found that aplay will also correctly play a .wav
file. But .ogg or .mp3 files produce the white noise.

Users cannot even configure alsa sound, so this can't
be tested in a user account.
Comment 11 Juan segura 2006-01-17 11:58:48 EST
(In reply to comment #3)
> Please login as a common user (no root) and check it again.
O.K. I did do that and results are as following:
"[juan@fedora2 ~]$ aplay /usr/share/sounds/phone.wav
ALSA lib conf.c:1592:(snd_config_load1) _toplevel_:51:23:No existe el fichero o
el directorio
ALSA lib conf.c:2837:(snd_config_hook_load) /etc/alsa/cards/aliases.conf may be
old or corrupted: consider to remove or fix it
ALSA lib conf.c:2700:(snd_config_hooks_call) function snd_config_hook_load
returned error: No existe el fichero o el directorio
ALSA lib pcm.c:1969:(snd_pcm_open_conf) Invalid type for PCM default definition
(id: default, value: cards.pcm.default)
aplay: main:544: audio open error: Argumento inválido"
(In reply to comment #3)
> Please login as a common user (no root) and check it again.

Comment 12 Juan segura 2006-01-17 12:17:48 EST
(In reply to comment #7)
> I believe aplay is fine and there is a problem with ALSA config files in
> /etc/alsa/pcm. Could you please attach these files? There is a difference when
> you're logged as root and as a common user, so I need these files from both
> situations.
Sorry yesterday was a hard day of work. Aplay from normal user gives the same
result as root:
"[juan@fedora2 ~]$ aplay /usr/share/sounds/phone.wav
ALSA lib conf.c:1592:(snd_config_load1) _toplevel_:51:23:No existe el fichero o
el directorio
ALSA lib conf.c:2837:(snd_config_hook_load) /etc/alsa/cards/aliases.conf may be
old or corrupted: consider to remove or fix it
ALSA lib conf.c:2700:(snd_config_hooks_call) function snd_config_hook_load
returned error: No existe el fichero o el directorio
ALSA lib pcm.c:1969:(snd_pcm_open_conf) Invalid type for PCM default definition
(id: default, value: cards.pcm.default)
aplay: main:544: audio open error: Argumento inválido"

*******************************************************
Opening sesion as normal user system advice :
"Sound server informational message:
Error while initializing the sound driver:
device /dev/dsp can't be opened (Permission denied)
The sound server will continue, using the null output device."

****************************************************************

Device is an integrated chip set VIA on Asrock motherboard as follows:

VIA Technologies Inc VT8233/A/8235/8237 AC 97 Audio Controller.

****************************************************************

I had received other mail indicating that I must look for new updates on red-hat
I will do that if you are agree; perhaps you prefer analyze first this bug.  ¿?!
Thanks for your time. Tomorrow will be another day of work. See you on thursday
19. Good luck ! Illeta.

Comment 13 Juan segura 2006-01-17 12:36:00 EST
(In reply to comment #3)
> Please login as a common user (no root) and check it again.

(In reply to comment #12)
> (In reply to comment #7)
> > I believe aplay is fine and there is a problem with ALSA config files in
> > /etc/alsa/pcm. Could you please attach these files? There is a difference when
> > you're logged as root and as a common user, so I need these files from both
> > situations.
> Sorry yesterday was a hard day of work. Aplay from normal user gives the same
> result as root:
> "[juan@fedora2 ~]$ aplay /usr/share/sounds/phone.wav
> ALSA lib conf.c:1592:(snd_config_load1) _toplevel_:51:23:No existe el fichero o
> el directorio
> ALSA lib conf.c:2837:(snd_config_hook_load) /etc/alsa/cards/aliases.conf may be
> old or corrupted: consider to remove or fix it
> ALSA lib conf.c:2700:(snd_config_hooks_call) function snd_config_hook_load
> returned error: No existe el fichero o el directorio
> ALSA lib pcm.c:1969:(snd_pcm_open_conf) Invalid type for PCM default definition
> (id: default, value: cards.pcm.default)
> aplay: main:544: audio open error: Argumento inválido"
> 
> *******************************************************
> Opening sesion as normal user system advice :
> "Sound server informational message:
> Error while initializing the sound driver:
> device /dev/dsp can't be opened (Permission denied)
> The sound server will continue, using the null output device."
> 
> ****************************************************************
> 
> Device is an integrated chip set VIA on Asrock motherboard as follows:
> 
> VIA Technologies Inc VT8233/A/8235/8237 AC 97 Audio Controller.
> 
> ****************************************************************
> 
> I had received other mail indicating that I must look for new updates on red-hat
> I will do that if you are agree; perhaps you prefer analyze first this bug.  ¿?!
> Thanks for your time. Tomorrow will be another day of work. See you on thursday
> 19. Good luck ! Illeta.
*************************************************************

wow wow wow !!!! I have charged your attached files on ALSA PCM folder and seems
 all is working fine !  I shal try and will close query bug. Thankyou very much.
Excuse me I am reading and answering sequentialy your demands.
> 
> 

Comment 14 Hugh Sparks 2006-01-17 18:56:01 EST
Mr. Segura: I believe you mistook my /etc/alsa files
uploaded for debugging as a proposed fix. But it seems
they work better for you than for me!

I was only trying to help while you were away.
I have the same bug that you reported.
Martin Stransky is trying to help both of us.
Sorry to get in the way.

-Hugh Sparks


Comment 15 Martin Stransky 2006-01-18 08:05:20 EST
(In reply to comment #9)
> Created an attachment (id=123302) [edit]
> user-etc-alsa-pcm files
> 

You have old config files and it could be a problem. Please remove all alsa
packages what you have installed (I suppose they're alsa-lib and alsa-utils) and
install the latest packages (alsa-lib-1.0.10-3.FC4, alsa-utils-1.0.10-1.FC4) again. 

Then your /etc/alsa/pcm should contain proper files. If sound doesn't work after
that please attach files from /etc/alsa/pcm again.

This action should work for Mr. Juan Segura too. I'll have to update s-c-s
utility soon it'll handle situation like this.
Comment 16 Hugh Sparks 2006-01-18 11:23:49 EST
Ok.

    rpm --nodeps -ef alsa-utils alsa-lib alsa-lib-devel
    rm  -rf /etc/alsa
    rpm -i alsa-utils-1.0.10-1.FC4.i386.rpm
    rpm -i alsa-lib-1.0.10-3.FC4.i386.rpm
    rpm -i alsa-lib-devel-1.0.10-3.FC4.i386.rpm

I rebooted for luck. (Starting to act like
windows...) All the symptoms remain the same:

Here is something important:
The aplay command is not supposed to be able
to play .ogg or .mp3, so the white noise thing
is perfectly normal. Aplay does work for root,
so it is ok.

The really issue is end-users not being able
to configure alsa sound in kde.

1) Root can configure alsa in kde.
2) Doing "ps ax | grep artsd" shows that arts
   is connected to alsa. 
3) The Test button plays a nice sound.
4) Amorak plays all kinds of files perfectly
   and is configured to use arts.
5) Non-root users cannot configure alsa in kde.
6) Permissions on /dev/dsp are a+rw.
7) Non-root users can configure OSS and it works.

****************

When a user tries to configure alsa in kde they
get:

    Informational - artsmessage

    Sound server informational message:
    Error while initializing the sound driver:
    device: default can't be opened for playback (No such device)
    The sound server will continue, using the null output device.

************************






Comment 17 Martin Stransky 2006-01-18 11:31:26 EST
(In reply to comment #16)
What version of pam do you have and do you have the
/etc/security/console.handlers file? Could you attach this file?
Comment 18 Hugh Sparks 2006-01-18 14:03:42 EST
pam-0.79-9.6

    # [COMMENTS]
    console consoledevs tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
    /sbin/pam_console_apply lock logfail wait -t tty -s
    /sbin/pam_console_apply unlock logfail wait -r -t tty -s
    # initialize dmix for alsa sound
    /usr/bin/ainit lock user start
    /usr/bin/ainit unlock user stop

Here's something that might be important:
Both user and root logins are via remote 
secure (RSA) kdm sessions.
The machine with the sound issue is headless.



Comment 19 Juan segura 2006-01-19 12:18:00 EST
(In reply to comment #14)
> Mr. Segura: I believe you mistook my /etc/alsa files
> uploaded for debugging as a proposed fix. But it seems
> they work better for you than for me!
> 
> I was only trying to help while you were away.
> I have the same bug that you reported.
> Martin Stransky is trying to help both of us.
> Sorry to get in the way.
> 
> -Hugh Sparks
> 
> Hellow, it dos not matter, with your files my systen is running fine. (No hay
mal que por bien no venga !) Thankyou.
> 

Comment 20 Juan segura 2006-01-19 12:19:38 EST
(In reply to comment #19)
> (In reply to comment #14)
> > Mr. Segura: I believe you mistook my /etc/alsa files
> > uploaded for debugging as a proposed fix. But it seems
> > they work better for you than for me!
> > 
> > I was only trying to help while you were away.
> > I have the same bug that you reported.
> > Martin Stransky is trying to help both of us.
> > Sorry to get in the way.
> > 
> > -Hugh Sparks
> > 
> > Hellow, it does not matter, with your files my systen is running fine. (No hay
> mal que por bien no venga !) Thankyou.
> > 
> 
> 

Comment 21 Juan segura 2006-01-19 12:21:34 EST
(In reply to comment #20)
> (In reply to comment #19)
> > (In reply to comment #14)
> > > Mr. Segura: I believe you mistook my /etc/alsa files
> > > uploaded for debugging as a proposed fix. But it seems
> > > they work better for you than for me!
> > > 
> > > I was only trying to help while you were away.
> > > I have the same bug that you reported.
> > > Martin Stransky is trying to help both of us.
> > > Sorry to get in the way.
> > > 
> > > -Hugh Sparks
> > > 
> > > Hellow, it does not matter, with your files my system is running fine. (No hay
> > mal que por bien no venga !) Thankyou.
> > > 
> > Juan Segura.
> > 
> 
> 

Comment 22 Juan segura 2006-01-19 12:31:06 EST
To Mr.Stransky. Hellow, my ALSA is running o.k. only changin pcm files attached
by Mr Hugh. You see ! Totem don'works now I think owing missing codecs, and
common user cannot make use of ALSA but I understand that these  are other
problems. I am  learnning linux and must study more before. By me you can
consider closed the matter. Thankyou very much an best regards.
Comment 23 Martin Stransky 2006-01-23 10:19:56 EST
(In reply to comment #18)
> Here's something that might be important:
> Both user and root logins are via remote 
> secure (RSA) kdm sessions.
> The machine with the sound issue is headless.

Yes, it's the problem. If you're logged in via remote shell but not also locally
logged in, you can't play any sound. It's because you don't have the "console
lock" and you don't have rights for sound card. In this case you have to use the
root account.
Comment 24 Martin Stransky 2006-01-23 10:22:34 EST
(In reply to comment #22)
> To Mr.Stransky. Hellow, my ALSA is running o.k. only changin pcm files attached
> by Mr Hugh.

These files should be here after update to alsa-lib-1.0.10-3.FC4...

Comment 25 Hugh Sparks 2006-01-23 16:38:20 EST
Thanks! I am satisfied.

But when I made the /dev/dsp a+rw, shouldn't that
have enabled a user to play sound?  The user <can>
play sound with non-alsa tools...

If a user is logged in locally, should they be able
to play sound even if /dev/dsp is rw for root only?

Thanks, 

-Hugh Sparks
Comment 26 Martin Stransky 2006-01-24 03:36:35 EST
(In reply to comment #25)

> But when I made the /dev/dsp a+rw, shouldn't that
> have enabled a user to play sound?  The user <can>
> play sound with non-alsa tools...

/dev/dsp is only OSS interface for ALSA (emulation layer). Pure ALSA
applications use files in /dev/snd/
 
> If a user is logged in locally, should they be able
> to play sound even if /dev/dsp is rw for root only?

/dev/dsp* should have non-root attributes after login too.
Comment 27 Hugh Sparks 2006-01-24 19:47:30 EST
Ah! Clearly I don't understand Alsa.
As an experiment, I set a+rw /dev/snd/*
Then I logged in (remotely) to a KDE desktop
session. The familiar messageappears:

   Informational - artsmessage

    Sound server informational message:
    Error while initializing the sound driver:
    device: default can't be opened for playback (No such device)
    The sound server will continue, using the null output device.


Your patience is remarkable.

To put my question more directly: What exactly should
be done to enable an ordinary user to have sound when
logged into a server via a remote X session?

Thanks,

HS.
Comment 28 Martin Stransky 2006-01-30 05:36:44 EST
You can check the pam_console_apply script. You have to create the
"/var/run/console/console.lock" and "/var/run/console/<username>" files and then
you can run the pam_console_apply script. More info is in man-page...
Comment 29 Hugh Sparks 2006-01-30 12:11:19 EST
Thanks!

This issue is closed as far as I'm concerned.
Comment 30 Martin Stransky 2006-01-31 03:43:40 EST
okay, closing...

Note You need to log in before you can comment on or make changes to this bug.