From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [RFC][PATCH 4/4] Add support for Marvell 88w8618 / MusicPal
Date: Mon, 14 Apr 2008 23:34:44 +0200 [thread overview]
Message-ID: <4803CDF4.3010503@web.de> (raw)
In-Reply-To: <4803AEB6.5020307@web.de>
[-- Attachment #1: Type: text/plain, Size: 873 bytes --]
Jan Kiszka wrote:
> +static void audio_fill_mixer_buffer(mv88w8618_audio_state *s, unsigned int length)
> +{
> + unsigned int pos;
> + double val;
> +
> + if (s->mute) {
> + memset(s->mixer_buffer, 0, length);
> + return;
> + }
> +
> + if (s->playback_mode & 1)
> + for (pos = 0; pos < length; pos += 2) {
> + val = *(int16_t *)(s->target_buffer + s->play_pos + pos);
> + val = le16_to_cpu(val) * pow(10.0, s->volume/20.0);
> + *(int16_t *)(s->mixer_buffer + pos) = val;
> + }
This variant "sounds" better:
for (pos = 0; pos < length; pos += 2) {
uint16_t tmp = *(uint16_t *)
(s->target_buffer + s->play_pos + pos);
val = (int16_t)le16_to_cpu(tmp);
val = val * pow(10.0, s->volume/20.0);
*(int16_t *)(s->mixer_buffer + pos) = val;
}
Find latest patches at http://home.arcor.de/jan.kiszka/patches/QEMU/
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
next prev parent reply other threads:[~2008-04-14 21:34 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-13 10:11 [Qemu-devel] [RFC][PATCH 4/4] Add support for Marvell 88w8618 / MusicPal Jan Kiszka
2008-04-13 20:52 ` malc
2008-04-14 6:59 ` [Qemu-devel] " Jan Kiszka
2008-04-14 13:12 ` Stuart Brady
2008-04-14 16:21 ` Jan Kiszka
2008-04-14 16:49 ` malc
2008-04-14 17:47 ` Jan Kiszka
2008-04-15 17:38 ` malc
2008-04-15 21:03 ` Jan Kiszka
2008-04-16 18:40 ` malc
2008-04-17 19:06 ` Jan Kiszka
2008-04-14 19:21 ` Jan Kiszka
2008-04-14 21:34 ` Jan Kiszka [this message]
2008-04-17 0:24 ` [Qemu-devel] " andrzej zaborowski
2008-04-17 0:46 ` andrzej zaborowski
2008-04-17 19:06 ` [Qemu-devel] " Jan Kiszka
2008-04-18 18:12 ` Jan Kiszka
2008-04-18 18:43 ` andrzej zaborowski
2008-04-19 19:01 ` Jan Kiszka
2008-04-20 4:11 ` andrzej zaborowski
2008-04-20 15:52 ` Jan Kiszka
2008-04-20 17:38 ` andrzej zaborowski
2008-04-20 16:32 ` [Qemu-devel] [PATCH] " Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4803CDF4.3010503@web.de \
--to=jan.kiszka@web.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.