We move over helper functions to get rate, channels, channel map and
sample format (if PCM) in the public API, so users of the extended API
are more easily able to pull out these values from pa_format_info.
We can provide a better overall user experience with Bluetooth cards by
always choosing the higher audio quality profile (A2DP) by default and
updating the profile selection dynamically according to which streams
are active at a certain moment. The default initial selection has been
addressed by "85daab272 bluetooth: set better priorities for profiles"
and the dynamic profile selection is covered by module-bluetooth-policy.
In addition, module-card-restore's database entries for Bluetooth devices
are retained after a device is removed from the system, leading to the
previously selected profile being restored after a new pairing with the
same device, with no way for the user to erase this memory and reset the
default profile except manually fiddling with module-card-restore's
database.
This commit adds a module argument to have module-card-restore ignore
Bluetooth profiles and this behavior is set as default.
The internal operation_set_state function already returns early if the
new state is the same as the existing state. The attached patch extends
this to return early if already in a finalised (done/cancelled) state,
i.e. blocks attempts to re-finalise into a different state.
This helps avoid unlinking more than once (or crashing on ref count
assertion).
I was not certain whether an assertion would be a better alternative -
with such a crash helping highlight usage problems...
The situation that lead to this was the thought of someone stupidly
trying to pa_operation_cancel() a callback within the callback
execution itself, while designing a solution for a memory leak related
to cancellation within my Rust binding. While no-one should do such a
thing, if they did, they'd either trip up a ref count assertion, or the
operation would be unlinked twice, which would be bad. It's a simple
thing to catch and mitigate, and could prove to be a useful
bulletproofing measure for this function in general.
We recently changed the umask of the daemon from 022 to 077, which broke
module-pipe-sink in the system mode, because nobody was allowed to read
from the pipe.
module-pipe-source in the system mode was probably always broken,
because the old umask of 022 should prevent anyone from writing to the
pipe.
This patch uses chmod() after the file creation to set the permissions
to 0666, which is what the fkfifo() call tried to set.
Bug link: https://bugs.freedesktop.org/show_bug.cgi?id=107070
Having a single level macro for stringizing LADSPA_PATH doesn't work,
because the '#' preprocessor operator doesn't expand any macros in its
parameter. As a result, we used the string "LADSPA_PATH" as the search
path, and obviously no plugins were ever found.
This adds a two-level macro in macro.h and uses that to expand and
stringize LADSPA_PATH.
Bug link: https://bugs.freedesktop.org/show_bug.cgi?id=107078
Add configuration option 'stream_name' for stream/session name so user
will see it on receiver side as RTP Strean ($stream_name)
ex: load-module module-rtp-send source=rtp.monitor stream_name=MyServerMedia
There has been a function to get supported sample rates from alsa and
an array for it in userdata of each module-alsa-sink/source. Similarly,
this patch adds a function to get supported sample formats(bit depth)
from alsa and an array for it to each userdata of the modules.
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
pa_sink_get_state() and pa_source_get_state() just return the state
variable. We can as well access the state variable directly.
There are no behaviour changes, except that module-virtual-source
accessed the main thread's sink state variable from its push() callback.
I fixed the module so that it uses the thread_info.state variable
instead. Also, the compiler started to complain about comparing a sink
state variable to a source state enum value in protocol-esound.c. The
underlying bug was that a source pointer was assigned to a variable
whose type was a sink pointer (somehow using the pa_source_get_state()
macro confused the compiler enough so that it didn't complain before).
I fixed the variable type.
pa_sink_input_get_state() and pa_source_output_get_state() just return
the state variable. We can as well access the state variable directly.
There are no behaviour changes, except that some filter sources accessed
the main thread's state variable from their push() callbacks. I fixed
them so that they use the thread_info.state variable instead.
The only thing that the drained state was being used for was "pacmd
list-sink-inputs". In all other cases the drained and running states
were treated as equivalent. IMHO, this usage doesn't justify the
complexity that the additional state brings.
This patch was inspired by a bug report[1] that pointed out an error in
an if condition in pa_sink_input_set_state_within_thread(). The buggy
code is now removed altogether.
[1] https://bugs.freedesktop.org/show_bug.cgi?id=106982
When the user manually switches the profile of a bluetooth headset from
"off" to "a2dp_sink", the port availability changes from "unknown" to
"yes", which triggered a recursive profile change in
module-switch-on-port-available. Such recursivity isn't (and possibly
can't) be handled well (that is, PulseAudio crashed), so let's avoid
doing bluetooth profile changes from module-switch-on-port-available
(they're useless anyway).
Bug link: https://bugs.freedesktop.org/show_bug.cgi?id=107044
Now that both backend-native and backend-ofono can coexist and
backend-ofono is always loaded, even on systems without oFono, failing
to register with org.ofono is not necessarily an error.
This lowers the failure message log level from error to info.
This allows constifying public API functions that report their errors
via the context error but don't modify the context in any other way.
Philosophical arguments could be made why this is wrong, but I believe
in practice this is a net positive change.
Paves the way towards more of the API using const pointers.
Some pa_context_* functions return their errors by setting the context
error, even when there's no other change in the context state. This
prevented constifying the pa_context arguments of such functions. This
patch puts the error in its own struct behind a pointer, so that setting
the error doesn't any more count as modifying the pa_context object.
A bit hacky approach, but it allows to preserve LFE output position
even in reduced output modes 2.1 and 4.1.
Signed-off-by: Nazar Mokrynskyi <nazar@mokrynskyi.com>
Current code does not check whether pa_play_file call failed. Hence no error is
reported in the cli interface if playback failed because e.g. file isn't
readable by the daemon.