Need help with ALSA on Linux!

Electrode

Diamond Member
May 4, 2001
6,063
2
81
Hey all. This morning, I set up alsa on my Linux system, in an attempt to fix some problems being caused by the OSS driver for my soundcard. The driver built, installed, and insmodded without error, I even hear a "pop" during boot indicating that the soundcard has been initialized. Now here's the problem:

I can't hear any sound that I play.

I can hear the line-in sound from my other computer, so I know it is working to some extent, but not anything played on THIS computer. Nothing gives any errors (mpg123, artsd, xmms, and so on all run like there's nothing wrong) but that only makes this problem harder to solve. I have un-muted everything (at least I think I have), and all signals in the mixer are turned up to about 60%.

The only message of any kind I get is in Quake 3, a message saying "sound system is muted". What's the deal?

Basic system info:
Slackware 8.0
Kernel 2.4.18-pre1
Yamaha YMF724 card (uses ymfpci driver)
Dual Pentium 3 667
1.7 GB RAM
 

NiPeng

Senior member
Jul 17, 2001
310
0
0
Iirc alsa starts with the sound muted, run gmix or some other mixer to adjust the volume.
 

NiPeng

Senior member
Jul 17, 2001
310
0
0
Artsd is a sound deamon I presume?

I've used Alsa with the same sound card a while ago and it worked ok.
Hmm just guessing.. is the mixer kernel module inserted?
Wasn't there something about sound being muted in the alsa documentation.
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
1. Yes, artsd is KDE's sound daemon.
2. I'm pretty sure it is. There is a /dev/mixer0 oject with 666 permissions, with a symlink /dev/mixer pointing to it. Same with dsp.
 

LNXman

Senior member
Jul 27, 2000
404
0
0
I will be assuming you have installed the correct module and the ALSA tools (amixer & alsactl).

Now, try this at the prompt (#):

# amixer -c 0 set PCM 100% unmute
# amixer -c 0 set Master 100% unmute
# alsactl store 0


The calls to amixer should unmute your Pulse Code Modulation (PCM) and your Master Volume controller. (NOTE: The volume will be blasting at 100%, so don't have your hardware volume controller all the way to #11-- i.e. your amplifier)
The call to alsactl stores the current settings you have given the card under /etc in a file called asound.conf.

The asound.conf file has to be loaded every time your machine is rebooted, because the changes to the card are NOT permanent. So, everytime you reboot, you have to give the command:
# alsactl -f /etc/asound.conf restore 0

if the above actions do not help. Then answer the following:
What alsa modules did you compile?
What does lsmod say WRT the ALSA modules that have being loaded?
What do you have in /etc/modules.conf WRT ALSA? Are you supposed to pass any arguments to the modules WRT your card?
Are you using devfs? Does it give permissions for users to access /dev/dsp*, and /dev/mixer* (besides root)?

GL

P.S. Remember to become root or su when you issue any of the commands above. ;^)

/edit: added NOTE
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
Thanks for the suggestions, but that did not help. :(

Answers to your questions:

1. All of them.
2. lsmod | grep snd:

snd-pcm-oss 19936 0 (autoclean)
snd-pcm-plugin 14352 0 (autoclean) [snd-pcm-oss]
snd-mixer-oss 5056 0 (autoclean) [snd-pcm-oss]
snd-card-ymfpci 4384 0 (autoclean)
snd-ymfpci 39696 0 (autoclean) [snd-card-ymfpci]
snd-pcm 38944 0 (autoclean) [snd-pcm-oss snd-pcm-plugin snd-ymfpci]
snd-ac97-codec 26624 0 (autoclean) [snd-ymfpci]
snd-mixer 33920 0 (autoclean) [snd-mixer-oss snd-ymfpci snd-ac97-codec]
snd-opl3 5552 0 (autoclean) [snd-card-ymfpci]
snd-timer 11952 0 (autoclean) [snd-pcm snd-opl3]
snd-hwdep 4304 0 (autoclean) [snd-opl3]
snd-mpu401-uart 3680 0 (autoclean) [snd-card-ymfpci]
snd-rawmidi 12448 0 (autoclean) [snd-mpu401-uart]
snd-seq-device 4224 0 (autoclean) [snd-rawmidi]
snd 43424 1 (autoclean) [snd-pcm-oss snd-pcm-plugin snd-mixer-oss snd-card-ymfpci snd-ymfpci snd-pcm snd-ac97-codec snd-mixer snd-opl3 snd-timer snd-hwdep snd-mpu401-uart snd-rawmidi snd-seq-device]

3. /etc/modules.conf lines related to alsa:

alias char-major-116 snd
options snd snd_major=116 snd_cards_limit=1
alias snd-card-0 snd-card-ymfpci
options snd-card-ymfpci snd_index=0 snd_id="YMF724"
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

4. No, I am not using devfs.
5. Permissions for /dev/dsp and /dev/mixer are 666 (-rw-rw-rw-) and owned by root.
 

LNXman

Senior member
Jul 27, 2000
404
0
0
O.K. I do not see soundcore loaded, as requisited by ALSA. Did you compile it in the kernel? If I recall, ALSA required soundcore to be a module, and then have the ALSA module load it.
Then again, perhaps, the card cannot configure itself properly, so why don't you try changing the info you gave me below:



<<
alias char-major-116 snd
options snd snd_major=116 snd_cards_limit=1
alias snd-card-0 snd-card-ymfpci
options snd-card-ymfpci snd_index=0 snd_id="YMF724"
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
>>



TO:

alias char-major-116 snd
options snd snd_major=116 snd_cards_limit=1 snd_device_mode=0660 snd_device_uid=0
alias sound snd-card-0
alias snd-card-0 snd-card-ymfpci
options snd-card-ymfpci snd_index=0 snd_id="YMF724" snd_isapnp=0 snd_port=0x530 snd_cport=0x538 snd_mpu_port=0x330 snd_fm_port=0x388 snd_sb_port=0x220 snd_irq=5 snd_dma1=1 snd_dma2=0 snd_mpu_irq=9
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
alias snd-minor-oss-0 snd-card-ymfpci
alias snd-minor-oss-1 snd-opl3
alias snd-minor-oss-3 snd-pcm-oss


What you are doing is forcing the settings for the card, like the ports, dma, etc. The settings I give you above are defaults, and if they do not work, then you are going to have to play around with the settings according to the ranges your sound card supports, or make soundcore a module. For that info, you have to read your sound cards specs.
In addition I added a few aliases I believe you need.

Let me know what happens.

P.S. After you make the changes, you can reload the modules (rmmod <-> modprobe), or just reboot the machine (would be easier for you, I think). Also, you have to init the card as I explained on my previous post after the machine reboots.

/edit: Fixed typo
/edit: Edited setting
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
I have edited the config as you suggested and reloaded the modules. It didn't help.

I built soundcore into the kernel instead of making it a module. I will rebuild it, this time making it a module.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
i never had good luck with alsa... usually it would get staticy every few minutes for about 30 seconds or so. does OSS support your card?
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
Yes, my soundcard is supported by OSS, but a game I was trying to get working (Quake 3) refused to work with it. Of course, NOTHING works with alsa, so I might just have to go without that particular game.
BTW, I have rebuilt my kernel with soundcore as a module. Now alsa doesn't even start. It complains about unresolved symbols. What do you suggest now?
 

LNXman

Senior member
Jul 27, 2000
404
0
0
Tell me what modprobe -v <the_snd_module> says. And what exactly is the error message you are getting when the module is trying to start. Let 's see if we can debug the sucker.

Do this at the prompt:
# modprobe -v snd-card-ymfpci > out and post the area where the module gets the error from the out file.

Could you also tell me what are /dev/dsp and /dev/mixer pointing to? Just do an ls -l /dev/dsp /dev/mixer , and let me know.

BTW, I am a little perplexed because you said you are NOT using devfs. Did you run the ./snddevices script to create the sound devices? Just curious.

/edit: Added P.S.
/edit: added questions
/edit: delete P.S. -- it was irrelevant
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
Yes, I did use snddevices to make the sound devices.

I also found out why I was gettign those unresolved symbol errors (I think). When I built the kernel, I forgot to make the "modules" and "modules_install" targets! Since I usually build everything I need into the kernel, I didn't remember I had to do that.

I will build a new kernel, and tell you how it goes.
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
It's STILL not working! :|

Here's everything I've done recently:

1. Built new 2.4.18pre1 kernel. soundcore and OSS's ymfpci built as modules.
2. Upon boot, did modprobe soundcore and modprobe ymfpci. Played an MP3. It worked.
3. Did rmmod for every module except soundcore, NVdriver, vmnet and vmmon. (the last 3 are needed for non-sound-related stuff)
4. Built ALSA. Did ./configure, make install, ./snddevices, modprobe snd-card-ymfpci, amixer -c 0 set Master 60% unmute, amixer -c 0 set PCM 60% unmute.
5. Played an MP3. IT DID NOT WORK!
6. Started X. Started Unreal Tournament. No sound!

I think I've tried every possible solution, and it's still not working. Unless there's something you haven't thought of yet, I give up.
 

LNXman

Senior member
Jul 27, 2000
404
0
0
You still have not told me what do /dev/dsp* and /dev/mixer* point to.
/dev/dsp should be pointing to /dev/snd/pcmC0D0, or a another character device that points to /devsnd/pcmC0D0, and
/dev/mixer should be pointing to /dev/snd/mixerC0D0, or a another character device that points to /dev/snd/mixerC0D0
after running the snddevicesscript.

If they are not, Did you compile ALSA with OSS emulation? From what you let me know on you last post, it seems that you may not have compiled it. OSS emulation makes the ALSAmodule(s) use the standard /dev/dsp, /dev/mixer, etc sound character devices so that OSS compiled apps can work without sound probs. Check out the configuration options for configure before building ALSA again. And always do a make distclean before re-configuring.

You can also, tell me what does /proc/asound/sndstat says.

And lastly, you can also check out what Group names used for volume control your card has. If you issue the command amixer | grep Group, you should see all the group names you can use to control volume with the previous amixer command shown on one of the previous posts. Or, you can simple do a amixer | more and check out which Group(s) are muted, and then try to unmute them.

You can also use mpg123 to test the sound character devices if you want after you run the modules, and unmute the devices like this:
# mpg123 -a /dev/<device> <mp3file>

you should try to use: /dev/dsp, /dev/audio (if it is there), /dev/snd/pcmC0D0, or any other sound device to see if it works.


Let me know what else you find out.

P.S. The positive side of this is that you are learning a bit about ALSA, aren't you? ;)

/edit: changed angry face
/edit: added another suggestion & P.S.
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
Last I checked, /dev/dsp was pointing to /dev/dsp0 and mixer was pointing to mixer0. I will change those and edit with result. OSS emulation is enabled (INSTALL suggests it is enabled by default).

Edit:
Well, before I tried to change anything, I tried playing an MP3 with mpg123 to various devices, to see which one (if any) worked:

/dev/dsp: no sound
/dev/dsp0: no sound
/dev/audio: no sound
/dev/adsp: no sound
/dev/snd/pcmC0D0: "Could not open device" error
/dev/dsp1: "Could not open device" error

Contents of /proc/asound/sndstat:

Sound Driver:3.8.2-980706 (ALSA v0.5.12a emulation code)
Kernel: Linux tetrahedron 2.4.18pre1 #1 SMP Thu Jan 10 06:23:56 EST 2002 i686
Config options: 0

Installed drivers:
Type 10: ALSA emulation

Card config:
Yamaha DS-XG PCI (YMF724F) at 0xdf030000, irq 18

Audio devices:
0: YMFPCI (DUPLEX)

Synth devices: NOT ENABLED IN CONFIG

Midi devices: NOT ENABLED IN CONFIG

Timers:
7: system timer

Mixers:
0: Wolfson WM9701A


Output of asound | grep Group:

Group 'SPDIF Record',1
Group 'SPDIF Playback Volume',1
Group 'Wave Capture Volume',0
Group 'Wave Playback Volume',0
Group 'SPDIF Playback Volume',0
Group 'ADC Playback Volume',0
Group 'Capture Volume',1
Group 'SPDIF Record',0
Group 'ADC Record',0
Group 'Capture Volume',0
Group 'Input Gain',0
Group 'Master Mono',0
Group 'Master',0
Group 'Aux',0
Group 'Video',0
Group 'CD',0
Group 'Line',0
Group 'MIC',0
Group 'Phone',0
Group 'PC Speaker',0
Group 'PCM',0