qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Volker Rümelin" <vr_qemu@t-online.de>
To: Howard Spoelstra <hsp.cat7@gmail.com>
Cc: Programmingkid <programmingkidx@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"qemu Developers" <qemu-devel@nongnu.org>,
	"Zoltán Kővágó" <dirty.ice.hu@gmail.com>
Subject: [RFC] coreaudio: fix coreaudio_test.diff
Date: Wed, 29 Jan 2020 08:13:04 +0100	[thread overview]
Message-ID: <f03b7ae9-344c-5a7f-414c-6250a9c5ec2f@t-online.de> (raw)
In-Reply-To: <54f5ddf3-5ea9-bd6d-8c71-edf4db527463@t-online.de>

This is an untested patch that tries to fix the problems in the
patch found at
https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg02142.html. 

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
 audio/audio_template.h | 16 ++++++++--------
 audio/coreaudio.c      |  5 +++++
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/audio/audio_template.h b/audio/audio_template.h
index a7b46b8363..e6724c5d68 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -153,13 +153,6 @@ static int glue (audio_pcm_sw_init_, TYPE) (
     sw->ratio = ((int64_t) sw->info.freq << 32) / sw->hw->info.freq;
 #endif
 
-#ifdef FLOAT_MIXENG
-#ifdef DAC
-    sw->conv = mixeng_conv_float;
-#else
-    sw->clip = mixeng_clip_float;
-#endif
-#else
 #ifdef DAC
     sw->conv = mixeng_conv
 #else
@@ -169,7 +162,6 @@ static int glue (audio_pcm_sw_init_, TYPE) (
         [sw->info.sign]
         [sw->info.swap_endianness]
         [audio_bits_to_index (sw->info.bits)];
-#endif
 
     sw->name = g_strdup (name);
     err = glue (audio_pcm_sw_alloc_resources_, TYPE) (sw);
@@ -284,6 +276,13 @@ static HW *glue(audio_pcm_hw_add_new_, TYPE)(AudioState *s,
         goto err1;
     }
 
+#ifdef FLOAT_MIXENG
+#ifdef DAC
+    hw->clip = mixeng_clip_float;
+#else
+    hw->conv = mixeng_conv_float;
+#endif
+#else
 #ifdef DAC
     hw->clip = mixeng_clip
 #else
@@ -293,6 +292,7 @@ static HW *glue(audio_pcm_hw_add_new_, TYPE)(AudioState *s,
         [hw->info.sign]
         [hw->info.swap_endianness]
         [audio_bits_to_index (hw->info.bits)];
+#endif
 
     glue(audio_pcm_hw_alloc_resources_, TYPE)(hw);
 
diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index 4e7e509ad0..ff0d23fd7d 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -482,6 +482,7 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,
     Audiodev *dev = drv_opaque;
     AudiodevCoreaudioPerDirectionOptions *cpdo = dev->u.coreaudio.out;
     int frames;
+    struct audsettings fake_as;
 
     /* create mutex */
     err = pthread_mutex_init(&core->mutex, NULL);
@@ -490,6 +491,10 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,
         return -1;
     }
 
+    memcpy(&fake_as, as, sizeof(struct audsettings));
+    as = &fake_as;
+    /* size of float is 32bits */
+    as->fmt = AUDIO_FORMAT_S32;
     audio_pcm_init_info (&hw->info, as);
 
     status = coreaudio_get_voice(&core->outputDeviceID);
-- 
2.16.4



  reply	other threads:[~2020-01-29  7:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-05  1:58 [PATCH v2] Implement the Screamer sound chip for the mac99 machine type Programmingkid
2020-01-05 14:39 ` Programmingkid
2020-01-11  0:32 ` Zoltán Kővágó
2020-01-11  0:59   ` Programmingkid
2020-01-28  8:30   ` Volker Rümelin
2020-01-28  9:38     ` Howard Spoelstra
2020-01-29  7:09       ` Volker Rümelin
2020-01-29  7:13         ` Volker Rümelin [this message]
2020-01-30 15:03           ` [RFC] coreaudio: fix coreaudio_test.diff Howard Spoelstra
2020-01-31  7:37             ` Volker Rümelin
2020-01-31  8:03               ` Gerd Hoffmann
2020-01-31  8:35                 ` Mark Cave-Ayland
2020-01-31  9:12                   ` Howard Spoelstra
2020-01-31 15:55           ` Programmingkid
2020-02-02 19:47     ` [PATCH v2] Implement the Screamer sound chip for the mac99 machine type Zoltán Kővágó

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=f03b7ae9-344c-5a7f-414c-6250a9c5ec2f@t-online.de \
    --to=vr_qemu@t-online.de \
    --cc=dirty.ice.hu@gmail.com \
    --cc=hsp.cat7@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=programmingkidx@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).