LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 12.2: Alsa sound works for root but not for user. (https://www.linuxquestions.org/questions/slackware-14/slackware-12-2-alsa-sound-works-for-root-but-not-for-user-722386/)

mcody 04-28-2009 10:24 PM

Slackware 12.2: Alsa sound works for root but not for user.
 
Greetings,

I am about to pull my hair out of my head with getting sound to work in my user account. It works fine in the root account, though. I just installed Slackware 12.2 (kernel 2.6.27.7-smp) on an ECS K7VTA3 v8.0 with an AMD Athlon(tm) XP 2700+ processor. Previously, I was running Slackware 10.2 with the stock 2.4 kernel. Alsa sound worked perfectly with the VIA VT82xx Audio Controller module (snd-via82xx). All I had to do then was change some permissions on some device files (/dev/audio*, /dev/dsp*, /dev/mixer*, etc) and sound just worked.

Now that I have installed Slackware 12.2, I have tried everything to get it to work in my user account with (almost) no success (It did work briefly once by running alsaconf in a Konsole after running "su"). I'm running KDE 3.5 and checked to make sure that the sound system is turned on. It certainly works under root in any case. I made sure that my user account shows up in the appropriate groups. The groups command yields the list "users floppy audio video cdrom plugdev". I checked to make sure that the appropriate audio outputs are unmuted and at the proper levels, using the alsamixer.

I, frankly, don't know what to do with the devices created by udev. I do note that /dev/adsp, /dev/audio, /dev/dsp, /dev/mixer, and the files in /dev/snd all belong to the audio group. With my user account belonging to the audio group, I should be able to control them, right?

I have checked that /etc/rc.d/rc.alsa is readable and executable by my user account. I have verified that the appropriate modules are loaded. This is how they appear when logged in as root as well as in my user account.

snd_seq_dummy 6788 0
snd_seq_oss 33408 0
snd_seq_midi_event 10240 1 snd_seq_oss
snd_seq 50928 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss 40480 0
snd_mixer_oss 17920 1 snd_pcm_oss
snd_via82xx 27160 2
gameport 14220 1 snd_via82xx
snd_ac97_codec 101412 1 snd_via82xx
ac97_bus 5632 1 snd_ac97_codec
snd_pcm 70788 4 snd_pcm_oss,snd_via82xx,snd_ac97_codec
snd_timer 23176 2 snd_seq,snd_pcm
snd_page_alloc 11400 2 snd_via82xx,snd_pcm
snd_mpu401_uart 10624 1 snd_via82xx
snd_rawmidi 22688 1 snd_mpu401_uart
snd_seq_device 10380 4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd 51748 14 snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_via82xx,snd_ac97_codec,snd_pcm,snd_timer,snd_mpu40 1_uart,snd_rawmidi,snd_seq_device
soundcore 10080 1 snd

As mentioned before, sound works in the root account but not in my user account.

Does anyone have any idea what I may be missing? I would appreciate any help. I have done extensive Google searches and read many threads, how-tos, and documents on udev without finding a useful solution. Posting here is my last resort.

As a final comment, I have always been annoyed that Slackware has always required tweaking with device files to get sound to work. I know that it is difficult to try to support all of the sound cards that are out there. At least by the time I was using Slackware 10.2, it became pretty routine what needed to be done. With the advent of udev, getting sound to work has become a great mystery again. The fact that I can get working sound as root seems to indicate that the solution is simple, but well hidden.

Thanks,

Mac

fotoguy 04-29-2009 04:58 AM

Sounds like it must be a permission problem somewhere if it works fine for root but not the normal user and you have added to the right groups. What are the permission settings for the /dev directory eg. 755 744.

mRgOBLIN 04-29-2009 05:10 AM

If you modify the groups for the user then have to log out and back in before they take effect.

Really it should be enough that they belong to the audio group and run alsamixer as the user to be sure that nothing is muted.

onebuck 04-29-2009 07:55 AM

Hi,
Quote:

Originally Posted by mcody (Post 3524262)
<snip>
As a final comment, I have always been annoyed that Slackware has always required tweaking with device files to get sound to work. I know that it is difficult to try to support all of the sound cards that are out there. At least by the time I was using Slackware 10.2, it became pretty routine what needed to be done. With the advent of udev, getting sound to work has become a great mystery again. The fact that I can get working sound as root seems to indicate that the solution is simple, but well hidden.

Thanks,

Mac

No mysteries, just do a search as this has been covered a lot here on LQ.

When you setup the sound as 'root' be sure to save your settings for the alsamixer with the command 'alsactl store'.

Read the 'man alsactl'. You could read the other 'man commands' related to 'alsa' online; alsamixer, alsaconf, alsactl.

BTW, you could read your 'man command' locally. :)

mcody 04-29-2009 09:22 PM

@ fotoguy
The permissions on the /dev directory are 755.

@ mRgOBLIN
I have logged out and rebooted several times since placing my user account in to the groups I listed.

@ onebuck
Quote:

Originally Posted by onebuck
No mysteries, just do a search as this has been covered a lot here on LQ.

I have searched LinuxQuestions and other sites for answers to my problems. I would not post a request for help without doing some research first.:study:

Quote:

Originally Posted by onebuck
When you setup the sound as 'root' be sure to save your settings for the alsamixer with the command 'alsactl store'.

I have done this from root and see the same settings in alsamixer from my user account. Still, I have no sound in my user account.

Quote:

Originally Posted by onebuck
Read the 'man alsactl'. You could read the other 'man commands' related to 'alsa' online; alsamixer, alsaconf, alsactl.

I have read these three man pages and programs without solving the problem. As I mentioned in my post:
Quote:

Originally Posted by mcody
I have done extensive Google searches and read many threads, how-tos, and documents on udev without finding a useful solution. Posting here is my last resort.

Okay, I failed to specifically mention the man pages.:rolleyes:

Quote:

Originally Posted by onebuck
BTW, you could read your 'man command' locally.

I've been using Linux for fifteen years. Most of those with various Slackware distributions. I know how to use the man pages.:)

samac 04-30-2009 02:59 AM

This may be a long shot, but kde sometimes causes problems with sound. Check the sound setting in your USERS control centre. I found once that the sound system was not enabled even though sound worked for root. I have also found that restarting /etc/rc.d/rc.alsa sometimes works, or as a last resort re-installing alsa, can sometimes help.

samac

fotoguy 04-30-2009 05:02 AM

Quote:

@ fotoguy
The permissions on the /dev directory are 755.
Ok looks like the permissions on the /dev directory are correct. Maybe one thing you could try is to add your user to all the groups through kuser, then try playing a file through a media player like xine, if you get no error, then you know it has to do with permissions of the groups. Then you could remove the user from one group at a time then play a file and see if the error returns, when it does then you've at least narrowed it down to the group responsible.

onebuck 04-30-2009 07:15 AM

Hi,
Quote:

Originally Posted by mcody (Post 3525309)
<snip>

I have read these three man pages and programs without solving the problem. As I mentioned in my post:

Okay, I failed to specifically mention the man pages.:rolleyes:

I've been using Linux for fifteen years. Most of those with various Slackware distributions. I know how to use the man pages.:)

Forgive me for attempting to lead you to possible answers. No where in your post(s) or sig do we see your 15 one year experiences.

Great that you know how to utilize the 'man command'. As a respondent I can't possibly know the level of experience a poster has. Sometimes we do see some experience via the type of post along with the information but we do try to assist everyone. If I stepped on your ego instead of your toe then 'sorry'.

Please remember that the post(s) and thread do benefit everyone, not just the OP. I look to provide detail along with the possible solution. In the future you could use the the next links to aid everyone;

hua 04-30-2009 11:17 AM

Maybe this experience won't help you... but I once had the same problem.
I was unable to get up my sound in user accounts, but when I started KDE as root it worked.
This time I tried to set up my default runlevel to 4, to boot it right into the X11.
When I set it back to 3, and after regular command prompt login I started KDE with startx... it worked.

If it's not usable for you, please ignore it ...

mcody 04-30-2009 11:18 PM

First off, thanks to all for the replies.

Quote:

Originally Posted by samac
This may be a long shot, but kde sometimes causes problems with sound. Check the sound setting in your USERS control centre. I found once that the sound system was not enabled even though sound worked for root. I have also found that restarting /etc/rc.d/rc.alsa sometimes works, or as a last resort re-installing alsa, can sometimes help.

I checked and adjusted the control center settings with no effect. I also tried restarting /etc/rc.d/rc.alsa with no effect. Lastly I uninstalled and reinstalled the Alsa packages, as well as the Simple Media Library and Libao. This didn't help either.

Quote:

Originally Posted by fotoguy
Ok looks like the permissions on the /dev directory are correct. Maybe one thing you could try is to add your user to all the groups through kuser, then try playing a file through a media player like xine, if you get no error, then you know it has to do with permissions of the groups. Then you could remove the user from one group at a time then play a file and see if the error returns, when it does then you've at least narrowed it down to the group responsible.

I tried playing an MP3 using Xine. Xine acted like it was playing the music, but there was no sound. I decided to take a "middle ground" approach, so I used kuser to add my user account to all the groups that root belongs to. I logged out and logged back in and verified that my user account was in all of those groups. Still no sound.

@onebuck
Hey, no bruised ego or toes here. Guess that's why I had a smiley face at the end of my comment. True, I could have mentioned my level of experience and I should have. I wan't thinking of a wider audience for this thread. I felt silly that I had forgotten to mention that I had looked at the man pages. That is why the emoticon was rolling its eyes, as in "oops!". I really do appreciate the help.

Quote:

Originally Posted by hua
Maybe this experience won't help you... but I once had the same problem. I was unable to get up my sound in user accounts, but when I started KDE as root it worked. This time I tried to set up my default runlevel to 4, to boot it right into the X11. When I set it back to 3, and after regular command prompt login I started KDE with startx... it worked.

If it's not usable for you, please ignore it ...

I thought it was a reasonable idea, so I gave it a shot. Alas, it did not work either.

Mac

mcody 05-01-2009 12:29 AM

Okay. Sound is working now. Here's how!
 
I found that with the VIA 8235 audio device, alsamixer and Kmix display four slider entries labeled "VIA DXS". The leftmost slider with this name appears to affect the volume for KDE sound events. The second slider controls audio volume for web-browser-based audio (e.g. YouTube, Vimeo). The third from left controls audio volume for music player apps (e.g. xine). I don't know what audio the forth slider controls, but I set its level up to maximum, like the others.

I only discovered this when I had my head close to the monitors speakers. I could faintly hear sound. I had un-muted everything, including the inputs (or what I thought were inputs) This caused me to revisit the controls on Kmix and start playing with all of the control settings.

The question now is why, when running under root, is the settings of these "VIA DXS" sliders ignored? I have no idea why.

All I have to take care of now is some crackling in the audio. I know that can probably be taken care of by an option setting of the snd_via82xx module.

Once again, thanks for all the help.

fotoguy 05-01-2009 02:07 AM

Good to hear some progress has been made

Quote:

All I have to take care of now is some crackling in the audio. I know that can probably be taken care of by an option setting of the snd_via82xx module.
Sometimes turning of one of the settings in kmix may help, I had some crackling coming through my sound and it was the front microphone being on that was the cause, once I turned it off, all was fine.

Woodsman 05-01-2009 11:16 AM

This could be eerily similar to a problem I reported here (problem number 2).

I had sound in KDE as normal user but not as root.

I posted my solution later in the same thread here.

Basically, I deleted $HOME/.kde/share/config/kmixctrlrc.

A side note: Start the system in run level 3. Login as normal user. Use the aplay command to test a wave file. If you get sound then the problem likely is KDE, likely the kmix settings. If no sound from aplay, then there has to be something more fundamental.

mcody 05-02-2009 01:12 PM

@ fotoguy
Quote:

Originally Posted by fotoguy
Good to hear some progress has been made
...
Sometimes turning of one of the settings in kmix may help, I had some crackling coming through my sound and it was the front microphone being on that was the cause, once I turned it off, all was fine.

I tried your suggestion, but that didn't help. Some further research pointed to settings of the VIA 8233 Alsa driver. The Via8233 page on the Unofficial ALSA Wiki is very helpful in this regard.

@ Woodsman
Quote:

Originally Posted by Woodsman
This could be eerily similar to a problem I reported here (problem number 2).

I had sound in KDE as normal user but not as root.

I posted my solution later in the same thread here.

Basically, I deleted $HOME/.kde/share/config/kmixctrlrc.

A side note: Start the system in run level 3. Login as normal user. Use the aplay command to test a wave file. If you get sound then the problem likely is KDE, likely the kmix settings. If no sound from aplay, then there has to be something more fundamental.

Your problem is similar, but not that similar. I got sound as root, but not as the user. See my earlier post for an explanation of my solution. If I had looked at the VIA 8233 Alsa driver page, mentioned above, I probably would have solved the problem sooner. The VIA 8233 drive has changed a lot more than I would have expected since I installed it with Slackware 10.2 (three years ago). :o

oot 09-05-2009 02:42 PM

It is a permissions thing. Had me tearing my hair out for a while too, but I finally found it - cd into /dev/snd and do "chmod a+rw *".

fotoguy 09-07-2009 03:28 AM

Good to hear it's all sorted now.


All times are GMT -5. The time now is 04:02 PM.