[linux-audio-user] OSS Emulation and .asoundrc files

Clemens Ladisch clemens at ladisch.de
Thu Oct 16 06:39:09 EDT 2003


Mark Knecht wrote:
>    What would be great, if it can be done, is to create a sort of
> 'virtual OSS' device in .asoundrc that only drove specific Alsa playback
> channels, so that Mozilla, for instance, talked to a specific entry in
> .asoundrc and ended up only driving two specific playback channels, like
> playback_22 and playback_23.

	pcm_slave.hdsp {
		pcm "hw:0"  # or whatever number it is
		channels 26
	}

	pcm.playback_22_23 {
		type dshare
		slave hdsp
		ipc_key 314159265  # some unique number
		ipc_key_add_uid yes  # "no" to let multiple users share it
		bindings {
			0 22
			1 23
		}
	}

Now you have a stereo device for channels 22+23, use it like
"aplay -Dplayback_22_23 something.wav". Define some other pcms to be
able to use the other channels at the same time.

To access this from OSS programs, define a pcm named "dsp0":

	pcm.dsp0 {
		type plug
		slave.pcm playback_22_23
	}

and start your OSS program with the aoss script from the alsa-oss
package.


HTH
Clemens





More information about the Linux-audio-user mailing list