From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).
Date: Sun, 04 May 2008 19:31:41 +0200 [thread overview]
Message-ID: <481DF2FD.2080606@web.de> (raw)
In-Reply-To: <fb249edb0805040849g2cca0a85v377336a120504392@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3315 bytes --]
andrzej zaborowski wrote:
> On 04/05/2008, andrzej zaborowski <balrogg@gmail.com> wrote:
>> On 04/05/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
>> > -#define NOVOL
>> > +//#define NOVOL
>> >
>> > /* 8 bit */
>> > #define ENDIAN_CONVERSION natural
>> >
>> > to make the MusicPal work out-of-the-box (muting is now broken again,
>> > causing loud noise during channel switches and while in suspended mode).
>>
>>
>> Right, as I said you need to disable NOVOL manually if you want volume
>> control. Changing this would affect users of all machines of all
>> architectures and until now everyone was fine with using the host
>> mixer instead of software mixing in qemu.
>>
>> BTW, I noticed that on some radio stations I get double speed
>> playback, not sure what's causing this. My recent commit, while
>> correct (I think), doesn't fix this. For a test case try connecting
>
> Ok, seems to be fixed now - it (logically) happened everytime Linux
> was trying to play a mono channel stream.
Cool! Just a minor nit (to avoid that the compiler gets upset):
Index: qemu/hw/musicpal.c
===================================================================
--- qemu/hw/musicpal.c (Revision 4332)
+++ qemu/hw/musicpal.c (Arbeitskopie)
@@ -255,7 +255,8 @@ typedef struct musicpal_audio_state {
static void audio_callback(void *opaque, int free_out, int free_in)
{
musicpal_audio_state *s = opaque;
- int16_t *codec_buffer, *mem_buffer;
+ int16_t *codec_buffer;
+ void *mem_buffer;
int pos, block_size;
if (!(s->playback_mode & MP_AUDIO_PLAYBACK_EN))
@@ -276,8 +277,9 @@ static void audio_callback(void *opaque,
if (s->playback_mode & MP_AUDIO_MONO) {
codec_buffer = wm8750_dac_buffer(s->wm, block_size >> 1);
for (pos = 0; pos < block_size; pos += 2) {
- *codec_buffer++ = *mem_buffer;
- *codec_buffer++ = *mem_buffer++;
+ *codec_buffer++ = *(uint16_t *)mem_buffer;
+ *codec_buffer++ = *(uint16_t *)mem_buffer;
+ mem_buffer += 2;
}
} else
memcpy(wm8750_dac_buffer(s->wm, block_size >> 2),
@@ -286,14 +288,14 @@ static void audio_callback(void *opaque,
if (s->playback_mode & MP_AUDIO_MONO) {
codec_buffer = wm8750_dac_buffer(s->wm, block_size);
for (pos = 0; pos < block_size; pos++) {
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer));
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer)++);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
}
} else {
codec_buffer = wm8750_dac_buffer(s->wm, block_size >> 1);
for (pos = 0; pos < block_size; pos += 2) {
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer)++);
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer)++);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
}
}
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
next prev parent reply other threads:[~2008-05-04 17:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-04 10:21 [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka) Andrzej Zaborowski
2008-05-04 10:47 ` Jan Kiszka
2008-05-04 12:31 ` andrzej zaborowski
2008-05-04 15:49 ` andrzej zaborowski
2008-05-04 17:31 ` Jan Kiszka [this message]
2008-05-04 17:31 ` Jan Kiszka
2008-05-04 23:59 ` andrzej zaborowski
2008-05-05 18:43 ` [Qemu-devel] [PATCH] Enable volume control globally (was: First cut at WM8750 volume control) Jan Kiszka
2008-05-04 21:33 ` [Qemu-devel] [PATCH] musicpal: doc fragment 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=481DF2FD.2080606@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.