All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: malc <av1474@comtv.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Questions on audio_atexit(), possibly bugs
Date: Thu, 01 Oct 2009 00:59:26 +0200	[thread overview]
Message-ID: <871vlo9gz5.fsf@pike.pond.sub.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0910010234080.26485@linmac.oyster.ru> (malc's message of "Thu\, 1 Oct 2009 02\:42\:41 +0400 \(MSD\)")

malc <av1474@comtv.ru> writes:

> On Wed, 30 Sep 2009, Markus Armbruster wrote:
>
>> Excuse my ignorance on all things audio, but I stumbled over something
>> that could be wrong.
>> 
>> audio_vm_change_state_handler() stops voices when the VM stops, and
>> starts them when it continues.
>> 
>> audio_atexit() unconditionally stops them.  When a stopped VM exits,
>> this stops voices that are already stopped.
>> 
>> Does the audio driver contract allow stopping a stopped voice?  If yes,
>> I figured starting a running voice is fine, too.  If no, we have a bug
>> in audio_atexit().
>
> This should answer the question audio_atexit existed long before vm
> change state handlers. Those were actually added to stop the host from
> looping the same audio fragment over and over again (can/will happen
> with DirectSound, mmapped OSS, fmod too if i'm not mistaken).

Just to make sure: Does this mean implementations of audio_pcm_ops need
to cope with stopping a stopped voice?

>> Why is audio_atexit() needed at all?  Doesn't the OS clean up just fine
>> all by itself?  If we do need manual cleanup, why do we have to stop
>> voices before we run fini_out() and fini_in()?
>
> audio_atexit is needed for WAV, the OS will not write the final
> information for us.
>
>> 
>> Unrelated, but nearby: audio_vm_change_state_handler() calls the
>> ctl_out() callback with three arguments:
>> 
>>         hwo->pcm_ops->ctl_out (hwo, op, conf.try_poll_out);
>> 
>> (op is either VOICE_ENABLE or VOICE_DISABLE here), while audio_atexit()
>> calls it with two:
>> 
>>         hwo->pcm_ops->ctl_out (hwo, VOICE_DISABLE);
>> 
>> Same for ctl_in().  Doesn't look kosher.  A quick check of oss_ctl_out()
>> and oss_ctl_in() shows use of three parameters.
>
> Yes, not kosher, but harmless, conf.try_poll_out is only applicable to
> VOICE_ENABLE and is simply ignored by the handler of VOICE_DISABLE, this
> is a vararg function, so it's okay, though i'd probably change this to
> avoid further confusion.

Appreciated.

  reply	other threads:[~2009-09-30 22:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30 21:39 [Qemu-devel] Questions on audio_atexit(), possibly bugs Markus Armbruster
2009-09-30 22:42 ` malc
2009-09-30 22:59   ` Markus Armbruster [this message]
2009-09-30 23:22     ` malc
2009-10-02 17:04       ` Markus Armbruster
2009-10-02 21:26         ` malc
2009-10-03 11:47           ` Markus Armbruster
2009-10-03 12:21             ` malc
2009-10-03 12:49               ` Markus Armbruster
2009-10-03 12:55                 ` malc
2009-09-30 23:28     ` malc
2009-10-01 15:21       ` Markus Armbruster
2009-10-01 21:26         ` malc
2009-10-01 22:40           ` Markus Armbruster
2009-10-01 22:49             ` malc

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=871vlo9gz5.fsf@pike.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=av1474@comtv.ru \
    --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.