[Bboard xM] Compiling ALSA drivers under Angstrom

Sorry about the first empty message, looks like I ran into an error when I posted it the first time.

Hello there,

I think I need some help in the process of compiling alsa-drivers for my Angstrom. Let me give some context first :
I’m working in the domain of audio and loudness control, and I use the Beagleboard to host a demonstrative application. I need to use an external USB soundcard (in my case, Sweex SC016 which uses the C-media CM6206 chip) because this little system has to work with optical I/O for sound. The problem is that, under Linux, the S/PDIF (optical) input is not enabled by default by the ALSA driver.

I managed to identify the file I need to edit to enable it :

/* alsa-driver-1.0.24/sound/usb/quirks.c */ 383 static int snd_usb_cm6206_boot_quirk(struct usb_device *dev) 384 { 385 int err, reg; 386 int val[] = {0x200c, 0x3005, 0xf800, 0x143f, 0x0000, 0x3000}; 387 388 for (reg = 0; reg < ARRAY_SIZE(val); reg++) { 389 err = snd_usb_cm106_write_int_reg(dev, reg, val[reg]); 390 if (err < 0) 391 return err; 392 } 393 394 return err; 395 }
According to the CM6206 datasheet, I just have to modify the value of register 1 to 0x3005 (in the file, it’s originally 0x3000) to enable S/PDIF loopback and S/PDIF IN Mix.
So basically I have to re-compile ALSA and it should boot the device the way I want it to.

What I did so far :

  • I got the source of the kernel I’m using in my Angstrom (linux-2.6.32.59) ;
  • Compiled it using the following steps : make config (I let everything default there) ; make dep ; make clean ; make bzImage ;
  • Configured ALSA using : ./configure --with-cards=usb-audio --with-sequencer=yes --with-card-options=all --with-kernel=…/linux-2.6.32.59
  • I’m currently trying to make ALSA but encounter errors.
    Here’s the end of the output :

make[1]: Entering directory/home/root/linux’
CC [M] /home/root/alsa-driver-1.0.25/acore/memory_wrapper.o
In file included from /home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:19:
/home/root/alsa-driver-1.0.25/include/adriver.h:293:1: warning: “GFP_DMA32” redefined
In file included from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /home/root/alsa-driver-1.0.25/include/adriver.h:63,
from /home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:19:
include/linux/gfp.h:116:1: warning: this is the location of the previous definition
In file included from /home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:19:
/home/root/alsa-driver-1.0.25/include/adriver.h:752: error: static declaration of ‘jiffies_to_msecs’ follows non-static declaration
include/linux/jiffies.h:296: error: previous declaration of ‘jiffies_to_msecs’ was here
/home/root/alsa-driver-1.0.25/include/adriver.h:771: error: static declaration of ‘msecs_to_jiffies’ follows non-static declaration
include/linux/jiffies.h:298: error: previous declaration of ‘msecs_to_jiffies’ was here
In file included from /home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:19:
/home/root/alsa-driver-1.0.25/include/adriver.h:1541:1: warning: “page_to_pfn” redefined
In file included from /home/root/linux/arch/arm/include/asm/memory.h:310,
from /home/root/linux/arch/arm/include/asm/page.h:201,
from include/linux/mmzone.h:20,
from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /home/root/alsa-driver-1.0.25/include/adriver.h:63,
from /home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:19:
include/asm-generic/memory_model.h:72:1: warning: this is the location of the previous definition
In file included from /home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:20:
include/linux/mm.h:273: error: conflicting types for ‘snd_compat_vmalloc_to_page’
/home/root/alsa-driver-1.0.25/include/adriver.h:673: error: previous declaration of ‘snd_compat_vmalloc_to_page’ was here
In file included from /home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:20:
include/linux/mm.h: In function ‘lowmem_page_address’:
include/linux/mm.h:596: error: implicit declaration of function ‘page_to_pfn’
/home/root/alsa-driver-1.0.25/acore/memory_wrapper.c: In function ‘snd_compat_vmalloc_to_page’:
/home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:38: error: implicit declaration of function ‘VMALLOC_VMADDR’
/home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:40: error: ‘init_mm’ undeclared (first use in this function)
/home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:40: error: (Each undeclared identifier is reported only once
/home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:40: error: for each function it appears in.)
/home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:44: error: implicit declaration of function ‘pte_offset’
/home/root/alsa-driver-1.0.25/acore/memory_wrapper.c:44: warning: assignment makes pointer from integer without a cast
make[3]: *** [/home/root/alsa-driver-1.0.25/acore/memory_wrapper.o] Error 1
make[2]: *** [/home/root/alsa-driver-1.0.25/acore] Error 2
make[1]: *** [module/home/root/alsa-driver-1.0.25] Error 2
make[1]: Leaving directory `/home/root/linux’
make: *** [compile] Error 2

`

Someone discussed about the same errors here : http://forum.nas-central.org/viewtopic.php?f=26&t=2941&start=45 but did not find the solution. I’ve tried a few #defines/#ifdef combos and this kind of things, but it didn’t help.

If anyone is familiar with kernel+ALSA compiling (which is absolutely not my case), I’ll be glad to read his ideas !