Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Oct 27, 2011 5:08 am 
Offline
Newbie

Joined: Thu Oct 27, 2011 4:47 am
Posts: 4
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:

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?


Top
   
 Post subject:
PostPosted: Thu Oct 27, 2011 8:41 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
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-platfo ... -instances for tips on that.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Oct 27, 2011 11:10 am 
Offline
Newbie

Joined: Thu Oct 27, 2011 4:47 am
Posts: 4
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?


Top
   
 Post subject:
PostPosted: Thu Oct 27, 2011 11:36 am 
Offline
Newbie

Joined: Thu Oct 27, 2011 4:47 am
Posts: 4
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.


Top
   
 Post subject:
PostPosted: Thu Oct 27, 2011 11:39 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
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.


Top
   
 Post subject:
PostPosted: Thu Oct 27, 2011 12:09 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
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


Top
   
 Post subject:
PostPosted: Fri Oct 28, 2011 6:09 am 
Offline
Newbie

Joined: Thu Oct 27, 2011 4:47 am
Posts: 4
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-platfo ... -instances which make the whole process pretty straightforward.

Thanks hoopycat & caker for the help along the way!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group