Do not return an error immediately if connect() fails with EAGAIN. Check
if it completed successfully with getsockopt() when the socket becomes
writable instead.
This is the way to handle non-blocking connect() by the book but after
testing it seems that the case when connect() fails with EAGAIN is when
the listen backlog is full on the server side and in that case the
server socket is closed. So even though connect() completes successfully
according to getsockopt() the client socket is no longer usable
(on_remote_data() will get both SPA_IO_OUT and SPA_IO_HUP in mask on the
first call after connect() returned EAGAIN).
Make it possible to specify different channels and positions
per stream so that we can do remapping as well.
Make sure we only copy available input channels and set the remaining
channels empty.
Handle error when loading and fix leaks.
Mark streams as virtual if nothing else is specified.
Try to reuse an existing core connection if possible.
unload the module when the core is in error or when it is destroyed.
When deciding on the number of channels to use for the node,
ignore parsing the sample rate. This makes it possible to activate the
node with a missing rate property, like when the node can do all
possible rates.
Use the default backlog size, SOMAXCONN (128), which is the same as for
the unix socket in module-protocol-native. If the backlog queue gets
full incoming connections will be closed before they can be accepted.
This causes connect() to fail with EAGAIN on the client side and since
the server socket is closed it will not be possible to use the client
socket further.
Use the context work queue to schedule destroys from callbacks.
This is better because we can pass the destroyed object around and
implement just the action we need to do on it.
Make a method to get a work-queue from the context. There is one
work-queue to use and the context will allocate it when requested
and free when destroyed.
The work queue is handy to delay execution of some logic for later,
either in the next iteration of the main-loop or when an async
operation completed.
Export some work-queue methods.
Make a null-sink with monitor.channel-volumes=true by default if not
defined otherwise. This ensures the volume of the null-sink is
always transfered to the monitor ports.
Also only set the object.linger flag when undefined.
This leaves us with the actual meson replacements at the top and, at least
IMO, makes the file easier to read - in part because $(foo) is
syntax-highlighted so variables stick out more.
If we have channels and channelmap, make sure they match.
If we have only channel_map, use this to derive channels instead of
taking the default number of channels and then ending up with a
mismatch.
If we have only channels, use this to generate a channelmap from
predefined maps or just unknown channels instead of taking the default
channel map.
If neither channels or channelmap is defined, use the defaults.
Move the icon we get from bluez to a separate property, it is not
a good icon to show.
Copy form factor from device to node properties.
Set device.bus in the device properties and copy it to the node
properties.
Use form factor and bus to make a nice icon-name for the node and
device.
Fixes#1064