 |
Linode Forum Linode Community Forums
|
| Author |
Message |
prehensile
Joined: 27 Oct 2011
Posts: 4
|
| Posted: Thu Oct 27, 2011 4:08 am Post subject: Configuring ALSA dummy output / building kernel modules? |
|
|
Hi all,
I'm trying to set up ALSA with a dummy driver, so I can play around with audio streaming. I've been trying to follow the instructions here:
Quote:
http://www.alsa-project.org/main/index.php/Matrix:Module-dummy
but not getting very far. To be honest hacking about with kernel modules is a bit beyond me.
The docs at the link seem to be suggesting that I need to compile a kernel module to get a dummy sound driver. First hurdle: I don't have the kernel sources on my linode. uname -a returns the following:
Quote:
Linux moominpapa 2.6.39.1-linode34 #1 SMP Tue Jun 21 10:29:24 EDT 2011 i686 GNU/Linux
so I downloaded the source tarball for 2.6.39.1 from kernel.org into /usr/src, unzipped it and linked /usr/src/linux to /usr/src/linux-2.6.39.1.
Now, when I try to compile the dummy sound driver, using this line from the docs referenced above:
Quote:
./configure --with-cards=dummy --with-sequencer=yes
I get the following compile error:
Quote:
...
checking for kernel linux/version.h ... no
The file /usr/src/linux/include/INCLUDE_VERSION_H does not exist.
And that's where I run out of ideas.
So, some questions for the wise:
Is there a way to set up a dummy driver for ALSA without having to compile kernel modules?
Surely there must be some APT packages for this? apt-cache searches don't return anything immediately obvious for alsa-drivers.
If I do indeed need to compile the modules, is this supported by Linode?
What am I doing wrong re: module compilation? Have I linked /usr/src/linux to the wrong place?
|
|
| Back to top |
|
hoopycat
Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York
|
| Posted: Thu Oct 27, 2011 7:41 am Post subject: |
|
|
I think you want to gunzip and copy /proc/config.gz to /usr/src/linux/.config then run 'make oldconfig' ... I believe that's what creates the version.h.
As a practical matter, though, running your distro's kernel and installing its alsa dummy modules (or your own kernel, if it comes down to it) tends to work out a little better: modules are compiled to specific kernel versions, so upgrades become a bit of a bear. See http://library.linode.com/linode-platform/custom-instances for tips on that. |
|
| Back to top |
|
prehensile
Joined: 27 Oct 2011
Posts: 4
|
| Posted: Thu Oct 27, 2011 10:10 am Post subject: |
|
|
Thanks, hoopycat, that's a useful clue.
After spending a long time and a lot of Googling trying to get this to work today, I've adopted a different strategy: it turns out that as of 2.5, ALSA was included in the linux sources. So, no extra download needed: if you've got the kernel sources, you've got ALSA.
So, I upgraded my kernel to the newest supplied by Linode (3.0.4 at the time I write this), and downloaded the sources to 3.0.4 from kernel.org to /usr/src.
Copying the config from /proc/config.gz got the config that was used to build the current kernel. Of course, since this is a linode-supplied kernel, it doesn't have ALSA enabled by default, or any of the sound driver modules. So, I used make menuconfig to edit the config and enable these, modularised.
Then, make modules appeared to build the modules I needed. make modules_install seemed to install them to /lib/modules.
However, modinfo soundcore failed, because the modules were in /lib/modules/3.0.4, not /lib/modules/3.0.4-linode38. So I linked /lib/modules/3.0.4-linode38 to /lib/modules/3.0.4.
modinfo still failed, complaining of a missing modules.dep, so I ran depmod to create that. Finally, modinfo soundcore worked!
Quote: filename: /lib/modules/3.0.4-linode38/kernel/sound/soundcore.ko
license: GPL
author: Alan Cox
description: Core sound module
depends:
vermagic: 3.0.4 SMP mod_unload modversions CORE2
However, modprobe snd-dummy fails.
Quote:
WARNING: All config files need .conf: /etc/modprobe.d/blacklist-modem, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/alsa-base, it will be ignored in a future release.
WARNING: Error inserting soundcore (/lib/modules/3.0.4-linode38/kernel/sound/soundcore.ko): Invalid module format
WARNING: Error inserting snd (/lib/modules/3.0.4-linode38/kernel/sound/core/snd.ko): Invalid module format
WARNING: Error inserting snd_timer (/lib/modules/3.0.4-linode38/kernel/sound/core/snd-timer.ko): Invalid module format
WARNING: Error inserting snd_pcm (/lib/modules/3.0.4-linode38/kernel/sound/core/snd-pcm.ko): Invalid module format
FATAL: Error inserting snd_dummy (/lib/modules/3.0.4-linode38/kernel/sound/drivers/snd-dummy.ko): Invalid module format
I don't get it. Is stock 3.0.4 really so different from 3.0.4-linode38 that modules compiled against it are incompatible? |
|
| Back to top |
|
prehensile
Joined: 27 Oct 2011
Posts: 4
|
| Posted: Thu Oct 27, 2011 10:36 am Post subject: |
|
|
| Ah. I think I just realised what hoopycat meant about custom kernels. If I can't work out how to compile for the linode-supplied one, maybe I should just compile my own. Then at least I know the kernel'll match the modules. |
|
| Back to top |
|
Guspaz
Joined: 26 May 2009
Posts: 1150
Location: Montreal, QC
|
| Posted: Thu Oct 27, 2011 10:39 am Post subject: |
|
|
| You can't load kernel modules against a linode kernel, IIRC. You need to use your own kernel and load modules against it. I think. |
|
| Back to top |
|
caker
Joined: 15 Apr 2003
Posts: 2907
Location: Galloway, NJ
|
| Posted: Thu Oct 27, 2011 11:09 am Post subject: |
|
|
Guspaz wrote: You can't load kernel modules against a linode kernel, IIRC. You need to use your own kernel and load modules against it. I think.
Incorrect. You can load modules just fine into our provided kernels - however modprobe will likely complain unless you match the kernel version string and gcc versions used to compile the kernel and the module.
-Chris |
|
| Back to top |
|
prehensile
Joined: 27 Oct 2011
Posts: 4
|
| Posted: Fri Oct 28, 2011 5:09 am Post subject: |
|
|
So, I finally got this to work last night. If anyone else stumbles across this thread when searching for help: the moral of the story is, if you want to load kernel modules on your Linode, by far the most painless way is to compile your own kernel using the instructions at http://library.linode.com/linode-platform/custom-instances which make the whole process pretty straightforward.
Thanks hoopycat & caker for the help along the way! |
|
| Back to top |
|
| |
|