qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yaroslav Isakov <yaroslav.isakov@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] Pass raw DB values from hda-codec.c to audio driver
Date: Fri, 21 Dec 2018 22:39:31 +0100	[thread overview]
Message-ID: <CADS+iDXua37iz+e92RMzMTbQzWXgiSSrQ8_NeqnAao_frQghWQ@mail.gmail.com> (raw)
In-Reply-To: <af2fca9a040c19198c5aff8752f152a525fd96b7.1545425136.git.yaroslav.isakov@gmail.com>

Sorry, lost cover letter and first patch, resending them

пт, 21 дек. 2018 г. в 21:57, Yaroslav Isakov <yaroslav.isakov@gmail.com>:
>
> Signed-off-by: Yaroslav Isakov <yaroslav.isakov@gmail.com>
> ---
>  hw/audio/hda-codec.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
> index 09f9da344b..d160e86d2a 100644
> --- a/hw/audio/hda-codec.c
> +++ b/hw/audio/hda-codec.c
> @@ -437,6 +437,7 @@ static void hda_audio_set_amp(HDAAudioStream *st)
>  {
>      bool muted;
>      uint32_t left, right;
> +    double left_db, right_db;
>
>      if (st->node == NULL) {
>          return;
> @@ -446,6 +447,9 @@ static void hda_audio_set_amp(HDAAudioStream *st)
>      left  = st->mute_left  ? 0 : st->gain_left;
>      right = st->mute_right ? 0 : st->gain_right;
>
> +    left_db = ((int64_t)left - QEMU_HDA_AMP_STEPS) * QEMU_HDA_AMP_DB_OF_STEP;
> +    right_db = ((int64_t)right - QEMU_HDA_AMP_STEPS) * QEMU_HDA_AMP_DB_OF_STEP;
> +
>      left = left * 255 / QEMU_HDA_AMP_STEPS;
>      right = right * 255 / QEMU_HDA_AMP_STEPS;
>
> @@ -454,10 +458,10 @@ static void hda_audio_set_amp(HDAAudioStream *st)
>      }
>      if (st->output) {
>          AUD_set_volume_out(st->voice.out, muted, left, right,
> -                           false, 0, 0);
> +                           true, left_db, right_db);
>      } else {
>          AUD_set_volume_in(st->voice.in, muted, left, right,
> -                          false, 0, 0);
> +                          true, left_db, right_db);
>      }
>  }
>
> --
> 2.18.1
>

  reply	other threads:[~2018-12-21 21:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 20:45 [Qemu-devel] [PATCH 0/3] Allow hw/audio drivers to pass raw DB values to audio/ drivers Yaroslav Isakov
2018-12-21  0:21 ` [Qemu-devel] [PATCH 1/3] Allow audio driver to pass DB value to underlying drivers Yaroslav Isakov
2018-12-21  0:25 ` [Qemu-devel] [PATCH 3/3] If raw DB values are known, use them in paaudio Yaroslav Isakov
2018-12-21 20:31 ` [Qemu-devel] [PATCH 2/3] Pass raw DB values from hda-codec.c to audio driver Yaroslav Isakov
2018-12-21 21:39   ` Yaroslav Isakov [this message]
2018-12-26 15:41 ` [Qemu-devel] [PATCH 0/3] Allow hw/audio drivers to pass raw DB values to audio/ drivers no-reply
  -- strict thread matches above, loose matches on Subject: below --
2018-12-21 21:14 Yaroslav Isakov
2018-12-21 20:31 ` [Qemu-devel] [PATCH 2/3] Pass raw DB values from hda-codec.c to audio driver Yaroslav Isakov

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=CADS+iDXua37iz+e92RMzMTbQzWXgiSSrQ8_NeqnAao_frQghWQ@mail.gmail.com \
    --to=yaroslav.isakov@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).