All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>,
	Alistair Francis <alistair@alistair23.me>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	KONRAD Frederic <fred.konrad@greensocs.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] display: xlnx_dp: Provide sufficient bytes for silent audio channel
Date: Fri, 15 Nov 2019 21:12:02 +0100	[thread overview]
Message-ID: <c3690658-245b-7ebd-a58a-8f665ac16ac5@redhat.com> (raw)
In-Reply-To: <1573833408-2388-1-git-send-email-sai.pavan.boddu@xilinx.com>

Cc'ing Gerd (Audio)

On 11/15/19 4:56 PM, Sai Pavan Boddu wrote:
> Fill the audio channel with required number of bytes to cover the
> elapsed time. This prevents rate control reset, and avoids debug prints
> like below
> 
> log:
> 	Resetting rate control (65692 samples)
> 	...
> 	Resetting rate control (65721 samples)
> 	...
> 
> Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> ---
>   hw/display/xlnx_dp.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
> index fde3b21..7058443 100644
> --- a/hw/display/xlnx_dp.c
> +++ b/hw/display/xlnx_dp.c
> @@ -394,13 +394,18 @@ static void xlnx_dp_audio_callback(void *opaque, int avail)
>               written = AUD_write(s->amixer_output_stream,
>                                   &s->out_buffer[s->data_ptr], s->byte_left);
>           } else {
> +             int len_to_copy;
>               /*
>                * There is nothing to play.. We don't have any data! Fill the
>                * buffer with zero's and send it.
>                */
>               written = 0;
> -            memset(s->out_buffer, 0, 1024);
> -            AUD_write(s->amixer_output_stream, s->out_buffer, 1024);
> +            while (avail) {
> +                len_to_copy = MIN(AUD_CHBUF_MAX_DEPTH, avail);
> +                memset(s->out_buffer, 0, len_to_copy);
> +                avail -= AUD_write(s->amixer_output_stream, s->out_buffer,
> +                                   len_to_copy);
> +            }
>           }
>       } else {
>           written = AUD_write(s->amixer_output_stream,
> 



      parent reply	other threads:[~2019-11-15 20:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15 15:56 [PATCH] display: xlnx_dp: Provide sufficient bytes for silent audio channel Sai Pavan Boddu
2019-11-15 19:29 ` Alistair Francis
2019-11-15 20:12 ` Philippe Mathieu-Daudé [this message]

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=c3690658-245b-7ebd-a58a-8f665ac16ac5@redhat.com \
    --to=philmd@redhat.com \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=fred.konrad@greensocs.com \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sai.pavan.boddu@xilinx.com \
    /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.