Jump to content

Debian: "old" app (/dev/dsp) and ALSA together?


Recommended Posts

I run the Gnome desktop on Debian 4 (Etch) with all system config "as is" (I only changed /etc/apt/sources.list), on a new laptop (core2duo, intel hda sound chipset).

 

This laptop is for my son (5y) and I enabled the desk sounds via ESD; I want the system to provide feedback for his actions.

 

Now the problem is I cannot run educative applications that I installed that use /dev/dsp directly, unless I kill ESD, which is not an option.

 

I replaced libesd0 with libesd-alsa0.

I tried launching the application with aoss.

I tried installing Mandriva's soundwrapper with alien and run the application with soundwrapper.

I tried several settings in (otherwise inexistant) /etc/asound.conf file, but all seemed to be ignored.

 

No luck...

 

In case it gives any indication, when I run the same application after killing all pids from "fuser /dev/dsp" and reloading /etc/init.d/alsa, the sound works but there's a kind of "echo" at the end of each sound (the last milliseconds are repeated); this didn't happen with the same installation inside VMWare.

 

Thanks for your help.

 

Yves.

Edited by theYinYeti
Link to comment
Share on other sites

Some more information: The application I want to run manages its sound through "sox".

 

It is sox that is giving the error message. And I saw on Alsa's web pages that sox is a known trouble-maker where OSS emulation is concerned; something about the fopen() system call...

The bug is supposed to be corrected in late releases of alsa/aoss though, and latest Debian (4) surely has a new enough version of those.

 

So I tried something else. I re-enabled the .asoundrc file as described on ALSA pages, and then relaunched esd with the "-d pasymed" parameter. This time, the application (without aoss if I remember correctly) said it could not sync with the /dev/dsp file.

 

I've a total newbie in .asoundrc and ALSA in general. Do you have an idea?

 

Yves.

Link to comment
Share on other sites

What's the kernel sound module? "lsmod|grep snd" should show this.

 

Getting apps that interact with the sound card like that can be black magic under alsa. If it doesnt work with aoss, like some games, things get difficult.

 

I find the easiest approach is to go the opposite way. Use OSS.

 

http://www.opensound.com/

 

That *was* a closed source implementation of OSS, but it was recently open sourced. The open source implementation OSS that exists in the kernel currently is deprecated, but OSS as a general sound system is not. It works great for me, and does a much better job of implementing mixing than alsa. It has an alsa compatibility, but most applications still have OSS support anyway. Install that (it has an rpm), enable it, set apps to OSS, and things should work a bit easier.

 

James

Link to comment
Share on other sites

I finally found the right combination of settings.

 

First, I disabled any previous /etc/asound.conf of ~/.asoundrc. The ALSA page states that none is needed except for very special needs; that's not my case.

 

Then I changed ESD config (/etc/esound/esd.conf) to make sure it uses ALSA directly and not OSS emulation; here's the current content of this file (I added "-d default" twice):

auto_spawn=0
spawn_options=-terminate -nobeeps -as 5 -d default
spawn_wait_ms=100
# default options are used in spawned and non-spawned mode
default_options=-d default

 

Finally I added an option in /etc/modprobe.d/sound:

options snd-pcm-oss nonblock_open=1

 

That's all. Now applications that need OSS emulation run OK with aoss. The application fore-mentionned (which uses sox as its sound output method) now runs perfect with aoss.

As an aside, there are no more weird echoes to the sounds.

 

Thanks nonetheless iphitus; help is always welcome :)

 

Yves.

Edited by theYinYeti
Link to comment
Share on other sites

Thanks adamw.

 

Actually, I'm not interested at all by esd. I only want to enable Gnome desktop sounds, and it seems that I have absolutely no choice: the Gnome sound config utility proposes to "enable software sound mixer (ESD)" and all desktop sounds are disabled if I don't check this checkbox...

Anyway, the issue is solved, now.

 

Yves.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...