qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "andrzej zaborowski" <balrogg@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [4249] Improve audio api use in WM8750.
Date: Fri, 25 Apr 2008 03:41:06 +0200	[thread overview]
Message-ID: <fb249edb0804241841i7a58b61l1c474c9dbda45735@mail.gmail.com> (raw)
In-Reply-To: <48112D47.6050500@web.de>

On 25/04/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
> OK, it's late... The real issue here is that the wm8750's internal cache
>  correlates with the MusicPal guest's internal buffering threshold - it
>  happens to be 4K as well. Thus, the line above just pushes the problem
>  to guests that play with 2K buffers. And this demonstrates nicely that
>  the current caching is fragile, only suitable for a subset of guests.
>
>  Back to square #1, only cache what piles up during controllable periods:
>  inside the callback. In my case, I _depend_ on flushing after the
>  callback, because this is where data gets transfered to the Wolfson, and
>  it gets transferred in larger chunks as well. Thus, flushing later
>  easily causes buffer underruns.
>
>  And for those scenarios where data arrives asynchronously in smaller
>  chunks between the callbacks, we may also flush before entering the
>  subordinated callback.
>
>  But, frankly, how may cycle does all this caching actually save us? Did
>  you measure it? I doubt it is relevant.

It's not really caching but rather trying to emulate the hardware's
FIFOs so that we get the same behavior.  But I see the problem: the
FIFO on wm8750 side was used to avoid buffering data more than once
for the Spitz and the Neo1973 machines. But they use a I2S interface
which is totally different than that of MusicPal (they both have a hw
register through which all samples have to go, rather than a kind of
DMA).  What we need is an api to let the cpu explicitely flush the
data, because in the model with DMA, only the CPU knows when it's good
moment to do that (e.g at the end of audio_callback in hw/musicpal.c),
I'll try to come up with something like that.  An arbitrary threshold
in wm8750 won't work for all machines.

Regards

  reply	other threads:[~2008-04-25  1:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24 21:01 [Qemu-devel] [4249] Improve audio api use in WM8750 Andrzej Zaborowski
2008-04-24 21:30 ` Jan Kiszka
2008-04-24 23:34   ` andrzej zaborowski
2008-04-24 23:57     ` Jan Kiszka
2008-04-25  0:09       ` Jan Kiszka
2008-04-25  0:23         ` andrzej zaborowski
2008-04-25  0:45           ` Jan Kiszka
2008-04-25  1:00             ` Jan Kiszka
2008-04-25  1:41               ` andrzej zaborowski [this message]
2008-04-25  1:05             ` andrzej zaborowski
2008-04-25  1:10               ` Jan Kiszka
2008-04-25  0:15       ` andrzej zaborowski

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=fb249edb0804241841i7a58b61l1c474c9dbda45735@mail.gmail.com \
    --to=balrogg@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).