All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Adam Goode <agoode@google.com>
Cc: alsa-devel@alsa-project.org, Martin Koegler <martin.koegler@chello.at>
Subject: Re: [PATCH - alsa-lib 1/1] Change card/pid get functions to return -ENOSYS if the kernel is too old
Date: Mon, 06 Jun 2016 16:01:21 +0200	[thread overview]
Message-ID: <s5hr3camn66.wl-tiwai@suse.de> (raw)
In-Reply-To: <CAOf41Nk+_j_AXd9PXOKd6HV3Tv7G+Nsf35+9p0NNrOEwGyN1SQ@mail.gmail.com>

On Mon, 06 Jun 2016 15:57:33 +0200,
Adam Goode wrote:
> 
> On Fri, Apr 8, 2016 at 3:53 PM, Adam Goode <agoode@google.com> wrote:
> 
> > On Fri, Apr 8, 2016 at 1:56 PM, Martin Koegler <martin.koegler@chello.at>
> > wrote:
> >
> >> On Fri, Apr 08, 2016 at 11:21:57AM -0400, Adam Goode wrote:
> >> > So there are 2 alternatives I can think of:
> >> >
> >> > option 1: introduce snd_seq_client_info_get_pid_2() and leave the
> >> existing
> >> > function alone. This new function can return a new constant,
> >> > SND_SEQ_CLIENT_INFO_PID_UNKNOWN for missing kernel support. Same for
> >> card.
> >> > option 2: introduce snd_seq_client_info_pid_known() that returns a bool
> >> if
> >> > there is kernel support. Same for card.
> >>
> >> I wouldn't implement option 1. Using that methode for API changes will
> >> result in lots of rarely used functions.
> >>
> >> Chrome will probable need that information to enable a fallback-code - if
> >> a application has no fallback code,
> >> it has no need for different returncodes. In a few years, most
> >> distributions will likely ship kernel including that functions,
> >> so there is no need to for fallback-code and the kernel support check any
> >> more.
> >>
> >> Why not a snd_seq_client_info_get_capatibilites() returing bit flags:
> >> .._CAP_CARD_NUMBER | .._CAP_PID ?
> >>
> >>
> > This approach is fine by me as well, though it does introduce more
> > constants and bitwise logic.
> >
> >
> Since returning to this problem after a while, I've realized that we don't
> need any changes at all to alsa-lib. This test is equivalent to what is
> needed:
> 
> snd_seq_get_client_info(seq, info); // get our client's info
> bool client_pid_supported = snd_seq_client_info_get_pid(info) != -1; // do
> we know our own PID?

Ah, yes, it works.  I thought of another, e.g. checking /dev/sequencer
version ioctl, but yours works more nicely.

> It might be helpful to put this into the documentation, but otherwise I
> think this is fine.

A patch is always welcome :)


thanks,

Takashi

  reply	other threads:[~2016-06-06 14:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 17:33 [PATCH - alsa-lib 1/1] Change card/pid get functions to return -ENOSYS if the kernel is too old Adam Goode
2016-04-01 17:45 ` Adam Goode
2016-04-01 21:15 ` Martin Koegler
2016-04-04 14:54   ` Takashi Iwai
2016-04-05 15:21     ` Adam Goode
2016-04-07 19:23     ` Adam Goode
2016-04-07 20:10       ` Martin Koegler
2016-04-07 23:00         ` Takashi Sakamoto
2016-04-08 10:24         ` Takashi Iwai
2016-04-08 12:56           ` Jaroslav Kysela
2016-04-08 13:10             ` Takashi Iwai
2016-04-08 15:21               ` Adam Goode
2016-04-08 17:56                 ` Martin Koegler
2016-04-08 19:53                   ` Adam Goode
2016-06-06 13:57                     ` Adam Goode
2016-06-06 14:01                       ` Takashi Iwai [this message]
2017-01-03 13:34                         ` Adam Goode

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=s5hr3camn66.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=agoode@google.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=martin.koegler@chello.at \
    /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.