1. 03 Dec, 2020 17 commits
    • Igor Kovalenko's avatar
      message-params: consume array enclosing {} by array read methods · c1ac7601
      Igor Kovalenko authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      Part-of: <!51>
      c1ac7601
    • Igor Kovalenko's avatar
      message-params: add read length param reference to array read methods · 818a87de
      Igor Kovalenko authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      Part-of: <!51>
      818a87de
    • Tanu Kaskinen's avatar
      core-util-test: Test pa_atou64() and pa_atoi64() · fe162e0b
      Tanu Kaskinen authored
      Part-of: <!51>
      fe162e0b
    • Tanu Kaskinen's avatar
      core-util-test: Drop "modargs" from test function names · ef5a2f15
      Tanu Kaskinen authored
      These tests aren't directly related to modargs. I suppose these were
      first written for the modargs.h API and renaming was forgotten.
      
      Part-of: <!51>
      ef5a2f15
    • Tanu Kaskinen's avatar
      b76964e4
    • Tanu Kaskinen's avatar
      core-util: Never parse integers as octal · 6bc00720
      Tanu Kaskinen authored
      I believe nobody needs to pass octal numbers to PulseAudio, and if we
      encounter integer strings starting with zeros, the intention is to use
      them in base 10. Hexadecimal numbers are more common, and they can't be
      interpreted in base 10 anyway, so they are still supported.
      
      Part-of: <!51>
      6bc00720
    • Tanu Kaskinen's avatar
      core-util: Reduce repetition in number parsing functions · d50145a9
      Tanu Kaskinen authored
      Part-of: <!51>
      d50145a9
    • Tanu Kaskinen's avatar
      introspect: Add version check to pa_context_send_message_to_object() · 5d022a07
      Tanu Kaskinen authored
      If an application calls the function when the server doesn't support the
      feature, the result should be just an error from the function. Without
      the check the whole connection gets terminated due to protocol error.
      
      Part-of: <pulseaudio/pulseaudio!51>
      5d022a07
    • Tanu Kaskinen's avatar
      core-util: Make range checks easier to read · 6722b2d8
      Tanu Kaskinen authored
      It wasn't immediately obvious to me what these checks are supposed to
      do. Explicitly checking against the min/max values should make the code
      easier to understand.
      
      Part-of: <!51>
      6722b2d8
    • Georg Chini's avatar
      message-params: Add read functions for arrays · ff64defc
      Georg Chini authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      The following new functions have been added:
      
      pa_message_params_read_double_array() - read an array of double from list
      pa_message_params_read_int64_array() - read an array of int64 from list
      pa_message_params_read_uint64_array() - read an array of uint64 from list
      pa_message_params_read_string_array() - read an array of strings from list
      
      Part-of: <!51>
      ff64defc
    • Georg Chini's avatar
      message-params: Add read/write functions for various simple data types · 8140932a
      Georg Chini authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      The following functions have been added:
      
      pa_message_params_write_double() - writes a double to a pa_message_params structure
      pa_message_params_write_int64() - writes an integer to a pa_message_params structure
      pa_message_params_write_uint64() - writes an unsigned to a pa_message_params structure
      pa_message_params_write_bool() - writes a boolean to a pa_message_params structure
      
      pa_message_params_read_double() - read a double from a parameter list
      pa_message_params_read_int64() - read an integer from a parameter list
      pa_message_params_read_uint64() - read an unsigned from a parameter list
      pa_message_params_read_bool() - read a boolean from a parameter list
      
      The patch also improves the doxygen documentation im message-params.h
      
      Part-of: <!51>
      8140932a
    • Georg Chini's avatar
      core-util: Add pa_atoi64() and pa_atou64() functions · ca663886
      Georg Chini authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      Part-of: <!51>
      ca663886
    • Georg Chini's avatar
      message-params: Allow parameter strings to contain escaped curly braces · 590fd1ca
      Georg Chini authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      The patch adds the possibility to escape curly braces within parameter strings
      and introduces several new functions that can be used for writing parameters.
      
      For writing, the structure pa_message_params, which is a wrapper for pa_strbuf
      has been created. Following new write functions are available:
      
      pa_message_params_new() - creates a new pa_message_params structure
      pa_message_params_free() - frees a pa_message_params structure
      pa_message_param_to_string_free() - converts a pa_message_param to string and
      frees the structure
      pa_message_params_begin_list() - starts a list
      pa_message_params_end_list() - ends a list
      pa_message_params_write_string() - writes a string to a pa_message_params structure
      pa_message_params_write_raw() - writes a raw string to a pa_message_params structure
      
      For string parameters that contain curly braces or backslashes, those characters
      will be escaped when using pa_message_params_write_string(), while write_raw() will
      put the string into the buffer without any changes.
      
      For reading, pa_message_params_read_string() reverts the changes that
      pa_message_params_write_string() might have introduced.
      
      The patch also adds more restrictions on the object path name. Now only
      alphanumeric characters and one of "_", ".", "-" and "/" are allowed.
      The path name may not end with a / or contain a double slash. If the user
      specifies a trailing / when sending a message, it will be silently removed.
      
      Part-of: <!51>
      590fd1ca
    • Georg Chini's avatar
      pactl: Implement list message-handlers · 4a28b164
      Georg Chini authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      For better readability, "pactl list message-handlers" is introduced which
      prints a formatted output of "pactl send-message /core list-handlers".
      
      The patch also adds the functions pa_message_params_read_raw() and
      pa_message_params_read_string() for easy parsing of the message response
      string. Because the functions need to modify the parameter string,
      the message handler and the pa_context_string_callback function now
      receive a char* instead of a const char* as parameter argument.
      
      Part-of: <pulseaudio/pulseaudio!51>
      4a28b164
    • Georg Chini's avatar
      core: add message handler · 5c0ab521
      Georg Chini authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      This patch adds a small message handler to the core which enables
      clients to list available handlers via the list-handlers message.
      Command: pacmd send-message /core list-handlers
      pactl can be used with the same parameters.
      
      The patch also introduces a convention for the return string.
      It consists of a list of elements where curly braces are used
      to separate elements. Each element can itself contain further
      elements. For example consider a message that returns multiple
      elements which each contain an integer and an array of float.
      A response string would look like that:
      {{Integer} {{1st float} {2nd float} ...}}{...}
      
      Part-of: <!51>
      5c0ab521
    • Georg Chini's avatar
      pactl, pacmd, cli-command: Add send-message command · 68f2f139
      Georg Chini authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      Part-of: <!51>
      68f2f139
    • Georg Chini's avatar
      protocol-native: add message sending capability · 4cdc0053
      Georg Chini authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      This patch adds the PA_COMMAND_SEND_OBJECT_MESSAGE command to protocol-native
      so that clients can use the messaging feature introduced in the previous patch.
      
      Sending messages can in effect replace the extension system for modules. The
      approach is more flexible than the extension interface because a generic string
      format is used to exchange information. Furthermore the messaging system can be
      used for any object, not only for modules, and is easier to implement than
      extensions.
      
      Part-of: <!51>
      4cdc0053
  2. 30 Nov, 2020 1 commit
  3. 27 Nov, 2020 2 commits
  4. 26 Nov, 2020 1 commit
  5. 25 Nov, 2020 1 commit
  6. 24 Nov, 2020 1 commit
    • Christopher Snowhill's avatar
      virtual-surround-sink: Use FFTW3 instead of naive approach · 00bd8e1e
      Christopher Snowhill authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      This replaces the original virtual surround sink with a total
      rewrite, aiming to implement any number of hrir use cases,
      including asymmetrical impulses as two separate left and right
      output files. It uses FFTW3 FFT convolution, using the overlap-
      save method, with full rewind support. It operates in steps
      equal to the resampled length of the hrir, and overlaps input
      blocks in increments equal to the size of the FFT block. If
      using paired hrirs, it requires matched sample spec and sample
      rates and channel maps. For best results, the input files should
      have speaker maps, rather than expecting the sample loader to
      auto detect the mapping.
      
      Part-of: <pulseaudio/pulseaudio!240>
      00bd8e1e
  7. 23 Nov, 2020 17 commits
    • Arun Raghavan's avatar
      mutex-posix: Fix error assignment for unlock() check · 5f3717f3
      Arun Raghavan authored and Arun Raghavan's avatar Arun Raghavan committed
      This comment was missed in 757eb264.
      5f3717f3
    • Tanu Kaskinen's avatar
      alsa-mixer: Expand comments in the HP Thunderbolt Dock configuration · a73ec2a3
      Tanu Kaskinen authored and Arun Raghavan's avatar Arun Raghavan committed
      a73ec2a3
    • Kai-Heng Feng's avatar
      alsa-mixer: Add support for HP Thunderbolt Dock · 05c373d9
      Kai-Heng Feng authored and Arun Raghavan's avatar Arun Raghavan committed
      The HP Thunderbolt Dock [1] has two separate USB cards, a headset jack
      and an optional module which is a speakerphone.
      
      This patch adds new description for them, and mark the intended-roles as
      phone for the speakerphone module.
      
      [1] https://store.hp.com/us/en/pdp/hp-thunderbolt-dock-120w-g2-with-audio
      05c373d9
    • Nazar Mokrynskyi's avatar
      alsa-mixer: add mono input support for Behringer UMC22 · 69ba5a2b
      Nazar Mokrynskyi authored and Arun Raghavan's avatar Arun Raghavan committed
      69ba5a2b
    • Sanchayan Maity's avatar
      Add default.pa.d folder support · 45abd0b4
      Sanchayan Maity authored and Arun Raghavan's avatar Arun Raghavan committed
      The .include meta command already supports specifying a directory and
      when including a directory, all files with the extension '.pa' in that
      directory will be parsed in alphabetical order.
      
      This feature can be used to add support for default.pa.d directory, so
      that packages for other applications or users can just drop in a file
      for configuration without changing the default.pa which is shipped.
      
      We use the PA_DEFAULT_CONFIG_DIR for this, however, since meson quotes
      this build variable, introduce an unquoted version for this purpose and
      use it with .include.
      
      Fixes: pulseaudio/pulseaudio#909
      
      
      
      Signed-off-by: Sanchayan Maity's avatarSanchayan Maity <sanchayan@asymptotic.io>
      45abd0b4
    • Tanu Kaskinen's avatar
      alsa-mixer: Add support for the Center/LFE element · a28f2e72
      Tanu Kaskinen authored and Arun Raghavan's avatar Arun Raghavan committed
      We already supported the CLFE element, which should be semantically
      equivalent, so I just copied all the CLFE element definitions.
      
      The Center/LFE element is seen on Creative X-Fi with 20K1 chipset cards.
      
      Fixes: #978
      a28f2e72
    • Tanu Kaskinen's avatar
      main: set LC_NUMERIC to C · d5d08035
      Tanu Kaskinen authored and Arun Raghavan's avatar Arun Raghavan committed
      The webrtc backend of module-echo-cancel uses sscanf() to parse floating
      point numbers from module arguments, which didn't work when the locale
      used a comma for the decimal point. Setting the LC_NUMERIC locale
      variable to C makes the pulseaudio process use a period as the decimal
      point regardless of the user's locale configuration.
      
      Fixes: pulseaudio/pulseaudio#89
      d5d08035
    • Tanu Kaskinen's avatar
      mutex-posix: Log pthread_mutex_unlock() error · 757eb264
      Tanu Kaskinen authored and Arun Raghavan's avatar Arun Raghavan committed
      This call has been seen failing on FreeBSD, and it's difficult to debug
      without seeing which error the function returned.
      
      Fixes: pulseaudio/pulseaudio#988
      757eb264
    • Tanu Kaskinen's avatar
      raop-sink: Don't set device.intended_roles=music · 093dd2f1
      Tanu Kaskinen authored and Arun Raghavan's avatar Arun Raghavan committed
      If there are RAOP devices in the network, it doesn't necessarily mean
      that the user wants to play music to them.
      
      Fixes: pulseaudio/pulseaudio#993
      093dd2f1
    • Arun Raghavan's avatar
      stream-restore,device-restore: Avoid unaligned access · 9055f5ba
      Arun Raghavan authored and Arun Raghavan's avatar Arun Raghavan committed
      Newer GCC warns us that the channel_map and volume in legacy entries are
      accessed via pointers, and these might be unaligned as the legacy entry
      is a packed structure. For this reason, we read out those values into
      local variables before accessing them as pointers.
      
      The warnings are:
      
      [146/433] Compiling C object src/modules/module-device-restore.so.p/module-device-restore.c.o
      ../src/modules/module-device-restore.c: In function ‘legacy_entry_read’:
      ../src/modules/module-device-restore.c:554:51: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
        554 |     if (le->volume_valid && !pa_channel_map_valid(&le->channel_map)) {
            |                                                   ^~~~~~~~~~~~~~~~
      ../src/modules/module-device-restore.c:559:48: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
        559 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
            |                                                ^~~~~~~~~~~
      ../src/modules/module-device-restore.c:559:104: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
        559 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
            |                                                                                                        ^~~~~~~~~~~
      ../src/modules/module-device-restore.c:559:117: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
        559 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
            |                                                                                                                     ^~~~~~~~~~~~~~~~
      [211/433] Compiling C object src/modules/module-stream-restore.so.p/module-stream-restore.c.o
      ../src/modules/module-stream-restore.c: In function ‘legacy_entry_read’:
      ../src/modules/module-stream-restore.c:1076:51: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
       1076 |     if (le->volume_valid && !pa_channel_map_valid(&le->channel_map)) {
            |                                                   ^~~~~~~~~~~~~~~~
      ../src/modules/module-stream-restore.c:1081:48: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
       1081 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
            |                                                ^~~~~~~~~~~
      ../src/modules/module-stream-restore.c:1081:104: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
       1081 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
            |                                                                                                        ^~~~~~~~~~~
      ../src/modules/module-stream-restore.c:1081:117: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
       1081 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
            |
      9055f5ba
    • Arun Raghavan's avatar
      glib-mainloop: Drop deprecated g_get_current_time() usage · c442227c
      Arun Raghavan authored and Arun Raghavan's avatar Arun Raghavan committed
      This uses the year 2038-safe g_get_real_time() as recommended instead.
      Bumps GLib dependency to 2.28 as a result.
      c442227c
    • Arun Raghavan's avatar
      proplist-util: Drop deprecated G_CONST_RETURN macro · b546beef
      Arun Raghavan authored and Arun Raghavan's avatar Arun Raghavan committed
      The preference in glib is now to just use the const qualifier directly.
      b546beef
    • Arun Raghavan's avatar
      build-sys: Bump libpulse soversion · d1e0594e
      Arun Raghavan authored
      This is because we reverted the previous API breaking change to the
      meaning of the pa_mainloop_prepare() timeout argument.
      d1e0594e
    • Arun Raghavan's avatar
      Revert "mainloop: fix timeout assignment in pa_mainloop_prepare" · e6b3edd3
      Arun Raghavan authored and Arun Raghavan's avatar Arun Raghavan committed
      This reverts commit 6b1719d0, as it
      inadvertently broke the semantics of timeout in the API.
      
      Fixes: pulseaudio/pulseaudio#1039
      e6b3edd3
    • Tanu Kaskinen's avatar
      build-sys: Disable GStreamer by default with Autotools · 2ea425d1
      Tanu Kaskinen authored
      With Meson GStreamer is already disabled by default, let's match that
      with Autotools.
      2ea425d1
    • pali's avatar
      alsa: Fix compile warnings · e99e862a
      pali authored and Tanu Kaskinen's avatar Tanu Kaskinen committed
      modules/alsa/alsa-sink.c: In function ‘pa_alsa_sink_new’:
      modules/alsa/alsa-sink.c:2603:15: warning: declaration of ‘state’ shadows a previous local [-Wshadow]
               void *state;
                     ^~~~~
      modules/alsa/alsa-sink.c:2270:11: note: shadowed declaration is here
           void *state = NULL;
                 ^~~~~
        CC       modules/alsa/module_alsa_sink_la-module-alsa-sink.lo
      modules/alsa/alsa-source.c: In function ‘pa_alsa_source_new’:
      modules/alsa/alsa-source.c:2289:15: warning: declaration of ‘state’ shadows a previous local [-Wshadow]
               void *state;
                     ^~~~~
      modules/alsa/alsa-source.c:1975:11: note: shadowed declaration is here
           void *state = NULL;
                 ^~~~~
      modules/alsa/module-alsa-card.c: In function ‘prune_singleton_availability_groups’:
      modules/alsa/module-alsa-card.c:691:71: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
                   pa_hashmap_put(group_counts, p->availability_group, count + 1);
                                                                             ^
      e99e862a
    • Tanu Kaskinen's avatar
      switch-on-port-available: Fix switching away from unplugged headphones · eaa6d5d6
      Tanu Kaskinen authored and Arun Raghavan's avatar Arun Raghavan committed
      Commits 323195e3 ("switch-on-port-available: Switch to headphones on
      unknown availability") and d83ad699 ("module-alsa-card: Drop
      availability groups with only one port") broke switching from headphones
      to speakers when headphones are unplugged. switch_from_port() selects
      speakers, whose availability is unknown and availability group is unset,
      and then calls switch_to_port(). The new logic in switch_on_port()
      unintentionally blocked that switch.
      
      This patch moves the problematic logic from switch_to_port() to
      port_available_hook_callback() where it doesn't interfere with
      switch_from_port().
      
      Fixes: pulseaudio/pulseaudio#1043
      eaa6d5d6