qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: malc <av1474@comtv.ru>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Questions on audio_atexit(), possibly bugs
Date: Sat, 3 Oct 2009 16:55:30 +0400 (MSD)	[thread overview]
Message-ID: <Pine.LNX.4.64.0910031654100.2433@linmac.oyster.ru> (raw)
In-Reply-To: <87iqewhcbn.fsf@pike.pond.sub.org>

On Sat, 3 Oct 2009, Markus Armbruster wrote:

> malc <av1474@comtv.ru> writes:
> 
> > On Sat, 3 Oct 2009, Markus Armbruster wrote:
> >
> >> malc <av1474@comtv.ru> writes:
> >> 
> >> > On Fri, 2 Oct 2009, Markus Armbruster wrote:
> >> [...]
> >> >> Thanks.  Next question: I'm having difficulties understanding how
> >> >> HWVoiceIn / HWVoiceOut member enabled works.
> >> >> 
> >> >> AUD_set_active_out(), AUD_set_active_in() and audio_run_out() take care
> >> >> to maintain hw->enabled reflecting the state of the voice.  They also
> >> >> use it to avoid changing the state uselessly.
> >> >> 
> >> >> audio_vm_change_state_handler() uses hw->enabled the same way.  But it
> >> >> doesn't update it.  Why?  Same for audio_atexit().
> >> >> 
> >> >
> >> > Because it's more or less a hack, just to make sure host doesn't loop
> >> > the sample it has. Cleaner approach would be to have a member named
> >> > something like tmporarily_disabled or paused, but that's an overkill.
> >> 
> >> I think I understand why we disable voices on stop.  My question is why
> >> we don't record the fact in hw->enabled.  Care to explain?
> >
> > Because of overloaded meaning, here we are only pausing, what enabled
> > means in other contexts is that all the soft voices are gone or inactive,
> > so the host should stop.
> >
> >> > After some thinking i believe not calling VOICE_DISABLE in atexit is
> >> > possible given that s->vm_running is zero.
> >> 
> >> Is it?  We call exit() in many, many places...
> >
> > Yes. The logic goes like this, vm_stop can be zero only if we saw
> > vm_change_state_handler going from running to stopped and consequently all 
> > the voices were already stopped/paused - no need to do it at exit.
> 
> I fear I don't understand.  vm_stop is a function, and as such can't "be
> zero".

My bad, i meant AudioState's vm_running field.

> 
> Consider monitor command "quit".  All it does is exit(0).  I don't see
> it stopping the VM.

Yes, vm_running would still be 1 (audio's vm_change_state_handler didn't
run, so we will proceed with disabling). 

-- 
mailto:av1474@comtv.ru

  reply	other threads:[~2009-10-03 12:55 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
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 [this message]
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=Pine.LNX.4.64.0910031654100.2433@linmac.oyster.ru \
    --to=av1474@comtv.ru \
    --cc=armbru@redhat.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).