Debian: no sound in web browsers?

Zelmo3

Senior member
Dec 24, 2003
772
0
0
So in my efforts to switch from SuSE to Debian and thus gain more flexibility over my system, I have what seems to be the last remaining snag: getting sound to work in web browsers.

I noticed that when I try to visit homestarrunner.com and see what's new in Strong Bad's e-mail, the Flash cartoon plays through the video but makes no sound. My locally stored programs get sound (such as games included with Gnome and KDE, multimedia players, etc.), but when I visit a web site that has built-in sound I don't hear anything. It's affecting Firefox, Mozilla, and Galeon, which are the browsers I have installed. I know they all use the Gecko engine, so I'm guessing if one of them starts working they'll all work.

I've re-installed Mozilla and Firefox and set their sound server to auto (choices were auto, alsa, oss, and none), and now visiting a site that has sound in their Flash will hang the browser.

Did I miss something in installing sound software or browser software? What kind of information will be useful in diagnosing this problem?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Your sound card probably doesn't do hardware mixing so only one thing can play a sound at a time. Generally something like esd or arts is used to do software mixing in that case, do you know if you're using OSS or ALSA drivers for your card and what is the card?
 

Zelmo3

Senior member
Dec 24, 2003
772
0
0
Wow, I forgot to mention a lot of things. Firstly, this is on my laptop. The sound chipset is Ali 5451, with AC97. Secondly, I have alsa and oss enabled in the kernel. I've installed all the alsa packages that looked relevant, including ones for oss compatibility. But when I lsmod, all the sound-related modules are oss modules.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Recompile your kernel without OSS, and then the relevant alsa options compiled as modules. Then just do an apt-get install alsamixergui and that should take care of the correct alsa packages.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
There's no need to recompile the kernel to remove OSS, both can coexist just fine. As long as he installs the alsa-base package it'll include a hotplug blacklist for the OSS modules so that ALSA gets loaded when hotplug starts up.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Also you'd want to configure Dmix plugin so that you can run multiple Alsa-aware apps at once.

Works limited ok with only OSS aware apps.

Pluss kill esd or artsd, either that or put the extra effort to make them run thru alsa plugins.

For a generic asound configuration using dmix use this:
# ~/.asoundrc

pcm.ossmix {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
}
}

pcm.!default {
type plug
slave.pcm "ossmix"
}

pcm.dsp0 {
type plug
slave.pcm "ossmix"
}

ctl.mixer0 {
type hw
card 0
}

Just make a new file in your home directory called .asoundrc or for system wide configuration stick it in /etc/asound.conf or were ever your asound.conf is located by default. (not all have them).

here is the dmix howto.

If that one doesn't work correctly or you get crappy sound try one of the others from the howto and see if that works. Non-alsa-aware apps can still bogart the sound device though.

I test to see if the .asoundrc file is working or not by using ogg123....
ogg123 -d alsa09 /path/to/ogg/vorbis/or/flac/file.ogg

if you can open 2 of those instances and here both of them, then you have dmix working.

There are other howtos for getting esd or artsd working thru the plugins as well as teamspeak and quake3 howtos.

Most of the time just copying the complex sample from the howto page works great.

Check out the documentation at alsa-project.org or other stuff in the howto website I linked above for specific configurations about your card. Usually one or two people have sample asoundrc files posted that they've played around with on their own machines.


edit:

Using the dmix plugin and such for software mixing of sound inputs only works when your using alsa drivers, btw.

edit2:

also, compile sound drivers as modules always, if you can. Modules are easier to play around with and you can pass arguments to tweak them to get the best sound.

The easiest solution is to simply buy a nice card that supports hardware mixing, such as a soundblaster or audigy, then you don't have to mess around with sound daemons or software mixing.
 

Zelmo3

Senior member
Dec 24, 2003
772
0
0
Nothinman: I already had alsa-base installed. It doesn't seem to be blacklisting oss. I added alsa-mixer-gui, but that's not helping either.

Drag: I killed esd (artsd wasn't running). I didn't have an asound.conf in /etc nor an asoundrc in ~/, so I put asound.conf in /etc as shown in your post. Rebooted, and nothing has changed. I still get oss modules when I lsmod, and there's no sound in my web browsers.
I'll try some of the other stuff from your link later today.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
ya. it's definately something bogarting your sound card. Unless your using the old unsupported free flash player. You need to be using the one from macromedia, the open source one you can get thru debian is unsupported.

Usually that just crashes the browser, though.

Thru Suse's Yast you should be able to choose which drivers you use, OSS or Alsa. You can tell the different in the naming of the module because alsa modules begin with a snd- prefix.

If you can't figure out how to do that or it doesn't work the easy thing to do would be to go manually into your /lib/modules/your.kernel.number/ (use uname -a if you forget the name) and simple move the oss drivers in question out of their and run depmod after word. If they are absent your system won't use them and you can modprobe the alsa drivers manaully.

Either that or just recompile without the OSS drivers. They are pretty much obsolete anyways.

Also that .asoundrc or asound.conf is only usefull with alsa drivers.

here is the older alsa-project page:
http://www.alsa-project.org/al...%2B&module=ali5451

here is the alsa opensrc documentation page:
http://alsa.opensrc.org/
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
also a different approach would be to use artsd and the artsdsp wrapper.

start artsd and then from a command line you would start your app like this:
artsdsp mozilla

And that will pipe any sound output in thru artsd. I used to do that when using OSS drivers. That's probably the easiest, now that I think about it.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Nothinman: I already had alsa-base installed. It doesn't seem to be blacklisting oss

There should be a file /etc/hotplug/blacklist.d/alsa-base, if that file is there then the blacklist is in place and it's not hotplug that's loading the drivers for you.
 

Zelmo3

Senior member
Dec 24, 2003
772
0
0
Now I'm really puzzled. The blacklist file is there, so oss shouldn't be loading. I did have flash installed from the debian repository, so I uninstalled that and got flash from Macromedia's site. That made no difference, so I tried the arts daemon and wrapper. Still no difference. And now I've recompiled the kernel with no oss support at all. During boot-up I saw a message about alsa being loaded, but lsmod still shows oss modules. Are they just alsa's compatiblilty stuff? Anyway, still a no-go for web sound. Going to a site with sound hangs the browser.

Edit: I only checked Firefox before writing this post. It turns out Galeon and Mozilla work fine, so it's just Firefox that has no sound. What should I be looking for?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Just to be sure, are you sure you're not loading the OSS modules before the ALSA ones in /etc/modules? I switched my notebook here over to ALSA this weekend and the only changes I had to make were remove the lines from /etc/modules and installing alsa-base to get the blacklist.

What OSS modules are you talking about? How about posting the output of lsmod?
 

Zelmo3

Senior member
Dec 24, 2003
772
0
0
Script started on Tue 28 Dec 2004 04:28:29 PM EST
Module Size Used by

ipv6 262276 8

ds 18820 2

thermal 12816 0

fan 4044 0

button 6360 0

ac 4876 0

battery 9484 0

af_packet 22600 2

eth1394 21768 0

ohci1394 35588 0

ieee1394 111352 2 eth1394,ohci1394

shpchp 100780 0

pciehp 97388 0

pci_hotplug 34352 2 shpchp,pciehp

ati_agp 8588 1

agpgart 34472 1 ati_agp

parport_pc 36932 0

parport 41544 1 parport_pc

pcspkr 3688 0

rtc 12728 0

ehci_hcd 31364 0

ohci_hcd 21380 0

snd_ali5451 25800 4

snd_ac97_codec 69892 1 snd_ali5451

snd_pcm_oss 54440 1

snd_mixer_oss 20032 3 snd_pcm_oss

snd_pcm 97608 2 snd_ali5451,snd_pcm_oss

snd_page_alloc 11720 1 snd_pcm

snd_timer 25668 1 snd_pcm

b44 22148 0

mii 5184 1 b44

yenta_socket 21568 0

pcmcia_core 70132 2 ds,yenta_socket

tsdev 7360 0

mousedev 10444 1

joydev 9856 0

evdev 9600 1

psmouse 20232 0

driverloader 295208 0

usbcore 118244 5 ehci_hcd,ohci_hcd,driverloader

ide_cd 42400 0

cdrom 40284 1 ide_cd

powernow_k7 10352 0

freq_table 4292 1 powernow_k7

processor 17392 2 thermal,powernow_k7

ext2 71272 0

ext3 126632 1

jbd 61592 1 ext3

mbcache 9220 2 ext2,ext3

ide_generic 1472 0

ide_disk 19264 3

alim15x3 12492 1

ide_core 138468 4 ide_cd,ide_generic,ide_disk,alim15x3

unix 28596 552


Script done on Tue 28 Dec 2004 04:28:29 PM EST
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
That snd_ali5451...

That's a Alsa module. You can tell because it has the snd_ in front of it. The oss thing your seeing is Alsa's OSS emulation, so that programs designed for OSS will still work.

Also make sure that your using the flash player/plugins from Macromedia and not the GPL'd flash player, which is unmaintained and never came close to having full flash support. (patent/lisencing problems) The only way you can get it is by going to Macromedia's website and downloading and installing the Linux binary installer.
 

yelo333

Senior member
Dec 13, 2003
990
0
71
Flash is a weird plugin.

If you are using alsa, it just uses OSS emulation, so, /dev/dsp should be a symlink which points to the correct output.

figure out where that points, by "ls -l /dev/dsp", if you are unsure, many distros have it point to /dev/dsp0.

Once you have figured out this, you actually need read and write access enabled on that file, and, possibly, though untested, execute. For example, on one of my boxes, I just ran:

chmod 777 /dev/dsp0. I dunno why I made it executable, but, I did ;)

This fixed all my flash sound problems for me.
 

Zelmo3

Senior member
Dec 24, 2003
772
0
0
Drag: After you mentioned the debian-distributed flash vs. the real deal, I realized that I'd installed flash via apt-get initially, so I uninstalled that and got it from Macromedia. Still no difference, sadly.

yelo: my /dev/dsp isn't linked to anything. It is there, and it has rw permissions for both user and group (root and audio), and I am in the audio group. I don't see how adding x would change it, but I'll give it a crack.

Interestingly, I do get sound in Firefox if I use KDE. Until now I'd been using Gnome, but decided to switch this morning and was surprised to find that I can hear sounds in web sites when I run Firefox in KDE. The only hangup there is that once I close the browser after visiting a site with sound, firefox-bin remains a running process and I have to kill it to remove the lockfile.

Edit: that lockfile problem has gone away on its own. Firefox-bin no longer stays running after the browser is closed, so I guess that was just a random thing the first couple of times.