[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume |
Date: |
Fri, 02 May 2008 09:41:48 +0200 |
User-agent: |
Thunderbird 2.0.0.12 (X11/20080226) |
andrzej zaborowski wrote:
> I'd like to merge the following instead, I see no point in removing
> per voice volume control if we're still doing scaling in software. On
> top of that I would apply your wm8750 patch - I have it running now
> and volume setting in MusicPal UI works nicely.
No fundamental concerns.
>
> The user still needs to disable NOVOL if they really want volume control.
What is the "user" here? wm8750? musicpal? I just hope it is not the
real user... :)
[ QEMU audio setup is already weird enough: I recently tried to get ALSA
running to overcome outdated OSS - well, tricky. Needs fixing. ]
> diff --git a/audio/audio.c b/audio/audio.c
> index 9e7fe80..1231ec5 100644
> --- a/audio/audio.c
> +++ b/audio/audio.c
> @@ -1955,3 +1955,21 @@ void AUD_del_capture (CaptureVoiceOut *cap,
> void *cb_opaque)
> }
> }
> }
> +
> +void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t
> rvol)
> +{
> + if (sw) {
> + sw->vol.mute = mute;
> + sw->vol.l = nominal_volume.l * lvol / 255;
> + sw->vol.r = nominal_volume.r * rvol / 255;
As this scaling looks fairly different from my version, I have to test
and think about it first. But my current feeling is that you do not get
the same range. But the API is fine.
> + }
> +}
> +
> +void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol)
> +{
> + if (sw) {
> + sw->vol.mute = mute;
> + sw->vol.l = nominal_volume.l * lvol / 255;
> + sw->vol.r = nominal_volume.r * rvol / 255;
> + }
> +}
> diff --git a/audio/audio.h b/audio/audio.h
> index ec9eee4..ae29b8a 100644
> --- a/audio/audio.h
> +++ b/audio/audio.h
> @@ -124,6 +124,9 @@ int AUD_is_active_out (SWVoiceOut *sw);
> void AUD_init_time_stamp_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts);
> uint64_t AUD_get_elapsed_usec_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts);
>
> +void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t
> rvol);
> +void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol);
> +
> SWVoiceIn *AUD_open_in (
> QEMUSoundCard *card,
> SWVoiceIn *sw,
Jan
signature.asc
Description: OpenPGP digital signature