All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexander E. Patrakov" <patrakov@ums.usu.ru>
To: alsa-devel@lists.sourceforge.net
Subject: Re: Question on ALSA versions
Date: Fri, 05 Nov 2004 09:53:18 +0500	[thread overview]
Message-ID: <cmf0td$rqv$1@sea.gmane.org> (raw)
In-Reply-To: 1099596730.1617.61.camel@krustophenia.net

Lee Revell wrote:

> On Thu, 2004-11-04 at 11:42 +0500, Alexander E. Patrakov wrote:
>> Hello,
>> 
>> I have the following question. Is it OK to have mismatched versions of
>> ALSA drivers (e.g. 1.0.4, from linux-2.6.8.1) and libs (1.0.6)? This
>> _seems_ to work, and I see the code to support various versions of the
>> kernel PCM protocol in the library, but I want to see official words from
>> developers.
> 
> This is not guaranteed to work, and could lead to all kinds of weird
> problems.  Alsa-lib is the mechanism by which changes in the kernel side
> ALSA are hidden from userspace.  They expect to be the same version.

But the code says, e.g.:

        if (ioctl(fd, SNDRV_PCM_IOCTL_PVERSION, &ver) < 0) {
                ret = -errno;
                SYSERR("SNDRV_PCM_IOCTL_PVERSION failed");
                close(fd);
                return ret;
        }
        if (SNDRV_PROTOCOL_INCOMPATIBLE(ver, SNDRV_PCM_VERSION_MAX))
                return -SND_ERROR_INCOMPATIBLE_VERSION;

        if (SNDRV_PROTOCOL_VERSION(2, 0, 5) <= ver) {
  /* old stuff */
 }

So, contrary to your words, the code checks not for exactly the same version
but for some match defined by SNDRV_PROTOCOL_INCOMPATIBLE macro:

#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
    (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
    (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
    SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))

So the protocols are considered compatible in the code if they have the same
major and minor versions, but differences in micro versions are allowed.

> In practice it usually works but there have been some specific incidents
> where this caused problems.  For example when a major change is made to
> a driver the hardware specific parts of alsa-lib will be updated to
> reflect the change.

Isn't it what minor and major versions are for? Or are they just an old
artifact that should not be relied upon? Or there is just lack of testing?

In short: is it a bug when it doesn't work with only micro versions being
different?

-- 
Alexander E. Patrakov



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

  reply	other threads:[~2004-11-05  4:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-04  6:42 Question on ALSA versions Alexander E. Patrakov
2004-11-04 19:32 ` Lee Revell
2004-11-05  4:53   ` Alexander E. Patrakov [this message]
2004-11-05  6:03     ` Jaroslav Kysela
2004-11-05  9:33       ` Alexander E. Patrakov

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='cmf0td$rqv$1@sea.gmane.org' \
    --to=patrakov@ums.usu.ru \
    --cc=alsa-devel@lists.sourceforge.net \
    /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.