summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* mixer-control: fix gvc_mixer_card_set_profiles API usageHEADmasterPauli Virtanen2022-01-121-1/+2
| | | | | | | | | In update_card, profile_list is incorrectly used also after its ownership is transferred to the GvcMixerCard. In practice, this causes e.g. some profiles to go missing due to the list head being clobbered. Fix this by calling gvc_mixer_card_set_profiles only after profiles_list is no longer used for any other purpose.
* mixer-control: Rely on stream-id on device for cardless devicesJonas Ådahl2021-03-151-20/+28
| | | | | | | | | | | | | | Some devices don't have a card to match against, (e.g. network sinks), which would make 'match_stream_with_devices()' get confused and log warnings about missing card devices when trying to match streams with devices. Avoid this by marking a stream as 'in-possession' if there was already a device with the stream ID set to it. This fixes warning like (gnome-shell:3521215): Gvc-CRITICAL **: 10:57:07.155: gvc_mixer_card_get_index: assertion 'GVC_IS_MIXER_CARD (card)' failed
* mixer-control: do not use port name string to select the headset portsJaroslav Kysela2020-09-171-22/+32
| | | | | | | | | It is a bad idea to use the variable port name to check the port type. Use only the new port type and availability group string for the decision. Also, select the ports by priority, if there multiple ports with the similar type.
* mixer-control: consolidate port finding and setting with/without ucmHui Wang2020-09-171-19/+110
| | | | | | | | | | | | | | | | | | | | | | | | | Recently Intel added a new audio driver in the Linux kernel, it is called sof driver. This driver is needed on the laptops which connects the digital mic to the PCH instead of the codec. To make the sof driver work with pulseaudio, the ucm is mandatory. With the ucm, the multi-function audio jack has different port names in the pulseaudio from the one without ucm, these are the port names with the ucm: [In] Mic1: Digital Microphone [In] Mic2: Headphones Stereo Microphone [In] Headset: Headset Mono Microphone [Out] Headphones: Headphones [Out] Speaker: Speaker To make the audio device selection work on the machines using the ucm, the pulseaudio introduces a change to add 2 new members in the device port structure from the PA_PROTOCOL_VERSION=34, with these 2 members' help, we could consolidate the port finding and setting for both with ucm and without ucm. And this patch maintains the backward compatibility with the PA_PROTOCOL_VERSION < 34.
* mixer-control: fix -Wsign-compare warningsAlberts Muktupāvels2020-04-091-3/+3
| | | | | headset_card type is changed from int to guint32 to match uint32_t used in PulseAudio's pa_card_info struct.
* test-audio-device-selection: fix -Wdiscarded-qualifiers warningsAlberts Muktupāvels2020-04-091-3/+3
|
* test-audio-device-selection: fix -Wsign-compare warningAlberts Muktupāvels2020-04-091-1/+1
|
* mixer-control: fix -Wswitch-enum warningsAlberts Muktupāvels2020-04-091-0/+3
| | | | | | | | | Warnings introduced in ec5cf3e0de6715803e64b65abb059e2155b3d6de: gvc-mixer-control.c:1457:9: warning: enumeration value ‘PA_SINK_INIT’ not handled in switch [-Wswitch-enum] gvc-mixer-control.c:1457:9: warning: enumeration value ‘PA_SINK_UNLINKED’ not handled in switch [-Wswitch-enum] Warning building with alsa: gvc-mixer-control.c:2218:9: warning: enumeration value ‘GVC_HEADSET_PORT_CHOICE_NONE’ not handled in switch [-Wswitch-enum]
* build: ignore .dirstamp fileAlberts Muktupāvels2020-04-091-0/+1
|
* build: Bump pulseaudio dependencyCarlos Garnacho2020-04-091-1/+1
| | | | | | | We need 12.99.3 in order to avoid deadlocks on Xwayland startup, see https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/79a8efb45cb8304967baa2e8c6d6156478ce19d9 Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2599
* mixer-control: Expose stream stateFlorian Müllner2019-11-234-4/+73
| | | | | | | The state can be used to determine whether audio is currently playing or not, which can be useful information. https://gitlab.gnome.org/GNOME/libgnome-volume-control/merge_requests/8
* build: Don't limit pulseaudio-fake header to introspectionFlorian Müllner2019-11-231-4/+0
| | | | | | We'll soon need the types for glib-mkenums as well. https://gitlab.gnome.org/GNOME/libgnome-volume-control/merge_requests/8
* build: Drop autotools supportFlorian Müllner2019-11-223-110/+0
| | | | | | | | All of gnome-control-center, gnome-settings-daemon and gnome-shell are meson-only nowadays, so there seems little point in supporting two build systems. https://gitlab.gnome.org/GNOME/libgnome-volume-control/merge_requests/9
* ci: Use meson for CI buildFlorian Müllner2019-11-223-2/+28
| | | | | | | | | | | All consumers of the submodule switched to meson, except the CI build. It neither seems useful to maintain a second build system just for that purpose, nor to test a configuation that isn't used by anybody. So set up a small fake project that includes gvc as a subproject, and build that during CI. https://gitlab.gnome.org/GNOME/libgnome-volume-control/merge_requests/9
* mixer-control: Use the "emblem-system-symbolic" iconGeorges Basile Stavracas Neto2019-06-141-1/+1
| | | | | | | As suggested by the last round of design review [1], use the "emblem-system-symbolic" icon with system sounds. [1] https://gitlab.gnome.org/GNOME/gnome-control-center/issues/548
* Add missing guards for inputs to functionsRobert Ancell2019-03-183-1/+30
|
* Add missing allow-none annotationsRobert Ancell2019-03-183-2/+11
|
* ci: Add CIBastien Nocera2019-02-271-0/+11
| | | | | This just builds the "what-did-you-plugin" test application, but it's good enough to catch the worst failures.
* Comment invalid <category> in DOAP file to pass git pre-receive hookAndre Klapper2018-12-161-1/+1
|
* gvc-mixer-ui-device: Trim additional newlines in debug outputGuido Günther2018-12-071-6/+6
| | | | | GVC logs a lot aready. No need to make it consume more screen space with additional newlines.
* Merge branch 'wip/muktupavels/warnings' into 'master'Bastien Nocera2018-09-1010-62/+22
|\ | | | | | | | | Fix build warnings See merge request GNOME/libgnome-volume-control!2
| * fix cast-function-type warningsAlberts Muktupāvels2018-09-102-4/+2
| | | | | | | | | | | | | | | | | | | | gvc-mixer-card.c: In function ‘gvc_mixer_card_finalize’: gvc-mixer-card.c:571:53: warning: cast between incompatible function types from ‘void (*)(GvcMixerCardProfile *)’ {aka ‘void (*)(struct <anonymous> *)’} to ‘void (*)(void *, void *)’ [-Wcast-function-type] g_list_foreach (mixer_card->priv->profiles, (GFunc) free_profile, NULL); gvc-mixer-stream.c: In function ‘gvc_mixer_stream_finalize’: gvc-mixer-stream.c:1044:52: warning: cast between incompatible function types from ‘void (*)(GvcMixerStreamPort *)’ {aka ‘void (*)(struct <anonymous> *)’} to ‘void (*)(void *, void *)’ [-Wcast-function-type] g_list_foreach (mixer_stream->priv->ports, (GFunc) free_port, NULL);
| * avoid deprecated g_type_class_add_privateAlberts Muktupāvels2018-09-0910-58/+20
|/
* Merge branch 'wip/fmuellner/remove-rpath' into 'master'Bastien Nocera2018-09-071-1/+0
|\ | | | | | | | | build: Remove bogus rpath See merge request GNOME/libgnome-volume-control!1
| * build: Remove bogus rpathwip/fmuellner/remove-rpathFlorian Müllner2018-08-201-1/+0
| | | | | | | | | | | | | | If anything it should be `pkglibdir`, but as it looks like nobody lost their volume controls, it's apparently not needed at all. https://gitlab.gnome.org/GNOME/libgnome-volume-control/merge_requests/1
* | README: Add READMEBastien Nocera2018-09-071-0/+12
|/ | | | Closes: #1
* build: Remove config.h template fileIñigo Martínez2018-01-302-5/+1
| | | | | | | | | | | | | The `config.h` can be generated without any template. This patch removes the template file and modifies the build file to not make any use of it. It also removes the variable which holds the generated configuration file target, as it will not be necessary for any packages building libgnome-volume-control. https://bugzilla.gnome.org/show_bug.cgi?id=792948
* build: Remove the include directory variableIñigo Martínez2018-01-301-5/+1
| | | | | | | | | | | | The variable which holds the current directory is not necessary because this is already included when building the library. However, it might be interessant for any package using the library to include the directory where headers are present, so the current directory is appended to the library dependency without the include directory variable. https://bugzilla.gnome.org/show_bug.cgi?id=792948
* build: Make use of assert functionIñigo Martínez2018-01-301-11/+4
| | | | | | | | | | | | | | | meson has support for `assert` function, which halts meson's execution showing a given message when a given condition is false. This patch takes advantage of this function to slightly improve meson's build file readibility. It also removes a duplicated check for `pkglibdir` being set when introspection is also set, because this check is already done when a shared library is being created, that is a precondition for introspection generation. https://bugzilla.gnome.org/show_bug.cgi?id=792948
* build: Do not use headers on library buildingIñigo Martínez2018-01-301-16/+19
| | | | | | | | | | | | Headers are not necessary to be passed to the library compilation function because the compiler will find them. On the other hand they are necessary for the proper GIR generation. This patch splits headers and sources, uses only sources for the library building and uses both for GIR generation. It also allows getting both separately. https://bugzilla.gnome.org/show_bug.cgi?id=792948
* build: Remove dependencies' variablesIñigo Martínez2018-01-301-9/+4
| | | | | | | | | | A set of different variables are used to hold dependencies. However, no individual use of them is done. This patch removes these variables and holds their objects directly in the array of dependencies. https://bugzilla.gnome.org/show_bug.cgi?id=792948
* build: Rename build optionsIñigo Martínez2018-01-302-11/+11
| | | | | | | | | | | | | | Following the meson porting guidelines, this patch renames the build options. The list of changes is as follows: - Remove the with prefix from string options. - The character separator from multi-word options has been changed to underscore. It also changes the introspection and static meson variables to be consistent with the one used for alsa. https://bugzilla.gnome.org/show_bug.cgi?id=792948
* build: Make ALSA support optionalIñigo Martínez2018-01-262-10/+19
| | | | | | | | | ALSA support is not mandatory for libgnome-volume-control, but it can not be made optional. This patch makes the ALSA support optional by using an option. https://bugzilla.gnome.org/show_bug.cgi?id=792919
* Fix unused GIR transfer notation on integer valuesRobert Ancell2017-12-061-2/+2
|
* Fix printf without supplied argumentRobert Ancell2017-12-061-1/+1
|
* mixer-control: Fix a typo in a debug messageDmitry Shachnev2017-10-051-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=788565
* build: Don't include sources either ...Florian Müllner2017-08-101-2/+1
| | | | | The dependency already specifies the library to link with, no need to also list the sources used to compile said library.
* build: Don't include c_args in dependencyFlorian Müllner2017-07-221-1/+0
| | | | | | | The defines are only relevant for compiling libgvc itself, not for any consumers of the library. In fact, setting G_LOG_DOMAIN is likely to conflict with the log domain defined by the including project ...
* build: Fix non-alsa buildsFlorian Müllner2017-07-201-1/+1
| | | | | The code only checks whether HAVE_ALSA is defined, not its value, so defining it to 0 doesn't work as expected ...
* Add support for building with mesonmesonFlorian Müllner2017-05-293-0/+185
| | | | | | | | Allow the module to be included as a meson subproject() in addition to the existing autotools support. Based heavily on the meson support in https://git.gnome.org/browse/libgd. https://bugzilla.gnome.org/show_bug.cgi?id=783207
* mixer-control: Fix selecting Bluetooth input when on A2DP profileDavid Henningsson2017-04-061-3/+3
| | | | | | | | | | When on A2DP profile and a Bluetooth input is selected, we first need to switch the profile to HFP/HSP, then select the default source to be that profile. In some cases the latter step was forgotten, because the variable "profile_swapping_device_id" was reset before it was supposed to be used. https://bugzilla.gnome.org/show_bug.cgi?id=736943
* mixer-control: Fix extra reference being leakedBastien Nocera2017-04-061-2/+2
| | | | | | | | | | In both cases objects are inserted in hash table by adding an extra ref, but the existing reference was never removed. Don't add a reference instead, so we don't end up with a spare one. Based on patch by Alberts Muktupāvels <alberts.muktupavels@gmail.com> https://bugzilla.gnome.org/show_bug.cgi?id=765694
* gvc-mixer-control: Really fix double-free when setting headsetBastien Nocera2016-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | In a28e23d9006a32c8982ad8bda11fec131c6b36e8, we said: The callbacks will be called repeatedly, once with data, and later on with eol == 0. Make sure to only free it when we get the eol call instead of once we've applied the settings. Whereas the docs say: When requesting all of these [instances] at once, the callback will be called multiple times, once for each object. When the list has been exhausted, the callback will be called without an information structure and the eol parameter set to a positive value. If an error occurs, the callback will be invoked without an information structure and eol set to a negative value. So, in all, we need to free our callback data when eol is positive, or negative. So, when it's not 0. Seems we got lucky in the original commit because the test machine only had a single soundcard.
* tests: Add audio device selection questionBastien Nocera2016-04-172-8/+30
| | | | So that the test utility mimicks the code in gnome-settings-daemon.
* tests: Add a Makefile for testsBastien Nocera2016-04-174-0/+109
| | | | | And add a test for the audio device selection feature, added in GNOME 3.20.
* gvc-mixer-control: Fix memory leak on error pathBastien Nocera2016-02-221-2/+2
| | | | | When setting the headset port, make sure to also free the work data if eol is negative, eg. if the call failed.
* gvc-mixer-control: Fix double-free when setting headsetBastien Nocera2016-02-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The callbacks will be called repeatedly, once with data, and later on with eol == 0. Make sure to only free it when we get the eol call instead of once we've applied the settings. Example valgrind output: ==31715== Invalid read of size 8 ==31715== at 0x24529E09: port_status_data_free (gvc-mixer-control.c:2079) ==31715== by 0x1DB81344: ??? (in /usr/lib64/libpulse.so.0.18.2) ==31715== by 0x1DDF3FE0: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DDF436A: pa_pdispatch_run (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DB7507D: ??? (in /usr/lib64/libpulse.so.0.18.2) ==31715== by 0x1DDF6B5E: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DDF91BA: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DDF9568: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DDF9DF9: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1D96202A: ??? (in /usr/lib64/libpulse-mainloop-glib.so.0.0.5) ==31715== by 0x7AA7CF9: g_main_dispatch (gmain.c:3154) ==31715== by 0x7AA7CF9: g_main_context_dispatch (gmain.c:3769) ==31715== by 0x7AA8057: g_main_context_iterate.isra.29 (gmain.c:3840) ==31715== Address 0x2bd83480 is 0 bytes inside a block of size 16 free'd ==31715== at 0x4C2ED6A: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==31715== by 0x7AAD2AD: g_free (gmem.c:189) ==31715== by 0x1DB81562: ??? (in /usr/lib64/libpulse.so.0.18.2) ==31715== by 0x1DDF3FE0: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DDF436A: pa_pdispatch_run (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DB7507D: ??? (in /usr/lib64/libpulse.so.0.18.2) ==31715== by 0x1DDF6B5E: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DDF91BA: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DDF9568: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1DDF9DF9: ??? (in /usr/lib64/pulseaudio/libpulsecommon-7.1.so) ==31715== by 0x1D96202A: ??? (in /usr/lib64/libpulse-mainloop-glib.so.0.0.5) ==31715== by 0x7AA7CF9: g_main_dispatch (gmain.c:3154) ==31715== by 0x7AA7CF9: g_main_context_dispatch (gmain.c:3769) ==31715== Block was alloc'd at ==31715== at 0x4C2F9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==31715== by 0x7AAD1F0: g_malloc0 (gmem.c:124) ==31715== by 0x2452A39D: gvc_mixer_control_set_port_status_for_headset (gvc-mixer-control.c:2173) ==31715== by 0x2451BE81: audio_selection_done (gsd-media-keys-manager.c:2489) ==31715== by 0x7550ED3: emit_signal_instance_in_idle_cb (gdbusconnection.c:3701) ==31715== by 0x7AA7CF9: g_main_dispatch (gmain.c:3154) ==31715== by 0x7AA7CF9: g_main_context_dispatch (gmain.c:3769) ==31715== by 0x7AA8057: g_main_context_iterate.isra.29 (gmain.c:3840) ==31715== by 0x7AA8371: g_main_loop_run (gmain.c:4034) ==31715== by 0x5CEA204: gtk_main (gtkmain.c:1246) ==31715== by 0x403804: main (main.c:434)
* gvc-mixer-control: Fix uninitialized variable usageRui Matos2016-02-111-4/+4
|
* gvc: Add "what did you plug in" support APIBastien Nocera2016-01-172-0/+372
| | | | | | | | | | | | | | | | | | | | Add "audio-device-selection-needed" which will be emitted when a headphones, headset or microphone is plugged into a jack socket that cannot detect which type it was. Once the user of libgnome-volume-control has asked the user which type of device this was, they can call gvc_mixer_control_set_headset_port() to switch the ports for that configuration. Note that gvc_mixer_control_set_headset_port() supports passing the card ID, but the detection code only supports a single such device. When we find hardware that can support > 1 such device, we can test and implement support without breaking the API. Based on the original code by David Henningsson <david.henningsson@canonical.com> for the unity-settings-daemon https://bugzilla.gnome.org/show_bug.cgi?id=755062
* gvc-mixer-source-output: Update volume and mute statusCarlos Silva2016-01-122-3/+54
| | | | | | | This commit implements notifying about volume and mute status changes for source outputs (applications that monitor the microphone, in short). https://bugzilla.gnome.org/show_bug.cgi?id=760387