From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9oZ6-0006aD-Ej for qemu-devel@nongnu.org; Mon, 06 Jun 2016 03:03:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9oYx-0005hP-MD for qemu-devel@nongnu.org; Mon, 06 Jun 2016 03:03:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9oYx-0005hA-Dx for qemu-devel@nongnu.org; Mon, 06 Jun 2016 03:03:03 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0176E65409 for ; Mon, 6 Jun 2016 07:03:03 +0000 (UTC) From: Gerd Hoffmann Date: Mon, 6 Jun 2016 09:02:55 +0200 Message-Id: <1465196579-26804-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1465196579-26804-1-git-send-email-kraxel@redhat.com> References: <1465196579-26804-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 1/5] audio: pa: Set volume of recording stream instead of recording device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Krempa , Gerd Hoffmann From: Peter Krempa Since pulseaudio 1.0 it's possible to set the individual stream volume rather than setting the device volume. With this, setting hardware mixer of a emulated sound card doesn't mess up the volume configuration of the host. A side effect is that this limits compatible pulseaudio version to 1.0 which was released on 2011-09-27. Signed-off-by: Peter Krempa Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 78853815be2069971b89b3a2e3181837064dd8f3.1462962512.git.pkrem= pa@redhat.com Signed-off-by: Gerd Hoffmann --- audio/paaudio.c | 11 +++++------ configure | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index 57678e7..65beb6f 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -781,23 +781,22 @@ static int qpa_ctl_in (HWVoiceIn *hw, int cmd, ...) =20 pa_threaded_mainloop_lock (g->mainloop); =20 - /* FIXME: use the upcoming "set_source_output_{volume,mute}"= */ - op =3D pa_context_set_source_volume_by_index (g->context, - pa_stream_get_device_index (pa->stream), + op =3D pa_context_set_source_output_volume (g->context, + pa_stream_get_index (pa->stream), &v, NULL, NULL); if (!op) { qpa_logerr (pa_context_errno (g->context), - "set_source_volume() failed\n"); + "set_source_output_volume() failed\n"); } else { pa_operation_unref(op); } =20 - op =3D pa_context_set_source_mute_by_index (g->context, + op =3D pa_context_set_source_output_mute (g->context, pa_stream_get_index (pa->stream), sw->vol.mute, NULL, NULL); if (!op) { qpa_logerr (pa_context_errno (g->context), - "set_source_mute() failed\n"); + "set_source_output_mute() failed\n"); } else { pa_operation_unref (op); } diff --git a/configure b/configure index b5aab72..6d01d96 100755 --- a/configure +++ b/configure @@ -2813,8 +2813,8 @@ for drv in $audio_drv_list; do ;; =20 pa) - audio_drv_probe $drv pulse/mainloop.h "-lpulse" \ - "pa_mainloop *m =3D 0; pa_mainloop_free (m); return 0;" + audio_drv_probe $drv pulse/pulseaudio.h "-lpulse" \ + "pa_context_set_source_output_volume(NULL, 0, NULL, NULL, NULL);= return 0;" libs_softmmu=3D"-lpulse $libs_softmmu" audio_pt_int=3D"yes" ;; --=20 1.8.3.1