* Re: [PATCH v2] Implement the Screamer sound chip for the mac99 machine type @ 2020-01-05 1:58 Programmingkid 2020-01-05 14:39 ` Programmingkid 2020-01-11 0:32 ` Zoltán Kővágó 0 siblings, 2 replies; 15+ messages in thread From: Programmingkid @ 2020-01-05 1:58 UTC (permalink / raw) To: qemu Developers, Howard Spoelstra, Zoltán, mark Cave-Ayland Cc: Gerd Hoffmann I found the patch that breaks Screamer sound support for qemu-system-ppc. It is this: commit 2ceb8240fa4e4e30fb853565eb2bed3032d74f62 Author: Kővágó, Zoltán <dirty.ice.hu@gmail.com> Date: Thu Sep 19 23:24:11 2019 +0200 coreaudio: port to the new audio backend api Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 586a1e66de5cbc6c5234f9ae556d24befb6afada.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reversing this patch should make the Screamer patch work with the current git version of QEMU. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] Implement the Screamer sound chip for the mac99 machine type 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ó 1 sibling, 0 replies; 15+ messages in thread From: Programmingkid @ 2020-01-05 14:39 UTC (permalink / raw) To: qemu Developers, Howard Spoelstra, Zoltán, Mark Cave-Ayland, Peter Maydell, Gerd Hoffmann > On Jan 4, 2020, at 8:58 PM, Programmingkid <programmingkidx@gmail.com> wrote: > > I found the patch that breaks Screamer sound support for qemu-system-ppc. It is this: > > commit 2ceb8240fa4e4e30fb853565eb2bed3032d74f62 > Author: Kővágó, Zoltán <dirty.ice.hu@gmail.com> > Date: Thu Sep 19 23:24:11 2019 +0200 > > coreaudio: port to the new audio backend api > > Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> > Message-id: 586a1e66de5cbc6c5234f9ae556d24befb6afada.1568927990.git.DirtY.iCE.hu@gmail.com > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> > > > Reversing this patch should make the Screamer patch work with the current git version of QEMU. @Peter Maydell Does QEMU play audio correctly on your version of Mac OS X? I am using Mac OS 10.12 and the audio sound demonically loud and scary. I am currently at this git revision: f0dcfddecee8b860e015bb07d67cfcbdfbfd51d Merge: 40f09ee833 725fe5d10d Author: Peter Maydell <peter.maydell@linaro.org> Date: Fri Jan 3 17:18:08 2020 +0000 Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging I have ran several tests with qemu-system-i386 using Windows guest with the ac97 and sb16 sound cards. It sounds just as bad for me on qemu-system-ppc. Thank you. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] Implement the Screamer sound chip for the mac99 machine type 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 1 sibling, 2 replies; 15+ messages in thread From: Zoltán Kővágó @ 2020-01-11 0:32 UTC (permalink / raw) To: Programmingkid, qemu Developers, Howard Spoelstra, mark Cave-Ayland Cc: Gerd Hoffmann [-- Attachment #1: Type: text/plain, Size: 1098 bytes --] On 2020-01-05 02:58, Programmingkid wrote: > I found the patch that breaks Screamer sound support for qemu-system-ppc. It is this: > > commit 2ceb8240fa4e4e30fb853565eb2bed3032d74f62 > Author: Kővágó, Zoltán <dirty.ice.hu@gmail.com> > Date: Thu Sep 19 23:24:11 2019 +0200 > > coreaudio: port to the new audio backend api > > Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> > Message-id: 586a1e66de5cbc6c5234f9ae556d24befb6afada.1568927990.git.DirtY.iCE.hu@gmail.com > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> > > > Reversing this patch should make the Screamer patch work with the current git version of QEMU. > Hi, Unfortunately it's not that simple to simply revert the patch since the old backend api no longer exists. Also I don't have a Mac so it's almost impossible for me to test the results. I looked at the specified commit and I think I found a problem, could you please apply the attached patch on the current git master and check whether it solves the problem? If yes I'll turn it into a proper patch. Regards, Zoltan [-- Attachment #2: coreaudio_test.diff --] [-- Type: text/x-patch, Size: 3838 bytes --] diff --git a/audio/audio_template.h b/audio/audio_template.h index 3287d7075e..a7b46b8363 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -153,6 +153,13 @@ 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 @@ -162,6 +169,7 @@ 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); diff --git a/audio/mixeng.h b/audio/mixeng.h index 18e62c7c49..343f5fb810 100644 --- a/audio/mixeng.h +++ b/audio/mixeng.h @@ -41,6 +41,11 @@ typedef void (f_sample) (void *dst, const struct st_sample *src, int samples); extern t_sample *mixeng_conv[2][2][2][3]; extern f_sample *mixeng_clip[2][2][2][3]; +#ifdef FLOAT_MIXENG +void mixeng_conv_float(struct st_sample *dst, const void *src, int samples); +void mixeng_clip_float(void *dst, const struct st_sample *src, int samples); +#endif + void *st_rate_start (int inrate, int outrate); void st_rate_flow(void *opaque, st_sample *ibuf, st_sample *obuf, size_t *isamp, size_t *osamp); diff --git a/audio/coreaudio.c b/audio/coreaudio.c index 66f0f459cf..4e7e509ad0 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -471,20 +471,6 @@ static OSStatus audioDeviceIOProc( return 0; } -static UInt32 coreaudio_get_flags(struct audio_pcm_info *info, - struct audsettings *as) -{ - UInt32 flags = info->sign ? kAudioFormatFlagIsSignedInteger : 0; - if (as->endianness) { /* 0 = little, 1 = big */ - flags |= kAudioFormatFlagIsBigEndian; - } - - if (flags == 0) { /* must not be 0 */ - flags = kAudioFormatFlagsAreAllClear; - } - return flags; -} - static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as, void *drv_opaque) { @@ -572,15 +558,6 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as, /* set Samplerate */ core->outputStreamBasicDescription.mSampleRate = (Float64) as->freq; - core->outputStreamBasicDescription.mFormatID = kAudioFormatLinearPCM; - core->outputStreamBasicDescription.mFormatFlags = - coreaudio_get_flags(&hw->info, as); - core->outputStreamBasicDescription.mBytesPerPacket = - core->outputStreamBasicDescription.mBytesPerFrame = - hw->info.nchannels * hw->info.bits / 8; - core->outputStreamBasicDescription.mFramesPerPacket = 1; - core->outputStreamBasicDescription.mChannelsPerFrame = hw->info.nchannels; - core->outputStreamBasicDescription.mBitsPerChannel = hw->info.bits; status = coreaudio_set_streamformat(core->outputDeviceID, &core->outputStreamBasicDescription); diff --git a/audio/mixeng.c b/audio/mixeng.c index 2f5ba71381..424ffe30d7 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -267,6 +267,27 @@ f_sample *mixeng_clip[2][2][2][3] = { } }; +#ifdef FLOAT_MIXENG +void mixeng_conv_float(struct st_sample *dst, const void *src, int samples) +{ + float *in = (float *) src; + while (samples--) { + dst->l = *in++; + dst->r = *in++; + dst++; + } +} + +void mixeng_clip_float(void *dst, const struct st_sample *src, int samples) +{ + float *out = (float *) dst; + while (samples--) { + *out++ = src->l; + *out++ = src->r; + src++; + } +} +#endif void audio_sample_to_uint64(void *samples, int pos, uint64_t *left, uint64_t *right) ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2] Implement the Screamer sound chip for the mac99 machine type 2020-01-11 0:32 ` Zoltán Kővágó @ 2020-01-11 0:59 ` Programmingkid 2020-01-28 8:30 ` Volker Rümelin 1 sibling, 0 replies; 15+ messages in thread From: Programmingkid @ 2020-01-11 0:59 UTC (permalink / raw) To: Zoltán Kővágó Cc: Gerd Hoffmann, Mark Cave-Ayland, qemu Developers, Howard Spoelstra > On Jan 10, 2020, at 7:32 PM, Zoltán Kővágó <dirty.ice.hu@gmail.com> wrote: > > On 2020-01-05 02:58, Programmingkid wrote: >> I found the patch that breaks Screamer sound support for qemu-system-ppc. It is this: >> commit 2ceb8240fa4e4e30fb853565eb2bed3032d74f62 >> Author: Kővágó, Zoltán <dirty.ice.hu@gmail.com> >> Date: Thu Sep 19 23:24:11 2019 +0200 >> coreaudio: port to the new audio backend api >> Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> >> Message-id: 586a1e66de5cbc6c5234f9ae556d24befb6afada.1568927990.git.DirtY.iCE.hu@gmail.com >> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> >> Reversing this patch should make the Screamer patch work with the current git version of QEMU. > > Hi, > > Unfortunately it's not that simple to simply revert the patch since the old backend api no longer exists. Also I don't have a Mac so it's almost impossible for me to test the results. I looked at the specified commit and I think I found a problem, could you please apply the attached patch on the current git master and check whether it solves the problem? If yes I'll turn it into a proper patch. > > Regards, > Zoltan > > <coreaudio_test.diff> Sorry it did not fix the problem. I only hear pops occasionally. Most of the time only silence can be heard. Thank you for the patch. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] Implement the Screamer sound chip for the mac99 machine type 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-02-02 19:47 ` [PATCH v2] Implement the Screamer sound chip for the mac99 machine type Zoltán Kővágó 1 sibling, 2 replies; 15+ messages in thread From: Volker Rümelin @ 2020-01-28 8:30 UTC (permalink / raw) To: Zoltán Kővágó, Programmingkid, qemu Developers, Howard Spoelstra, Mark Cave-Ayland Cc: Gerd Hoffmann > Hi, > > Unfortunately it's not that simple to simply revert the patch since the old backend api no longer exists. Also I don't have a Mac so it's almost impossible for me to test the results. I looked at the specified commit and I think I found a problem, could you please apply the attached patch on the current git master and check whether it solves the problem? If yes I'll turn it into a proper patch. > > Regards, > Zoltan > Hi Zoltán, I also don't have a Mac so I tested your patch with a slightly modified sdlaudio version. I found two bugs in your patch. With the bugs fixed I have working SDL2 audio playback with float type samples. Now I wonder if the fixed patch also fixes coreaudio playback. Depending on how busy you are I can just write a review for your patch and let you handle the rest, or may I send a modified version of your patch to the mailing list for testing? With best regards Volker ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] Implement the Screamer sound chip for the mac99 machine type 2020-01-28 8:30 ` Volker Rümelin @ 2020-01-28 9:38 ` Howard Spoelstra 2020-01-29 7:09 ` Volker Rümelin 2020-02-02 19:47 ` [PATCH v2] Implement the Screamer sound chip for the mac99 machine type Zoltán Kővágó 1 sibling, 1 reply; 15+ messages in thread From: Howard Spoelstra @ 2020-01-28 9:38 UTC (permalink / raw) To: Volker Rümelin Cc: Programmingkid, Gerd Hoffmann, Mark Cave-Ayland, qemu Developers, Zoltán Kővágó [-- Attachment #1: Type: text/plain, Size: 3201 bytes --] On Tue, Jan 28, 2020 at 9:30 AM Volker Rümelin <vr_qemu@t-online.de> wrote: > > Hi, > > > > Unfortunately it's not that simple to simply revert the patch since the > old backend api no longer exists. Also I don't have a Mac so it's almost > impossible for me to test the results. I looked at the specified commit > and I think I found a problem, could you please apply the attached patch on > the current git master and check whether it solves the problem? If yes > I'll turn it into a proper patch. > > > > Regards, > > Zoltan > > > > Hi Zoltán, > > I also don't have a Mac so I tested your patch with a slightly modified > sdlaudio version. I found two bugs in your patch. With the bugs fixed I > have working SDL2 audio playback with float type samples. Now I wonder if > the fixed patch also fixes coreaudio playback. Depending on how busy you > are I can just write a review for your patch and let you handle the rest, > or may I send a modified version of your patch to the mailing list for > testing? > > With best regards > Volker > Hi Volker, I can test for coreaudio. Can you let us know exactly what you fixed in the patch? While cross compiling for windows, I saw these errors (besides some casting issues): line 56: buffer2 (should be *buffer2?) line 455: ret (should be ret2?) audio/dsoundaudio.c:56:20: error: variable or field 'buffer2' declared void 56 | void *buffer1, buffer2; | ^~~~~~~ audio/dsoundaudio.c: In function 'dsound_get_buffer_out': audio/dsoundaudio.c:428:18: error: returning 'int' from a function with return type 'void *' makes pointer from integer without a cast [-Werror=int-conversion] 428 | return ds->buffer2; | ~~^~~~~~~~~ audio/dsoundaudio.c:451:17: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Werror=int-conversion] 451 | ds->buffer2 = ret2; | ^ audio/dsoundaudio.c:455:12: error: 'ret' undeclared (first use in this function); did you mean 'ret2'? 455 | return ret; | ^~~ | ret2 audio/dsoundaudio.c:455:12: note: each undeclared identifier is reported only once for each function it appears in audio/dsoundaudio.c: In function 'dsound_put_buffer_out': audio/dsoundaudio.c:471:49: error: passing argument 3 of 'dsound_unlock_out' makes pointer from integer without a cast [-Werror=int-conversion] 471 | err = dsound_unlock_out(dsb, ds->buffer1, ds->buffer2, ds->size1, ds->size2); | ~~^~~~~~~~~ | | | int In file included from audio/dsoundaudio.c:267: audio/dsound_template.h:49:12: note: expected 'LPVOID' {aka 'void *'} but argument is of type 'int' 49 | LPVOID p2, | ~~~~~~~^~ audio/dsoundaudio.c: In function 'dsound_get_buffer_out': audio/dsoundaudio.c:456:1: error: control reaches end of non-void function [-Werror=return-type] 456 | } | ^ cc1: all warnings being treated as errors Best, Howard [-- Attachment #2: Type: text/html, Size: 4060 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] Implement the Screamer sound chip for the mac99 machine type 2020-01-28 9:38 ` Howard Spoelstra @ 2020-01-29 7:09 ` Volker Rümelin 2020-01-29 7:13 ` [RFC] coreaudio: fix coreaudio_test.diff Volker Rümelin 0 siblings, 1 reply; 15+ messages in thread From: Volker Rümelin @ 2020-01-29 7:09 UTC (permalink / raw) To: Howard Spoelstra Cc: Programmingkid, Gerd Hoffmann, Mark Cave-Ayland, qemu Developers, Zoltán Kővágó > > Hi Volker, > > I can test for coreaudio. Can you let us know exactly what you fixed in the patch? Hi Howard, I wrote a patch that tries to fix the problems in Zoltán's patch. The changes in coreaudio.c are untested. I'll send it as a reply to this mail. Please apply Zoltan's patch and then my patch to qemu master. > While cross compiling for windows, I saw these errors (besides some casting issues): > line 56: buffer2 (should be *buffer2?) > line 455: ret (should be ret2?) > > audio/dsoundaudio.c:56:20: error: variable or field 'buffer2' declared void > 56 | void *buffer1, buffer2; > | ^~~~~~~ > audio/dsoundaudio.c: In function 'dsound_get_buffer_out': I'm sorry, but I can't build and test on Windows. With best regards, Volker ^ permalink raw reply [flat|nested] 15+ messages in thread
* [RFC] coreaudio: fix coreaudio_test.diff 2020-01-29 7:09 ` Volker Rümelin @ 2020-01-29 7:13 ` Volker Rümelin 2020-01-30 15:03 ` Howard Spoelstra 2020-01-31 15:55 ` Programmingkid 0 siblings, 2 replies; 15+ messages in thread From: Volker Rümelin @ 2020-01-29 7:13 UTC (permalink / raw) To: Howard Spoelstra Cc: Programmingkid, Gerd Hoffmann, Mark Cave-Ayland, qemu Developers, Zoltán Kővágó 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 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [RFC] coreaudio: fix coreaudio_test.diff 2020-01-29 7:13 ` [RFC] coreaudio: fix coreaudio_test.diff Volker Rümelin @ 2020-01-30 15:03 ` Howard Spoelstra 2020-01-31 7:37 ` Volker Rümelin 2020-01-31 15:55 ` Programmingkid 1 sibling, 1 reply; 15+ messages in thread From: Howard Spoelstra @ 2020-01-30 15:03 UTC (permalink / raw) To: Volker Rümelin Cc: Programmingkid, Gerd Hoffmann, Mark Cave-Ayland, qemu Developers, Zoltán Kővágó [-- Attachment #1: Type: text/plain, Size: 3012 bytes --] On Wed, Jan 29, 2020 at 8:13 AM Volker Rümelin <vr_qemu@t-online.de> wrote: > 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 > > Hi all, Thanks to the generous help from Mark, I can now report that it is good to hear coreaudio has been restored into a working state with this patch! I tested qemu-system-ppc running MacOS and OSX. Best, Howard [-- Attachment #2: Type: text/html, Size: 3937 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [RFC] coreaudio: fix coreaudio_test.diff 2020-01-30 15:03 ` Howard Spoelstra @ 2020-01-31 7:37 ` Volker Rümelin 2020-01-31 8:03 ` Gerd Hoffmann 0 siblings, 1 reply; 15+ messages in thread From: Volker Rümelin @ 2020-01-31 7:37 UTC (permalink / raw) To: Howard Spoelstra Cc: Programmingkid, Gerd Hoffmann, Mark Cave-Ayland, qemu Developers, Zoltán Kővágó > > Hi all, > > Thanks to the generous help from Mark, I can now report that it is good to hear coreaudio has been restored into a working state with this patch! I tested qemu-system-ppc running MacOS and OSX. > > Best, > Howard Thank you for testing the two patches. I will wait a few days to see if Zoltán wants to write a cleaned up patch. Otherwise I'll try to write a patch that's acceptable for submission. With best regards Volker ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [RFC] coreaudio: fix coreaudio_test.diff 2020-01-31 7:37 ` Volker Rümelin @ 2020-01-31 8:03 ` Gerd Hoffmann 2020-01-31 8:35 ` Mark Cave-Ayland 0 siblings, 1 reply; 15+ messages in thread From: Gerd Hoffmann @ 2020-01-31 8:03 UTC (permalink / raw) To: Volker Rümelin Cc: Programmingkid, Zoltán Kővágó, Mark Cave-Ayland, qemu Developers, Howard Spoelstra On Fri, Jan 31, 2020 at 08:37:50AM +0100, Volker Rümelin wrote: > > > > Hi all, > > > > Thanks to the generous help from Mark, I can now report that it is good to hear coreaudio has been restored into a working state with this patch! I tested qemu-system-ppc running MacOS and OSX. > > > > Best, > > Howard > > Thank you for testing the two patches. I will wait a few days to see if Zoltán wants to write a cleaned up patch. Otherwise I'll try to write a patch that's acceptable for submission. I'm busy collecting pending audio fixes for the next pull req, planned to send out early next week. Would be cool if I can include a coreaudio fix ;) The RFC patch looks sane to me but it clearly needs a better commit message. Current patch queue state: https://git.kraxel.org/cgit/qemu/log/?h=queue/audio If I missed something please resend. cheers, Gerd ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [RFC] coreaudio: fix coreaudio_test.diff 2020-01-31 8:03 ` Gerd Hoffmann @ 2020-01-31 8:35 ` Mark Cave-Ayland 2020-01-31 9:12 ` Howard Spoelstra 0 siblings, 1 reply; 15+ messages in thread From: Mark Cave-Ayland @ 2020-01-31 8:35 UTC (permalink / raw) To: Gerd Hoffmann, Volker Rümelin Cc: Programmingkid, Howard Spoelstra, qemu Developers, Zoltán Kővágó On 31/01/2020 08:03, Gerd Hoffmann wrote: >> Thank you for testing the two patches. I will wait a few days to see if Zoltán wants to write a cleaned up patch. Otherwise I'll try to write a patch that's acceptable for submission. > > I'm busy collecting pending audio fixes for the next pull req, > planned to send out early next week. Would be cool if I can > include a coreaudio fix ;) > > The RFC patch looks sane to me but it clearly needs a better > commit message. > > Current patch queue state: > https://git.kraxel.org/cgit/qemu/log/?h=queue/audio > > If I missed something please resend. That would be great! One thing to note is that Volker's RFC patch applies on top of Zoltan's original diff from https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg02142.html rather than being standalone. If you take a look at my branch at https://github.com/mcayland/qemu/commits/for-cat7 then it's just a case of squashing the top 2 commits and coming up with a suitable commit message. ATB, Mark. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [RFC] coreaudio: fix coreaudio_test.diff 2020-01-31 8:35 ` Mark Cave-Ayland @ 2020-01-31 9:12 ` Howard Spoelstra 0 siblings, 0 replies; 15+ messages in thread From: Howard Spoelstra @ 2020-01-31 9:12 UTC (permalink / raw) To: Mark Cave-Ayland Cc: qemu Developers, Programmingkid, Volker Rümelin, Gerd Hoffmann, Zoltán Kővágó [-- Attachment #1: Type: text/plain, Size: 1535 bytes --] On Fri, Jan 31, 2020 at 9:35 AM Mark Cave-Ayland < mark.cave-ayland@ilande.co.uk> wrote: > On 31/01/2020 08:03, Gerd Hoffmann wrote: > > >> Thank you for testing the two patches. I will wait a few days to see if > Zoltán wants to write a cleaned up patch. Otherwise I'll try to write a > patch that's acceptable for submission. > > > > I'm busy collecting pending audio fixes for the next pull req, > > planned to send out early next week. Would be cool if I can > > include a coreaudio fix ;) > > > > The RFC patch looks sane to me but it clearly needs a better > > commit message. > > > > Current patch queue state: > > https://git.kraxel.org/cgit/qemu/log/?h=queue/audio > > > > If I missed something please resend. > > That would be great! One thing to note is that Volker's RFC patch applies > on top of > Zoltan's original diff from > https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg02142.html > rather than > being standalone. > > If you take a look at my branch at > https://github.com/mcayland/qemu/commits/for-cat7 > then it's just a case of squashing the top 2 commits and coming up with a > suitable > commit message. > > > ATB, > > Mark. > Yes, lovely! I just applied the dsound patch from KJ Liew on top of the for-cat7 branch. https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg03805.html While it will not apply directly (not finding the file to patch in the source tree), it nevertheless gets rid of the dsound errors too. Best, Howard [-- Attachment #2: Type: text/html, Size: 2560 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [RFC] coreaudio: fix coreaudio_test.diff 2020-01-29 7:13 ` [RFC] coreaudio: fix coreaudio_test.diff Volker Rümelin 2020-01-30 15:03 ` Howard Spoelstra @ 2020-01-31 15:55 ` Programmingkid 1 sibling, 0 replies; 15+ messages in thread From: Programmingkid @ 2020-01-31 15:55 UTC (permalink / raw) To: Volker Rümelin Cc: Gerd Hoffmann, Zoltán Kővágó, Mark Cave-Ayland, qemu Developers, Howard Spoelstra > On Jan 29, 2020, at 2:13 AM, Volker Rümelin <vr_qemu@t-online.de> wrote: > > 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 > I could not apply this patch using 'patch -p1 < <patch file>'. I kept seeing the error malformed patch. When I applied the patch by hand QEMU was able to play sound normally again. Thank you :) I used qemu-system-i386 at git commit adcd6e93b9519f7fe421d543e3aa646895b32e1a to test this patch. Both the AC97 and SB16 sound cards with Windows XP and Windows NT 4.0 respectively. Only the ES1370 sound card used with Windows 2000 failed to play anything. This is probably a problem with it and not your patch. Reviewed-by: John Arbuckle <programmingkidx@gmail.com> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] Implement the Screamer sound chip for the mac99 machine type 2020-01-28 8:30 ` Volker Rümelin 2020-01-28 9:38 ` Howard Spoelstra @ 2020-02-02 19:47 ` Zoltán Kővágó 1 sibling, 0 replies; 15+ messages in thread From: Zoltán Kővágó @ 2020-02-02 19:47 UTC (permalink / raw) To: Volker Rümelin, Programmingkid, qemu Developers, Howard Spoelstra, Mark Cave-Ayland Cc: Gerd Hoffmann On 2020-01-28 09:30, Volker Rümelin wrote: >> Hi, >> >> Unfortunately it's not that simple to simply revert the patch since the old backend api no longer exists. Also I don't have a Mac so it's almost impossible for me to test the results. I looked at the specified commit and I think I found a problem, could you please apply the attached patch on the current git master and check whether it solves the problem? If yes I'll turn it into a proper patch. >> >> Regards, >> Zoltan >> > > Hi Zoltán, > > I also don't have a Mac so I tested your patch with a slightly modified sdlaudio version. I found two bugs in your patch. With the bugs fixed I have working SDL2 audio playback with float type samples. Now I wonder if the fixed patch also fixes coreaudio playback. Depending on how busy you are I can just write a review for your patch and let you handle the rest, or may I send a modified version of your patch to the mailing list for testing? > > With best regards > Volker Hi, Maybe I'm a bit late since you already did it, but go ahead, I don't have too much time to work on qemu recently. Regards, Zoltan ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2020-02-02 19:47 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 ` [RFC] coreaudio: fix coreaudio_test.diff Volker Rümelin 2020-01-30 15:03 ` 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ó
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).