Question on ALSA versions
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.
Also it would be nice to see the exact range of driver and kernel versions formally supported by ALSA-lib 1.0.6.
Signature · 9 lines
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
Quoted 6 lines · Alexander E. Patrakov
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.
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.
Lee
-------------------------------------------------------
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
Quoted 9 lines · Lee Revell
Quoted 7 lines · Alexander E. Patrakov
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.
Quoted 3 lines
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.
Quoted 4 lines
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?
Signature · 9 lines
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
Quoted 7 lines · Alexander E. Patrakov
Quoted 4 lines
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?
The alsa-lib 1.0+ should be compatible with ALSA driver code in 2.6 kernels. Of course, it's better to use last alsa-lib because of bug-fixes. This is true for drivers as well.
The alsa-lib code tries to emulate new kernel driver features when older driver is used. Also, the configuration files might be changes reflecting the specific lowlevel driver, so in some cases, you'll need configuration files matching specific driver version (emu10k1 driver is an example).
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
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
Quoted 2 lines · Jaroslav Kysela
The alsa-lib 1.0+ should be compatible with ALSA driver code in 2.6 kernels. Of course, it's better to use last alsa-lib because of bug-fixes.
Thanks, I will forward your reply to "Linux From Scratch" development list. The result will be that alsa-lib 1.0.6 will be used together with the ALSA drivers that are part of linux-2.6.8.1
Quoted 1 line
This is true for drivers as well.
Right, but we already have kernel version freeze in "Linux From Scratch" :(
Signature · 9 lines
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