[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/10] Do not use pa_simple PulseAudio API
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH 07/10] Do not use pa_simple PulseAudio API |
Date: |
Mon, 23 Apr 2012 10:55:31 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2012-04-17 14:32, Marc-André Lureau wrote:
> Unfortunately, pa_simple is a limited API which doesn't let us
> retrieve the associated pa_stream. It is needed to control the volume
> of the stream.
>
> In v4:
> - add missing braces
>
> Signed-off-by: Marc-André Lureau <address@hidden>
...
> +
> +static pa_stream *qpa_simple_new (
> + const char *server,
> + const char *name,
> + pa_stream_direction_t dir,
> + const char *dev,
> + const char *stream_name,
> + const pa_sample_spec *ss,
> + const pa_channel_map *map,
> + const pa_buffer_attr *attr,
> + int *rerror)
rerror is not even used in this function...
> +{
> + paaudio *g = &glob_paaudio;
> + int r;
> + pa_stream *stream;
> +
> + pa_threaded_mainloop_lock (g->mainloop);
> +
> + stream = pa_stream_new (g->context, name, ss, map);
> + if (!stream) {
> + goto fail;
> + }
> +
> + pa_stream_set_state_callback (stream, stream_state_cb, g);
> + pa_stream_set_read_callback (stream, stream_request_cb, g);
> + pa_stream_set_write_callback (stream, stream_request_cb, g);
> +
> + if (dir == PA_STREAM_PLAYBACK) {
> + r = pa_stream_connect_playback (stream, dev, attr,
> + PA_STREAM_INTERPOLATE_TIMING
> + |PA_STREAM_ADJUST_LATENCY
> + |PA_STREAM_AUTO_TIMING_UPDATE, NULL,
> NULL);
> + } else {
> + r = pa_stream_connect_record (stream, dev, attr,
> + PA_STREAM_INTERPOLATE_TIMING
> + |PA_STREAM_ADJUST_LATENCY
> + |PA_STREAM_AUTO_TIMING_UPDATE);
> + }
> +
> + if (r < 0) {
> + goto fail;
> + }
> +
> + pa_threaded_mainloop_unlock (g->mainloop);
> +
> + return stream;
> +
> +fail:
> + pa_threaded_mainloop_unlock (g->mainloop);
> +
> + if (stream) {
> + pa_stream_unref (stream);
> + }
> +
> + qpa_logerr (pa_context_errno (g->context),
> + "stream_new() failed\n");
> +
> + return NULL;
> +}
> +
> static int qpa_init_out (HWVoiceOut *hw, struct audsettings *as)
> {
> int error;
> @@ -306,24 +534,24 @@ static int qpa_init_out (HWVoiceOut *hw, struct
> audsettings *as)
>
> obt_as.fmt = pa_to_audfmt (ss.format, &obt_as.endianness);
>
> - pa->s = pa_simple_new (
> - conf.server,
> + pa->stream = qpa_simple_new (
> + glob_paaudio.server,
> "qemu",
> PA_STREAM_PLAYBACK,
> - conf.sink,
> + glob_paaudio.sink,
> "pcm.playback",
> &ss,
> NULL, /* channel map */
> &ba, /* buffering attributes */
> &error
> );
> - if (!pa->s) {
> + if (!pa->stream) {
> qpa_logerr (error, "pa_simple_new for playback failed\n");
...but here (and below) we depend on it to be initialized. This breaks
the build. Please fix.
Thanks,
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
- [Qemu-devel] [PATCH 00/10] apply volume on client side v5 bis, Marc-André Lureau, 2012/04/17
- [Qemu-devel] [PATCH 01/10] audio: add VOICE_VOLUME ctl, Marc-André Lureau, 2012/04/17
- [Qemu-devel] [PATCH 02/10] audio: don't apply volume effect if backend has VOICE_VOLUME_CAP, Marc-André Lureau, 2012/04/17
- [Qemu-devel] [PATCH 03/10] hw/ac97: remove USE_MIXER code, Marc-André Lureau, 2012/04/17
- [Qemu-devel] [PATCH 04/10] hw/ac97: the volume mask is not only 0x1f, Marc-André Lureau, 2012/04/17
- [Qemu-devel] [PATCH 05/10] hw/ac97: add support for volume control, Marc-André Lureau, 2012/04/17
- [Qemu-devel] [PATCH 09/10] Allow controlling volume with PulseAudio backend, Marc-André Lureau, 2012/04/17
- [Qemu-devel] [PATCH 10/10] Enable mixemu by default, add runtime option, Marc-André Lureau, 2012/04/17
- [Qemu-devel] [PATCH 07/10] Do not use pa_simple PulseAudio API, Marc-André Lureau, 2012/04/17
- Re: [Qemu-devel] [PATCH 07/10] Do not use pa_simple PulseAudio API,
Jan Kiszka <=
- [Qemu-devel] [PATCH 08/10] configure: pa_simple is not needed anymore, Marc-André Lureau, 2012/04/17
- [Qemu-devel] [PATCH 06/10] audio/spice: add support for volume control, Marc-André Lureau, 2012/04/17