[alsa-devel] handling of dmix and non-dmix in the same configuration file

Mike Frysinger vapier at gentoo.org
Fri Feb 22 00:04:39 CET 2008


on the Blackfin processor, we have an "almost-but-not-quite" AC97 interface 
(called a "SPORT").  the trouble is that we can hook up AC97 codecs, but in 
order to properly communicate with codecs, we need to repacketize the 
communication between the higher alsa layers and the actual SPORT.  great ... 
but now we want to support dmix/dsnoop.  the overhead for dmix vs non-dmix is 
such that we make it optional.  if the user does not need software mixing, 
they can disable this overhead.  this leads to two (incompatible) alsa config 
files (in this case, for the AD1980 codec).  we're wondering if it's possible 
to have the right settings selected on the fly some how during runtime rather 
than having to select one file or the other.

the dmix config:
AD1980.pcm.default {
	@args [ CARD ]
	@args.CARD {
		type string
	}
	type asym
	playback.pcm {
		type plug
		slave.pcm {
			@func concat
			strings [ "dmix:CARD=" $CARD ]
		}
	}
	capture.pcm {
		type plug
		slave.pcm {
			@func concat
			strings [ "dsnoop:CARD=" $CARD ]
		}
	}
}

the non-dmix config:
AD1980.pcm.default {
	type plug
	slave {
		pcm {
			type mmap_emul
			slave {
				pcm {
					type hw
					card 0
					format S16_LE
					rate 48000
					channels 2
					sync_ptr_ioctl 1
				}
			}
		}
	}
}
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20080221/88a0e062/attachment-0001.sig 


More information about the Alsa-devel mailing list