[pulseaudio-discuss] alsa pulse plugin question - what do the "device", "sink", and "source" parameters map to?
Lennart Poettering
lennart at poettering.net
Wed Mar 26 12:04:57 PDT 2008
On Mon, 25.02.08 12:00, Jim Duda (jim at duda.tzo.com) wrote:
> I'm trying to use pulseaudio to allow two applications to interface with each other. It works, but not consistently.
> I'm wondering if I fully understand the context of how "device", "source", and "sink" are used with the alsa pulse
> plugin.
Given the config fragments you posted I assume you are talking of the
pulse plugin for libasound and not the ALSA plugin for pulse, right?
Connecting applications to each other is not the purpose of PA. Use
JACk for things like that.
What exactly doesn't work for you?
> SERVER SIDE
>
> The machine "linux" is the name of the server machine (very creative isn't it).
>
> On the "server" side, pulseaudio is running. I define a null-sink module which a remote client, running on another
> machine, can send its audio data to through the alsa pulse plugin.
>
> server /etc/pulse/default.pa null-sink definition:
> load-module module-null-sink sink_name=sphinx_record description="Sphinx Recording Source"
>
> The server application references the audio data using the alsa pulse plugin, locally. What does "device" refer to
> within the context of the pulseaudio default.pa definitions? Using "sphinx_record" usually results in "PULSEAUDIO::
> cannot establish stream". Am I using the "device" and "sink" parameters correctly? I don't think I quite understand
> how they are to be used.
The pulse PCM plugin for libasound only knows the "device" and "server"
parameters. For playback device definitions the "device" refers to the
sink name. For record device definition the "device" refers to the
source name. The "server" refers to the server address (i.e. unix
socket, tcp address, host name, ...).
The pulse CTL devices takes "device", "sink", "source" options. If one
of the latter two is defined it will be used and overwrites the
"device" string for sink resp. source device definitions.
> pcm.sphinx_record {
> type pulse
> device sphinx_record
> }
sphinx_record is a null *sink*, according to your definition above. If
I understood you correctly, than this side shall be able to record
audio. You thus want to use sphinc_record.monitor here.
> ctl.sphinx_record {
> type pulse
> device sphinx_record
> source sphinx_record.monitor
> }
This definition makes some sense, though I would recommend to use the
word "sink" instead of "source" here.
>
> CLIENT SIDE
>
> The client application runs on another machine. The client appliation uses the "sphinx_record" alsa handle to send
> audio to the null-sink on the linux server. Am I using the "device" and "sink" parameters correctly? I don't think I
> quite understand how they are to be used.
> pcm.sphinx_record{
> type pulse
> device sphinx_record
> server linux
> }
This seems to be correct to me (only useful as playback device definition).
> ctl.sphinx_playback {
> type pulse
> device sphinx_record
> sink sphinx_record
> server linux
> }
This doesn't make sense, since both the sink and source to expose in
the mixer have the same name which actually refers to a sink. You
should be using something like "sink sphinix_record" and "source
sphinx_record.monitor" here.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss
mailing list