All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: "Gerd Hoffmann" <kraxel@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	qemu-devel@nongnu.org
Cc: qemu-devel@nongnu.org, devel@daynix.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>
Subject: Re: [PATCH v8 4/6] coreaudio: Commit the result of init in the end
Date: Wed, 04 Mar 2026 12:56:04 +0100	[thread overview]
Message-ID: <2042987.yKVeVyVuyW@weasel> (raw)
In-Reply-To: <20260304-coreaudio-v8-4-bf1d40731e73@rsg.ci.i.u-tokyo.ac.jp>

On Wednesday, 4 March 2026 07:16:57 CET Akihiko Odaki wrote:
> init_out_device may only commit some part of the result and leave the
> state inconsistent when it encounters a fatal error or the device gets
> unplugged during the operation, which is expressed by
> kAudioHardwareBadObjectError or kAudioHardwareBadDeviceError. Commit the
> result in the end of the function so that it commits the result iff it
> sees no fatal error and the device remains plugged.
> 
> With this change, handle_voice_change can rely on core->outputDeviceID
> to know whether the output device is initialized after calling
> init_out_device.
> 
> Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> ---
>  audio/coreaudio.m | 47 ++++++++++++++++++++++++++---------------------
>  1 file changed, 26 insertions(+), 21 deletions(-)
> 
> diff --git a/audio/coreaudio.m b/audio/coreaudio.m
> index 736227eb2b7a..23c3d1f80ac5 100644
> --- a/audio/coreaudio.m
> +++ b/audio/coreaudio.m
> @@ -357,8 +357,11 @@ static OSStatus out_device_ioproc(
> 
>  static OSStatus init_out_device(CoreaudioVoiceOut *core)
>  {
> +    AudioDeviceID device_id;
> +    AudioDeviceIOProcID ioprocid;
>      AudioValueRange value_range;
>      OSStatus status;
> +    UInt32 device_frame_size;

Shouldn't then be this here at the beginning?

  core->device_id = kAudioDeviceUnknown;
  core->ioprocid = NULL;
  ...

[...]
>      if (status != kAudioHardwareNoError) {
>          coreaudio_playback_logerr(status,
>                                    "Could not set device buffer frame size %" PRIu32,
> -                                  (uint32_t)core->device_frame_size);
> +                                  (uint32_t)device_frame_size);
>          return status;
>      }

Why the cast here? device_frame_size is declared as UInt32.

/Christian




  reply	other threads:[~2026-03-04 11:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04  6:16 [PATCH v8 0/6] coreaudio fixes Akihiko Odaki
2026-03-04  6:16 ` [PATCH v8 1/6] coreaudio: Remove unnecessary explicit casts Akihiko Odaki
2026-03-04  8:07   ` Marc-André Lureau
2026-03-04  6:16 ` [PATCH v8 2/6] coreaudio: Remove extra whitespaces Akihiko Odaki
2026-03-04  8:06   ` Marc-André Lureau
2026-03-04  6:16 ` [PATCH v8 3/6] coreaudio: Improve naming Akihiko Odaki
2026-03-04  8:07   ` Marc-André Lureau
2026-03-04  9:25   ` Christian Schoenebeck
2026-03-04 10:42     ` Akihiko Odaki
2026-03-04 10:52       ` Christian Schoenebeck
2026-03-04 12:00     ` BALATON Zoltan
2026-03-04  6:16 ` [PATCH v8 4/6] coreaudio: Commit the result of init in the end Akihiko Odaki
2026-03-04 11:56   ` Christian Schoenebeck [this message]
2026-03-07  4:10     ` Akihiko Odaki
2026-03-04  6:16 ` [PATCH v8 5/6] audio: Add functions to initialize buffers Akihiko Odaki
2026-03-04  8:11   ` Marc-André Lureau
2026-03-04  8:36   ` Christian Schoenebeck
2026-03-04 10:47     ` Akihiko Odaki
2026-03-04 11:17       ` Christian Schoenebeck
2026-03-07  4:17         ` Akihiko Odaki
2026-03-04  6:16 ` [PATCH v8 6/6] coreaudio: Initialize the buffer for device change Akihiko Odaki
2026-03-04  8:11   ` Marc-André Lureau
2026-03-04 11:39   ` Christian Schoenebeck
2026-03-07  5:29     ` Akihiko Odaki
2026-03-04  8:42 ` [PATCH v8 0/6] coreaudio fixes Christian Schoenebeck

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=2042987.yKVeVyVuyW@weasel \
    --to=qemu_oss@crudebyte.com \
    --cc=balaton@eik.bme.hu \
    --cc=devel@daynix.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=philmd@linaro.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 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.