From: Peter Maydell <peter.maydell@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/audio/lm4549: Don't try to open a zero-frequency audio voice
Date: Sat, 8 Nov 2025 10:48:45 +0000 [thread overview]
Message-ID: <CAFEAcA-chUva0qpzxsyRd65rtWMHhqC2A6XbNnQ1so3RtCjArA@mail.gmail.com> (raw)
In-Reply-To: <5da4fd2b-6c5b-e2f4-b421-0a440718af7b@eik.bme.hu>
On Sat, 8 Nov 2025 at 00:22, BALATON Zoltan <balaton@eik.bme.hu> wrote:
>
> On Fri, 7 Nov 2025, Peter Maydell wrote:
> > If the guest incorrectly programs the lm4549 audio chip with a zero
> > frequency, we will pass this to AUD_open_out(), which will complain:
> >
> > A bug was just triggered in AUD_open_out
> > Save all your work and restart without audio
> > I am sorry
> > Context:
> > audio: frequency=0 nchannels=2 fmt=S16 endianness=little
> >
> > The datasheet doesn't say what we should do here, only that the valid
> > range for the freqency is 8000 to 48000 Hz; we choose to log the
> > guest error and ignore an attempt to change the DAC rate to something
> > outside the valid range.
> >
> > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/410
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> > This bug has been around for so long and is a weird edge case whose
> > only effect is to print a debug message, so it doesn't really seem
> > worth cc'ing stable on.
> > ---
> > hw/audio/lm4549.c | 17 ++++++++++++++++-
> > 1 file changed, 16 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/audio/lm4549.c b/hw/audio/lm4549.c
> > index 745441bd790..bf711c49c04 100644
> > --- a/hw/audio/lm4549.c
> > +++ b/hw/audio/lm4549.c
> > @@ -15,6 +15,7 @@
> >
> > #include "qemu/osdep.h"
> > #include "hw/hw.h"
> > +#include "qemu/log.h"
> > #include "qemu/audio.h"
> > #include "lm4549.h"
> > #include "migration/vmstate.h"
> > @@ -179,9 +180,23 @@ void lm4549_write(lm4549_state *s,
> > break;
> >
> > case LM4549_PCM_Front_DAC_Rate:
> > - regfile[LM4549_PCM_Front_DAC_Rate] = value;
> > DPRINTF("DAC rate change = %i\n", value);
> >
> > + /*
> > + * Valid sample rates are 4kHz to 48kHz.
>
> Commit message says minimum is 8kHz. One of these is likely incorrect.
> Maybe a typo in commit message?
Whoops; yes, you're right, the commit message is the one
that's wrong. The datasheet for this is at
https://www.ti.com/lit/ds/symlink/lm4549b.pdf
and it says 4kHz.
-- PMM
next prev parent reply other threads:[~2025-11-08 10:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 15:41 [PATCH] hw/audio/lm4549: Don't try to open a zero-frequency audio voice Peter Maydell
2025-11-08 0:22 ` BALATON Zoltan
2025-11-08 10:48 ` Peter Maydell [this message]
2025-11-09 10:45 ` Philippe Mathieu-Daudé
2025-11-14 13:20 ` Peter Maydell
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=CAFEAcA-chUva0qpzxsyRd65rtWMHhqC2A6XbNnQ1so3RtCjArA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=balaton@eik.bme.hu \
--cc=qemu-arm@nongnu.org \
--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).