Enabling Sound in GNU/Linux on Legacy Hardware Components.
Update 12-29-2010: For GNU/Linux kernel 2.6.35 and higher please use ALSA Project snapshot (development) files in the instructions below. Attempting to build sound support from the generally available (GA) 1.0.23 release will fail with similar output as below:
/usr/src/alsa/alsa-driver-1.0.23/acore/pcm_native.c: In function ‘snd_pcm_hw_params’:
/usr/src/alsa/alsa-driver-1.0.23/acore/pcm_native.c:489: error: implicit declaration of function ‘pm_qos_remove_requirement’
/usr/src/alsa/alsa-driver-1.0.23/acore/pcm_native.c:492: error: implicit declaration of function ‘pm_qos_add_requirement’
make[3]: *** [/usr/src/alsa/alsa-driver-1.0.23/acore/pcm_native.o] Error 1
make[2]: *** [/usr/src/alsa/alsa-driver-1.0.23/acore] Error 2
make[1]: *** [_module_/usr/src/alsa/alsa-driver-1.0.23] Error 2
make: *** [compile] Error 2
Additionally, some cards may require the ALSA firmware to be built (similarly as instructed below, i.e., ./configure ; make ; make install) for the sound to be successfully enabled. As an specific example, I can cite ESS Maestro 3 PCI sound card (sound-es1988).
End of update 12-29-2010.
Computing literally on the cutting edge of technology with GNU/Linux distributions like Debian, at Metztli Information Technology we are exposed early to unfinished rough edges in the dynamic development of the free and open source software (FOSS) operating system. Accordingly, those experiences prepare us to offer cost effective GNU/Linux desktop on-site deployment and management services that insulate end users from adverse effects that may impact their business daily tasks.
An typical small or medium business (SMB ) organization somewhere in any given part of the world may continue to operate with hardware infrastructure that large business organizations in developed countries might consider extreme legacy. Needless to say, the most ubiquitous proprietary operating system, being an monolithic resource hog, would slow to a crawl --if it even installs at all in older hardware infrastructure of the type alluded. Probably its replacement --version 7 of that proprietary operating system lineage, as it nears general availability, will be an improvement over the previous version fiasco. Or perhaps not ...if we read eWeek's Windows 7 Compatibility Issues May Mar Enterprise Adoption.
Below is an excerpt from an recent chat that I had the opportunity to witness:
Code
... | |
user1: I have a new HP laptop with Windows Vista that SUCKS... Makes me want to get rid of my Microsoft stock... | |
... | |
user2: I have Vista on my personal computer and it can be difficult for me sometimes | |
user3: I can't even type a whole word into the message box before it loses focus on this XP machine running IE7. How does anyone carry on any type of conversation?? Is there some trick to this? | |
user1: I found that by writing in a text program... then copy to the CLIPBOARD... and paste into the text box... works great... | |
user3: I should have thought of that. | |
user4: user1, let's just hope Windows 7 fixes the Vista woes | |
user3: I "downgraded" my Vista computer here at work to XP Pro simply because Vista it took so much longer to get anything done while in Vista, It could find network printers but refused to have any dealing with them, software that worked in earlier Wins didn't work in Vista, and on, and on, and on... | |
user3: Early in the presentation today I lost the connection and couldn't get back in. The link would just come up as a blank screen. I tried many times, then sent a complaint. I finally rebooted the computer (XP) and clicked the link again. Then it let me login and get back to the v-event. Don't know whether that was an event problem or an XP/IE problem. | |
... |
Needless to say, those of us in the open source side, especially those who experience bleeding edge GNU/Linux development, also do encounter issues with our operating system distribution. The crucial difference is that in free and open source activity the individual is empowered to solve those issues. And GNU/Linux distributions make use of hardware infrastructure resources much more efficiently than proprietary alternatives. Worldwide developer support contributions and hardware resource usage efficiency enables GNU/Linux to install and function properly even on older hardware.
Before resuming our treatment of our topic, it is proper for us to bid farewell to that proprietary operating system: Hasta la Vista! Metztli IT recommends GNU/Linux distributions such as Debian.
Upgrading Debian Kernel and Sound in Legacy Hardware.
A couple of days ago I found myself in front of an dual Intel 600MHz CPU unit where I had just upgraded the GNU/Linux Debian kernel package: Linux 2.6.29 image on Ppro/Celeron/PII/PIII/P4. As observed in the snapshot above, I used the Synaptic Package Manager to accomplish the operation; naturally, Synaptic is also available in GNU/Linux Debian derived distributions like Ubuntu. As seen below, Synaptic is available from the Debian System menu.
Synaptic can also be invoked from the shell if its location is referenced in the user's PATH environment variable. Needless to say, in Debian you should be the root or super user of the system; ; enter the following at your shell prompt to verify that synaptic is installed:
which synaptic
Under Ubuntu, generally, you should prefix the relevant administration commands with su as below:
su which synaptic
Of course, the user may also install Synaptic, if that package management application is not installed, by first updating the Debian (or Ubuntu) repositories by entering at the shell prompt:
apt-get update
and subsequently, typing the actual installation directive:
apt-get install synaptic
Although the sound card is an Cirrus cs46xx model PCI unit that also functions properly for CentOS and OS/2 partitions in the unit, this ephemeral bleeding edge Debian distribution was not able to install support for it. As a consequence, there was no sound in this particular system partition. I was interested in attending the IBM Dynamic Infrastructure webcast; hence, I decided that sound had to be enabled in this system for it was to be used to access the live webcast.
Yes, I had installed the linux-sound-base package:
And I had also installed the alsa-base and alsamixer packages:
IBM web events, unlike other relatively large business organizations with an pseudo partner ecosystem, do not force the attendees to use an proprietary operating system, i.e., Windows and MacOS. An IBM web event is delivered by an operating system agnostic mechanism, like Java, Flash, and RealPlayer. These technologies are available for GNU/Linux as well as proprietary alternatives.
I recall an online event, purportedly relevant to the emerging (or rediscovered) Cloud Computing paradigm, that we were invited to attend by the second largest CPU maker. The requirements were for the attendee to: "...make sure the Office Live Meeting client is installed before the meeting." !
If the webinar organizers of an CPU maker do not realize that Cloud Computing implies open standards, it means that they do not even realize that they are excluding their GNU/Linux desktop and server current and potential customers who use or might consider that CPU maker's hardware products. Reiterating, webinar organizers that do not realize (or ignore out of deference for their closed source partners) that Office Live Meeting client is not available on their GNU/Linux desktop and server current and potential customers are effectively undermining their organization's sales prospects.
Hence, my use of the term pseudo partner ecosystem when referring to these organizations that exclude current and potential business partners from participating in their events by using closed source proprietary technologies.
Enabling Sound in Debian on Legacy Hardware.
We need to have the GNU C Compiler package in our GNU/Linux Debian system:
And we should install the Header files for Linux (note that they should be the same version as the Linux kernel image, listed at the bottom of the snapshot below):
Once each of those packages has been selected to be installed, the user should press the button labeled Apply, located at the top menu row of the Synaptic Package Manager utility.
We proceed to point our IceWeasel or Firefox, IceApe or Mozilla, Galeon or Epiphany, browser --whichever is our favorite -- to the Advanced Linux Sound Architecture (ALSA) project homepage. From the upper right of the page, we should select to download
- alsa-driver-version
- alsa-lib-version
- alsa-utils-version
The placeholder term version refers to the specific version available at the time the user visits the ALSA project home page. For instance, at the time of this blog entry the version for those downloads above is 1.0.19 but subsequently will vary, needless to say, as the open source development is in an dynamic state --this in stark contrast to the cave methodology practiced by the proprietary, closed source, closed standards, business entities.
Well, I am assuming that the sound card of interest is supported by the ALSA project; nevertheless, the user should visit the ALSA SoundCard Matrix to verify that in effect that is the case. Subsequently, the user should select the sound card from the list and follow the instructions provided to install sound support for her GNU/Linux system.
As an specific illustration, selecting the cs46xx for my specific instance, I proceeded as follows. I became the root or super user in my Debian system by typing:
su root
After providing my password, I was given full administration privileges to install software system wide including, of course, building the sound modules for the cs46xx sound card. Accordingly, I changed file system location:
cd /usr/src
...proceeded to create (as suggested) an directory for the ALSA sources:
mkdir --verbose /usr/src/alsa
and changed location to the newly created alsa directory:
cd alsa
Assuming that we downloaded our ALSA sources to /home/user/, where user represents an directory in your GNU/Linux system, then would have the following listing for version 1.0.19 of the ALSA sources:
alsa-driver-1.0.19.tar.bz2
alsa-lib-1.0.19.tar.bz2
alsa-utils-1.0.19.tar.bz2
Subsequently, we would extract the compressed tar files --with extension .bz2-- as follows, first the ALSA driver:
tar -xvpjPf /home/user/alsa-driver-1.0.19.tar.bz2
We proceed to decompress ALSA lib:
tar -xvpjPf /home/user/alsa-lib-1.0.19.tar.bz2
And finally, we decompress ALSA utils:
tar -xvpjPf /home/user/alsa-utils-1.0.19.tar.bz2
Note that we passed the -j option to the tar utility, hence directing it to decompress the files of extension .bz2.
Our current directory location is /usr/src/alsa/
and we should have the following directories for the downloaded ALSA sources version 1.0.19:
- /usr/src/alsa/alsa-driver-1.0.19
- /usr/src/alsa/alsa-lib-1.0.19
- /usr/src/alsa/alsa-utils-1.0.19
And we proceed to change directory to the ALSA driver directory:
cd alsa-driver-1.0.19
As directed in the instructions for the selected sound card, in my case cs46xx, we enter the following directives:
./configure --with-cards=cs46xx --with-sequencer=yes
After the operation above finishes, we proceed to enter the command:
make
If make completes satisfactory, then we should proceed to enter the directive:
make install
and we would be done with this ALSA driver sound support phase. However, under this bleeding edge GNU/Linux Debian distribution, I could not pass to the make install
phase because the prior make had not completed successfully; I had gotten the output error:
make -C /lib/modules/2.6.29-1-686/source SUBDIRS=/usr/src/alsa/alsa-driver-1.0.19 CPP="gcc -E" CC="gcc" modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.29-1-common'ERROR: Kernel configuration is invalid.
include/linux/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.WARNING: Symbol version dump /usr/src/linux-headers-2.6.29-1-common/Module.symvers
is missing; modules will have no dependencies and modversions.Building modules, stage 2.
make[1]: Leaving directory `/usr/src/linux-headers-2.6.29-1-common'
The key to solving this error turned out to be the hint provided by the darker highlighted line above: include/linux/autoconf.h or include/config/auto.conf are missing.. In effect, analyzing the directory symbolic links:
ls -l /lib/modules/2.6.29-1-686/build
/lib/modules/2.6.29-1-686/build -> /usr/src/linux-headers-2.6.29-1-686/
ls -l /lib/modules/2.6.29-1-686/source
/lib/modules/2.6.29-1-686/source -> /usr/src/linux-headers-2.6.29-1-common/
As the light blue colored source symbolic link suggests, the ALSA driver make procedure fails because neither include/linux/autoconf.h nor include/config/auto.conf are found at the target location:
/usr/src/linux-headers-2.6.29-1-common/
As a matter of fact, the target location pointed to by source above does not even have an include/config directory.
By Using Free and Open Source Software, There Exist Multiple Methodologies to Solve a Problem.
Reiterating my prior assertion, under FOSS activity the user is empowered to modify the software --or have someone else do it for her. Unlike the closed source, proprietary binary software distributions, the FOSS user may exercise any of several methodologies to solve an given issue under consideration. Accordingly, the approach that I took may not be the most elegant for my peers but it worked.
After realizing that the files/directories causing the ALSA driver make operation to fail actually were located under /usr/src/linux-headers-2.6.29-1-686/
--that is, the target pointed to by build symbolic link-- I proceeded to make available those needed resources.
We change our location to the appropriate directory, if not already there:
cd /usr/src/
Subsequently, we make a tar backup for the resources that we will operate upon; do not overlook this step since it will allow us to start over if our modifications are not adequate.
tar -cvpWPf orig_linux-headers-2.6.29-1-common.tar linux-headers-2.6.29-1-common/
Then we proceed to copy over the config directory to the directory on which we are operating (all on an single command line):
cp -rpf linux-headers-2.6.29-1-686/include/config linux-headers-2.6.29-1-common/include/.
Next, we need to copy over the contents of the linux to the the directory on which we are operating (all on an single command line):
cp -piv linux-headers-2.6.29-1-686/include/linux/* linux-headers-2.6.29-1-common/include/linux/.
this last operation will copy over the files of extension .h:
- autoconf.h
- bounds.h
- compile.h
- utsrelease.h
- version.h
And finally we should copy over Module.symvers, by typing (all in an single command line):
cp -piv linux-headers-2.6.29-1-686/Module.symvers linux-headers-2.6.29-1-common/.
Now go back to the previous directory:
cd alsa/alsa-driver-1.0.19
And execute once again make operation; this time the procedure will be successful. Follow subsequently with make install --your ALSA driver phase should succeed.
Proceed to the next phase by changing directories ti the ALSA lib:
cd /usr/src/alsa/alsa-lib-1.0.19/
Successively, entering the commands as suggested:
./configure
; make
; make install
Will yield an successful build of the ALSA libs.
Now for the final phase, change directory to ALSA utils:
cd /usr/src/alsa/alsa-utils-1.0.19/
Again, proceed to enter successfully the suggested commands, as above:
./configure
; make
; make install
If you encounter issues with your make procedure step, please ascertain that the xmlto package has been installed into your GNU/Linux. Below is an snapshot from the Synaptic Package Manager under Debian:
Finish the above three(3) phase procedure by inserting the recently built modules into the kernel. For instance, for my sound card I adhered to the sequence of commands suggested:
modprobe snd-cs46xx
; modprobe snd-pcm-oss
; modprobe snd-mixer-oss
; modprobe snd-seq-oss
Well, after these last steps the user should have sound in her GNU/Linux system distribution. If the icon for the status of the sound is crossed with red marks still, make sure to enable the speakers' sound. This can be done by selecting the icon for the alsamixergui found under the menu Applications -> Sound & Video in Debian systems. Alternatively, the user may type at her Debian shell prompt (what else?):
alsamixergui
The summoned application should become active and visible. Select with your mouse the speakers' icons --those should turn to green (in this particular illustration) when enabled. Proceed to raise the volume of the bars immediately below by selecting those with your pointer, keeping your pointer's selection button pressed, and move up to increase the volume.
Well, after enabling the sound in this particular GNU/Linux Debian distribution, I proceeded to download the Firefox web browser. Debian comes with the equivalent browser named IceWeasel but the browser check mechanism by the On24 webcast delivery agent insisted on Firefox. I disabled the Totem mozilla plugin due to interference with the MPlayer and RealPlayer plugins.
Well, I hope that with this last bit of information I have provided some insight to my GNU/Linux Ubuntu user friend. This person was experiencing sound difficulties with Firefox at an interactive web event we participated a short time ago; subsequently s/he asked me for some advice since I disclosed during the chat referenced above that I was using Debian with no issues whatsoever.
NOTE The elaborated opinions expressed do not necessarily reflect those of Metztli Information Technology as a whole.
Suggestion code for commands entered at the GNU/Linux shell prompt are provided on an AS-IS basis. Although due diligence has been applied, the information may not be accurate under all circumstances.
Consequently, please do not hold Metztli IT responsible if unforeseen effects are experienced. You are not obliged to use the information provided.
Metztli IT reserves the right to modify the procedure --including deleting the blog entry.
Thanks a lot!