[alsa-devel] get two mono channel from stereo line

Clemens Ladisch clemens at ladisch.de
Fri Jul 24 11:09:35 CEST 2009


arif setiawan wrote:
> We have a beagleboard with one audio line-in and one audio line-out. From
> the documentation both are stereo line. Now we want to use four mono audio
> line for our system. two input from radio and microphone, two output to
> radio and speaker. We use ALSA and we would like to know how we can achieve
> this either by plugin or programming alsa.

Try something like this:

pcm_slave.stereo {
	pcm "hw:0,0"	# or whatever your device is
	channels 2
}

pcm.left {
	type asym
	playback.pcm {
		type plug
		slave.pcm {
			type dshare
			slave stereo
			ipc_key 200907241
			bindings [ 0 ]
		}
	}
	capture.pcm {
		type plug
		slave.pcm {
			type dsnoop
			slave stereo
			ipc_key 200907242
			bindings [ 0 ]
		}
	}
}

pcm.right {
	type asym
	playback.pcm {
		type plug
		slave.pcm {
			type dshare
			slave stereo
			ipc_key 20090724
			bindings [ 1 ]
		}
	}
	capture.pcm {
		type plug
		slave.pcm {
			type dsnoop
			slave stereo
			ipc_key 200907242
			bindings [ 1 ]
		}
	}
}


HTH
Clemens


More information about the Alsa-devel mailing list