Page 1 of 1

recompiling alsa on pi

Posted: Sun Mar 10, 2013 7:24 am
by georgeperkins
I'm trying to compile alsa-driver on a raspberry pi in order to apply a patch for my soundcard.
I have the correct version of the kernel source installed.
So far, I've tried this with v 3.2.0-4 and v 3.6.y.

I've managed this several times on my linux desktop, but am struggling on the pi.
./configure --with-sequencer=yes --with-cards=usb-audio runs successfully, but make fails (see output below).

Regarding the redefinition errors, I have seen in other ARM device threads that in this case, the kernel already provides the definitions jiffies_to_msecs etc. Indeed, if I define them in alsa-driver-1.0.25/include/adriver.h, this fixes the error.

But I am confused by the underlying cause of why configure is failing to identify the kernels declarations and the subsequent errors.

I'd appreciate any input from the group.

end of "make" output:

ake -C /lib/modules/3.2.0-4-rpi/build
SUBDIRS=/home/pi/alsa-driver-1.0.25 CPP="gcc -E" CC="gcc" modules
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-4-rpi'
CC [M] /home/pi/alsa-driver-1.0.25/acore/hwdep.o
In file included from /home/pi/alsa-driver-1.0.25/acore/hwdep.c:1:0:
/home/pi/alsa-driver-1.0.25/include/adriver.h:293:0: warning:
"GFP_DMA32" redefined [enabled by default]
/usr/src/linux-headers-3.2.0-4-common/include/linux/gfp.h:147:0: note:
this is the location of the previous definition
In file included from /home/pi/alsa-driver-1.0.25/acore/hwdep.c:1:0:
/home/pi/alsa-driver-1.0.25/include/adriver.h:752:28: error: static
declaration of ‘jiffies_to_msecs’ follows non-static declaration
/usr/src/linux-headers-3.2.0-4-common/include/linux/jiffies.h:296:21:
note: previous declaration of ‘jiffies_to_msecs’ was here
/home/pi/alsa-driver-1.0.25/include/adriver.h:771:29: error: static
declaration of ‘msecs_to_jiffies’ follows non-static declaration
/usr/src/linux-headers-3.2.0-4-common/include/linux/jiffies.h:298:22:
note: previous declaration of ‘msecs_to_jiffies’ was here
In file included from /home/pi/alsa-driver-1.0.25/acore/hwdep.c:1:0:
/home/pi/alsa-driver-1.0.25/include/adriver.h:1541:0: warning:
"page_to_pfn" redefined [enabled by default]
/usr/src/linux-headers-3.2.0-4-common/include/asm-generic/memory_model.h:72:0:
note: this is the location of the previous definition
In file included from /home/pi/alsa-driver-1.0.25/acore/hwdep.c:1:0:
/home/pi/alsa-driver-1.0.25/include/adriver.h:1945:21: error: static
declaration of ‘vzalloc’ follows non-static declaration
/usr/src/linux-headers-3.2.0-4-common/include/linux/vmalloc.h:55:14:
note: previous declaration of ‘vzalloc’ was here
In file included from /home/pi/alsa-driver-1.0.25/acore/hwdep.c:26:0:
/usr/src/linux-headers-3.2.0-4-common/include/linux/slab.h:243:21:
error: static declaration of ‘snd_compat_kcalloc’ follows non-static
declaration
/home/pi/alsa-driver-1.0.25/include/adriver.h:928:7: note: previous
declaration of ‘snd_compat_kcalloc’ was here
/usr/src/linux-headers-3.2.0-4-common/include/linux/slab.h:338:21:
error: static declaration of ‘snd_compat_kzalloc’ follows non-static
declaration
/home/pi/alsa-driver-1.0.25/include/adriver.h:943:7: note: previous
declaration of ‘snd_compat_kzalloc’ was here
/home/pi/alsa-driver-1.0.25/acore/hwdep.c: In function ‘snd_hwdep_ioctl_old’:
/home/pi/alsa-driver-1.0.25/acore/hwdep.c:331:2: error: implicit
declaration of function ‘unlock_kernel’
[-Werror=implicit-function-declaration]
/home/pi/alsa-driver-1.0.25/acore/hwdep.c:333:2: error: implicit
declaration of function ‘lock_kernel’
[-Werror=implicit-function-declaration]
/home/pi/alsa-driver-1.0.25/acore/hwdep.c: At top level:
/home/pi/alsa-driver-1.0.25/acore/hwdep.c:357:2: error: unknown field
‘ioctl’ specified in initializer
/home/pi/alsa-driver-1.0.25/acore/hwdep.c:357:2: warning:
initialization from incompatible pointer type [enabled by default]
/home/pi/alsa-driver-1.0.25/acore/hwdep.c:357:2: warning: (near
initialization for ‘snd_hwdep_f_ops.unlocked_ioctl’) [enabled by
default]
cc1: some warnings being treated as errors
make[5]: *** [/home/pi/alsa-driver-1.0.25/acore/hwdep.o] Error 1
make[4]: *** [/home/pi/alsa-driver-1.0.25/acore] Error 2
make[3]: *** [_module_/home/pi/alsa-driver-1.0.25] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-4-rpi'
make: *** [compile] Error 2

Thanks

Re: recompiling alsa on pi

Posted: Sun Mar 10, 2013 3:13 pm
by aaa801
error: static
declaration of ‘jiffies_to_msecs’ follows non-static declaration

it doesnt like that ;)

Re: recompiling alsa on pi

Posted: Tue Apr 16, 2013 10:50 am
by remsnet
georgeperkins wrote:I'm trying to compile alsa-driver on a raspberry pi in order to apply a patch for my soundcard.
I have the correct version of the kernel source installed.
So far, I've tried this with v 3.2.0-4 and v 3.6.y.

....

Thanks
Well ,

use the 3.8.y., Compile first an fresh kernel 3.8.6 , then your alsa-driver
Post & Apply the patch to GIT-HUB RPI kernel repo https://github.com/raspberrypi/linux after you got it to work.

happy hacking.