OK. Pre-post note; this became ugly long, - but the core of an problem is that I'm unable to find good articles or diagrams and explanations on this. There is a lot of "how too"s, but I'm having a hard time finding sources going on explaining what I ask about here. By far I guess it cooks down to terminology in 87% of the cases. Then there is, at least it seems to me, quite a few double-meanings.
So; any tips on sources to read is highly appreciated.
I'm having a look at Pulse Audio and the more I read the more confused I get. As I see it it stems down to a basic fault - and that is the understanding of the core concepts.
pacmd to look at various things but I'm having trouble getting how they all relate.
pactl one have a
list option where one can list
modules, sinks, sources, sink-inputs, source-outputs, clients, samples, cards. I'm trying to figure out the base of this.
Here are my way thus far; - and I have no idea if this is correct or not and would be nice to get some hints if anything is wrong, etc.
Given the list of listables above:
cards : Hardware. Each card in this list has been recognized by
udevand given a
sysfs.path. Pulse Audio loads modules to interact with the hardware typically
1.1. Q1: Does ALSA communicate with PA or does PA use ALSA as a conduit to the hardware? Or is it a mix of the two?
As the card is loaded into PA it gets owned by a specific indexed module. By
pactl list cardsone find the record
Owner Module: Nwhere
Nis used by the rest of the PA server. Each card can have one or more profiles and ports.
A profile is a base configuration for the card - typically it defines if a card has output+input, only one of the two, if it is stereo or mono etc.
A port is a conduit to or from the card. Being input or output jacks, HDMI, MIDI or other.
1.2. Q2: My definition of ports is erroneous. I register e.g. that I have ports named
output-headphoneson same jack. What is a port then? <<- that sounds as much as a profile as a port. Perhaps even more like a profile.
sinks: A sink is an output target. Write data to a sink and PA relay it as sound and as it is delivered it vanishes out the drain. The listing from
pactl list sinksdisplay a Owner Module that is the same as the one listed in
Hardware related sinks are output - as in this is delivered to your headphones, speakers or other. The naming convention is
type_output.bus_path.output-profile e.g.: alsa_output.pci-0000_00_1b.0.analog-stereo or by udev.id: alsa_output.usb-08dc_C-Media.analog-stereo
In addition one can have module-based sinks, or a software-sink if you like. These are typically filters that one can route the stream trough for various effects - like switching right to left channel, adding equalizer etc.
Sinks also has
portsbut these are restricted to the ones relying output. E.g.
2.1 Q2: Are modules added to sinks, or is it the other way around? I can't seem to get it right which way. Is it typically A, B or C in (I vote for A):
A: 'media player'->'sink'->'filter-module'->'hardware'->left the system ... B: 'media player'->'filter-module'->'sink'->'hardware'->left the system ... C: ?
Each sink also has a monitor. That is related to the next listing:
sources: Sources are primarily input as in recording. Typically microphone or tuner cards. Here as well the Owner Module relate to the
cardslisting. They have the naming by:
type_input.bus_path.input-profile e.g.: alsa_input.pci-0000_07_04.1.analog-stereo
Q3.1: What is
.monitorsources? As in the ones having a mother in
sinks. This confuses me a bit. I also register each filter module in sinks has a monitor.
As with sinks, sources is restricted to ports having
analog-input-radiounless they are
.monitorsources whereby they have no ports.
sink-inputs : These are primarily streams the deliver data to the sinks. By their listing in
pactl list sink-inputsone find typically
Sink: 1which indicate the stream are passed to sink 1.
Q4.1: Here also module-sink driven entry. How does this fit in the chain?
source-outputs: Is this recording streams?
modules : Everything? Is loaded by modules.
clients : What are these? All applications that has an active connection to Pulse Audio? I Find Media players, volume control, window manager etc.
samples : Finally what is this? I have one entry namely "Volume Control Feedback Sound". It has no record of owning or being owned.
A short diagram displaying some of the connections. I am not sure how these arrows should go. E.g. the A-B-C-G routine. Which way and who does what?
Sink Input #0 module-remap-sink [Owner Module: 21] | Sink Input #189 MPlayer [OwnerModule: 9, Sink: 1] | | | /-------------------------------------------+ A. | | | V | Sink #1 reverse-stereo [OwnerModule: 21, master_device = alsa_output.pci-1] | ^ | | | | | +---------------+ B. | | | | | | | C. | Module #21 module-remap-sink  <------------------------------+ ^ | | G. | | | Source #2 reverse-stereo.monitor [Owner Module #21] | | | Sink #0 alsa_output.pci-1 [Owner Module: 5] <-------+ D. | | +------------------------+ E. | | Source #0 alsa_output.pci-1.monitor [OwnerModule 5] | | | | v | Module #5 module-alsa-card [device_id="0" name="pci-1"] <---+ H. | | +-------+ F. | v Card #1 alsa_card.pci-1 [alsa.card = "0", device.bus_path = pci-1] | | v irq 45