All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Zoltán Kővágó" <dirty.ice.hu@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 03/14] audio: add audiodev property to vnc and wav_capture
Date: Mon, 29 Jul 2019 08:11:35 +0200	[thread overview]
Message-ID: <87sgqptlns.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <58139154-2d7c-2eb0-f1a7-c5f57868f657@gmail.com> (=?utf-8?B?IlpvbHTDoW4JS8WRdsOhZ8OzIidz?= message of "Sun, 28 Jul 2019 17:08:29 +0200")

"Zoltán Kővágó" <dirty.ice.hu@gmail.com> writes:

> On 2019-07-28 15:42, Zoltán Kővágó wrote:
>> On 2019-07-22 16:21, Markus Armbruster wrote:
>>> "Zoltán Kővágó" <dirty.ice.hu@gmail.com> writes:
>>>
>>>> On 2019-07-16 08:23, Markus Armbruster wrote:
[...]
>>>>>> diff --git a/hmp-commands.hx b/hmp-commands.hx
>>>>>> index bfa5681dd2..fa7f009268 100644
>>>>>> --- a/hmp-commands.hx
>>>>>> +++ b/hmp-commands.hx
>>>>>> @@ -819,16 +819,19 @@ ETEXI
>>>>>>          {
>>>>>>            .name       = "wavcapture",
>>>>>> -        .args_type  = "path:F,freq:i?,bits:i?,nchannels:i?",
>>>>>> -        .params     = "path [frequency [bits [channels]]]",
>>>>>> +        .args_type  =
>>>>>> "path:F,freq:i?,bits:i?,nchannels:i?,audiodev:s?",
>>>>>> +        .params     = "path [frequency [bits [channels
>>>>>> [audiodev]]]]",
>>>>>>            .help       = "capture audio to a wave file (default
>>>>>> frequency=44100 bits=16 channels=2)",
>>>>>>            .cmd        = hmp_wavcapture,
>>>>>>        },
>>>>>>    STEXI
>>>>>> -@item wavcapture @var{filename} [@var{frequency} [@var{bits}
>>>>>> [@var{channels}]]]
>>>>>> +@item wavcapture @var{filename} [@var{frequency} [@var{bits}
>>>>>> [@var{channels} [@var{audiodev}]]]]
>>>>>>    @findex wavcapture
>>>>>> -Capture audio into @var{filename}. Using sample rate @var{frequency}
>>>>>> -bits per sample @var{bits} and number of channels @var{channels}.
>>>>>> +Capture audio into @var{filename} from @var{audiodev}, using
>>>>>> sample rate
>>>>>> +@var{frequency} bits per sample @var{bits} and number of channels
>>>>>> +@var{channels}. When not using an -audiodev argument on command line,
>>>>>> +@var{audiodev} must be omitted, otherwise is must specify a valid
>>>>>> +audiodev.
>>>>>
>>>>> I can see the code for "must specify a valid audiodev" in
>>>>> hmp_wavcapture().  Where is "must be omitted" checked?
>>>>
>>>> It's not checked right now, but if the user specifies audiodev, it
>>>> must be a valid audiodev id.  So if the user can guess the id (which
>>>> is not too hard ATM, it's simply the driver's name), it will work even
>>>> in this case.
>>>>
>>>>> Preexisting: the list "sample rate @var{frequency} bits per sample
>>>>> @var{bits} and number of channels @var{channels}" lacks a comma after
>>>>> @var{frequency}, please fix that.  I'd put one after @var{bits}
>>>>> as well,
>>>>> but that's a matter of taste[*]
>>>>>
>>>>> The sentence is of the form "if not COND then A else B".  The
>>>>> less-negated form "if COND then B else A" is commonly easier to read.
>>>>>
>>>>> Documentation says "from @var{audiodev}".  But when "not using an
>>>>> -audiodev argument on command line, +@var{audiodev} must be omitted".
>>>>> Where does it sample from then?  I figure from some default audio
>>>>> device.  Where is that default audio device explained?  I skimmed the
>>>>> -audiodev documentation in qemu-options.hx, but couldn't see it there.
>>>>
>>>> Currently there are two ways to specify audio options, the legacy ones
>>>> using the QEMU_AUDIO_* environment variables, and the new one using
>>>> -audiodev arguments.  The two formats cannot be mixed, and eventually
>>>> we should remove the legacy ones (IIRC my previous patch series
>>>> already deprecated them), then we can get rid of this madness.  Maybe
>>>> something like "When using the legacy environment variable based audio
>>>> config, @var{audiodev} must be omitted." would be better?
>>>
>>> What about effectively de-documenting the deprecated method?  I.e. write
>>> as if it was already gone.  This should result in more readable
>>> documentation.
>>
>> Makes sense.  User will less likely use deprecated methods that way
>> and it simplifies the documentation.
>>
>>> Double-checking: will audiodev become mandatory once the deprecated
>>> method is gone?
>>
>> Yes.
>
> Actually, now that I took a second look at the params, it might be
> problematic.  Currently audiodev is the last parameter, so if it
> becomes mandatory, that will effectively mean other parameters will
> become mandatory too.  And if I were to change the order and move
> audiodev first, that would break backward compatibility during the
> deprecation period.

HMP is not a stable interface.  We can break compatibility there when we
have a reason.

In this case, we can either break it right away (insert audiodev before
the other optional parameters), or later (insert it last, move it when
it becomes mandatory).  Matter of taste.  I'd break it right away.


  reply	other threads:[~2019-07-29  6:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 21:08 [Qemu-devel] [PATCH v2 00/14] Multiple simultaneous audio backends Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 01/14] audio: reduce glob_audio_state usage Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 02/14] audio: basic support for multi backend audio Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 03/14] audio: add audiodev property to vnc and wav_capture Kővágó, Zoltán
2019-07-16  6:23   ` Markus Armbruster
2019-07-16 10:02     ` Dr. David Alan Gilbert
2019-07-21 15:05     ` Zoltán Kővágó
2019-07-22 14:21       ` Markus Armbruster
2019-07-28 13:42         ` Zoltán Kővágó
2019-07-28 15:08           ` Zoltán Kővágó
2019-07-29  6:11             ` Markus Armbruster [this message]
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 04/14] audio: add audiodev properties to frontends Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 05/14] paaudio: prepare for multiple audiodev Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 06/14] audio: audiodev= parameters no longer optional when -audiodev present Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 07/14] paaudio: do not move stream when sink/source name is specified Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 08/14] paaudio: properly disconnect streams in fini_* Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 09/14] audio: remove audio_MIN, audio_MAX Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 10/14] audio: do not run each backend in audio_run Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 11/14] paaudio: fix playback glitches Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 12/14] audio: remove read and write pcm_ops Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 13/14] audio: use size_t where makes sense Kővágó, Zoltán
2019-07-15 21:08 ` [Qemu-devel] [PATCH v2 14/14] audio: fix memory leak reported by ASAN Kővágó, Zoltán
2019-07-15 21:16 ` [Qemu-devel] [PATCH v2 00/14] Multiple simultaneous audio backends no-reply
2019-07-16 18:01 ` no-reply

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=87sgqptlns.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=dirty.ice.hu@gmail.com \
    --cc=kraxel@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 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.