Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
alsa not working properly - SOLVED
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2365
Location: Kentucky

PostPosted: Sun Mar 31, 2024 7:52 pm    Post subject: alsa not working properly - SOLVED Reply with quote

I have just rebuilt the software on my laptop. I started with a brand new blank SSD and went thru the installation procedure outlined in the handbook, including building a 6.6.13-gentoo kernel. This was followed by copying all my data files from my backup server onto the new laptop system SSD.

I now have everything working except for my sound. I had been using alsamixer as my sound control panel, mostly just as a volume control. I run it in a xterm. After emerging alsamixer, I am able to run it as root, but not as a user. Seems the perms on my sound device are not allowing write to a general user. My suspicion is that I need to make my username belong to some groupt to allow me to access the sound hardware.

But even when I run alsamixer successfully as root, I cnnot get mpg123 to play a *.mpg sound track. I even tried running mpg123 as root, and it still won't work.

Here is the sound hardware:
Code:

onesimus ~ # ls -l /dev/audio1
crw-rw-r-- 1 root audio 14, 20 Mar 30 19:47 /dev/audio1
onesimus ~ #


Here is what I get running mpg123 as my normal username:
Code:

rj@onesimus ~/KJV $ mpg123 19Psa150.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.32.3; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes


Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: 19Psa150.mp3 ...
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/pcm/pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM default
[src/libout123/modules/sdl.c:open_sdl():122] error: Couldn't open SDL audio: ALSA: Couldn't open audio device: No such file or directory

main: [/var/tmp/portage/media-sound/mpg123-base-1.32.3/work/mpg123-1.32.3/src/mpg123.c:check_fatal_output():337] error: out123 error 7: failed to open device
rj@onesimus ~/KJV $


And here is running as root:
Code:

onesimus /home/rj/KJV # mpg123 19Psa150.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.32.3; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes
Segmentation fault
onesimus /home/rj/KJV #


Any idea what I am doing wrong? This used to work fine before the software rebuild. Could I be missing a configuration file somewhare? If so, it should be on my backup server, so it is easy to copy it over.
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.


Last edited by Moriah on Sun Apr 14, 2024 1:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Mon Apr 01, 2024 2:10 am    Post subject: Reply with quote

Did you have asoundrc files (`.asoundrc` or `asound.conf`) for your hardware? In general they're not necessarily needed, but might be required for some hardware or configurations, so perhaps check your backups for those?
Back to top
View user's profile Send private message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2365
Location: Kentucky

PostPosted: Tue Apr 02, 2024 5:51 pm    Post subject: Reply with quote

Thanks for the tip on /etc/asound.conf; that made a difference, but I still can't run audio as a normal user.

It is obviously some kind of filke permission problem in /dev because I can play mpg123 when I am root, but not when I am my normal user.

Here is what I get when I try to run mpg123 as a normal user:
Code:

rj@onesimus ~/KJV $ mpg123 19Psa150.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.32.3; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes


Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: 19Psa150.mp3 ...
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:855:(parse_card) cannot find card '1'
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/pcm/pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM default
[src/libout123/modules/sdl.c:open_sdl():122] error: Couldn't open SDL audio: ALSA: Couldn't open audio device: No such file or directory

main: [/var/tmp/portage/media-sound/mpg123-base-1.32.3/work/mpg123-1.32.3/src/mpg123.c:check_fatal_output():337] error: out123 error 7: failed to open device
rj@onesimus ~/KJV $

and here is what I get when I try to run alsamixer as a notmal user:
Code:

rj@onesimus ~/KJV $ alsamixer
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:855:(parse_card) cannot find card '1'
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/control/control.c:1570:(snd_ctl_open_noupdate) Invalid CTL default
cannot open mixer: No such file or directory
rj@onesimus ~/KJV $


Since I only have one normal non-root user on this laptop, I would prefer not to have to use group permissions, but just allow any user to access the audio devices.

What devices do I need besides these:
Code:

rj@onesimus ~/KJV $ ls -l /dev/aud* /dev/mixer*
crw-rw-rw- 1 root audio 14, 20 Mar 30 19:47 /dev/audio1
crw-rw-rw- 1 root audio 14,  0 Mar 30 19:47 /dev/mixer
crw-rw-rw- 1 root audio 14, 16 Mar 30 19:47 /dev/mixer1
crw-rw-rw- 1 root audio 14, 32 Mar 30 19:47 /dev/mixer2
rj@onesimus ~/KJV $

As you can see, I have already allowed any user to read and wite these devices.
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21650

PostPosted: Tue Apr 02, 2024 6:11 pm    Post subject: Reply with quote

I am not convinced that this is a permissions problem, since it references failure to find a resource, rather than a permissions error.

When you copied from backup, did you also copy over ~/.asoundrc? That file may not be correct for new hardware, and might be configuring ALSA not to work. If so, root would work, since it would look at /root/.asoundrc, and I am suggesting that only ~rj/.asoundrc exists and is bad.
Back to top
View user's profile Send private message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2365
Location: Kentucky

PostPosted: Tue Apr 02, 2024 7:11 pm    Post subject: Reply with quote

This is not new hardware; it is exactly the same hardware that used to work before the kernel upgrade. There is no .asoundrc and there is no backup of that file in my normal user account home directory. Neither is there any .asoundrc in /root. It started to work for playback with mpg123 for root when I copied /etc/asound.conf from backup.

So if it works for root, and nobody ever has any .asoundrc file, then all it knows is from /etc/asound.conf and my normal user would see that also.

Are there any other file, whether in /dev or elsewhere, that are needed to playback with mpg123 or to execute alsamixer?
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Wed Apr 03, 2024 12:47 am    Post subject: Reply with quote

Moriah wrote:
Are there any other file, whether in /dev or elsewhere, that are needed to playback with mpg123 or to execute alsamixer?

i'm not familiar enough with mpg123 to know, but you could try running it with strace(1), e.g.:

Code:
$ strace -e open,openat /usr/bin/mpg123 19Psa150.mp3 2>&1 | less

and examining what mpg123 is trying to open, and any related errors.
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2575
Location: Here and Away Again

PostPosted: Wed Apr 03, 2024 6:11 am    Post subject: Reply with quote

Moriah wrote:
It started to work for playback with mpg123 for root when I copied /etc/asound.conf from backup.

So if it works for root, and nobody ever has any .asoundrc file, then all it knows is from /etc/asound.conf and my normal user would see that also.

Just to be sure, /can/ the normal user actually see and read it as well?
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2365
Location: Kentucky

PostPosted: Wed Apr 03, 2024 6:44 pm    Post subject: Reply with quote

yes, my normal user can read /etc/asound.conf
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.
Back to top
View user's profile Send private message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2365
Location: Kentucky

PostPosted: Sun Apr 14, 2024 1:21 pm    Post subject: Reply with quote

Had to go out of town unexpectedly; sorry for the delay in posting, but:

THE PROBLEM IS SOLVED !!! :D

I had to put my username in the audio group in .etc/group; that's all it took.
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum