When a sample is playing a cached sample and it disconnects we should
wait until all the pending samples are finished otherwise we stop
their playback and get a chopped or broken sample.
See #595
Allow only one memblock in the output queue. Otherwise, if the
client is for some reason not reading from the socket, we would queue
an unlimited amount of messages until we get killed by OOM.
Change some warn to debug in the process function for things we
handle from the non-rt thread.
Fixes#488
Pulseaudio unsets the preferred sink/source when stream is moved to a
default target. Emulate this behavior by setting + unsetting
target.node, which informs policy-node to move it accordingly.
PulseAudio starts with underrun_for equal to -1, sets it to 0 when
something was played and increments it from then on with the number
of bytes played.
Use the rate match io are to read the exact amount of samples we
need for this cycle from the ringbuffer. We can then request lower
latency.
There will also be less buffering in the audioconverter, which makes
our timestamps more accurate.
Remove the separate error event and merge with the done event with
error code. This then also marks the sample as done when in error
so that it gets cleaned up properly.
Fixes#486
We can't write more to the ringbuffer than its maxsize. Some clients
send more than the negotiated maxsize and cause a crash if we don't
clamp.
See #440
A virtual source is usually implemented with a null-sink, it looks
like a source to pulseaudio clients but just forwards what it gets
as input.
Make sure the port names make sense.
You can use the null sink now as:
pactl load-module module-null-sink sink_name=source object.linger=1
media.class=Audio/Source/Virtual channel_map=FL,FR,RL,RR
This creates a node with "input" and "capture" ports and looks
like a virtual source for pulseaudio clients.
pactl load-module module-null-sink sink_name=source object.linger=1
media.class=Audio/Sink channel_map=FL,FR,RL,RR
This creates a node with "playback" and "monitor" ports and looks
like a virtual sink for pulseaudio clients.
pactl load-module module-null-sink sink_name=source object.linger=1
media.class=Audio/Duplex channel_map=FL,FR,RL,RR
This creates a node with "playback" and "capture" ports and looks
like a virtual source and sink for pulseaudio clients.
Convert to an from pulse enum to id in the message layer so that we
can always just deal with native spa types.
Use the channelmap in stream-restore
Parse the channelmap from properties.
Also count the amount of underrun bytes as missing so that we request
them from the client.
Provide one fragment of minreq when we underrun instead of the full
buffer size.
Fixes#395