LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-16-2011, 05:51 AM   #1
langerak
LQ Newbie
 
Registered: Jan 2010
Location: Netherlands
Distribution: Ubuntu 12.04
Posts: 13

Rep: Reputation: 0
Question Cross-compiling Alsa sources on x86 for ARM


Hi all,

Recently I've got hold of a thin client from HP, the t5325. This has a soundcard on-board and the latest snapshot of the linux kernel supports all the hardware for this device and I've got it all working, except the sound. I've built the kernel on a X86 system, crosscompiling it with the latest toolchain available.

The kernel supports the soundcard of the t5325, but won't play any sound. After Googling around, I found out that the needed ALSA version is 1.0.24 and Debian Sid delivers version 1.0.23, which lacks this support.

I've started compiling the sources from Alsa (on the HP) and the driver package already throws me an error stating:
checking for built-in ALSA... yes
configure: error: You have built-in ALSA in your kernel.


The error is pretty straight forward and built another kernel and left ALSA support out, in the .config I've commented all out.
When built and rebooted the HP with this new kernel, it throws the exact same error, however, that is impossible as I left alsa support out of this kernel. Even in /dev, there are no audio devices shown. I even completely purge the ALSA packages that Debian installed for me, but to no avail.

Does anyone have any tips on how to compile alsa for this device? I can try cross-compiling the alsa source on my X86 box, but not very sure on how to accomplish this.

Any help is appreciated and if any extra info is needed, let me know!
 
Old 05-19-2011, 04:52 AM   #2
robvoo
LQ Newbie
 
Registered: Jul 2009
Distribution: debian, ubuntu
Posts: 22

Rep: Reputation: 2
Are you sure it boots the newly compiled kernel and not the old one?
Did you add the kernel to the bootloader?
Maybe you can list the original .config file or a diff of the exact adjustments you made?
 
Old 05-19-2011, 05:03 AM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
what soundcard?
 
Old 05-19-2011, 05:37 AM   #4
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I got this:

Quote:
Kernel
You can build a kernel using the kirkwood kernelconfig, there is one major point to look out for and that is the XGI display driver, since this driver is staging, this needs to be extra specified in Device Drivers -> Staging Drivers, and disable the option “Disallow staging drivers from being built”, once disabled, you’ll see all the staging (testing) drivers in the current kernel, there is your XGI display driver. Also, if you want to have sound on the t5325, enable Alsa and enable the SoC audio options for the t5325 (you’ll notice the options directly).
I’ve also shared my working kernel for the t5325 on my Downloads page, check it out, if you don’t want to compile a kernel of your own.
from here:
http://lacie.busfreaks.nl/
Hope it helps

Last edited by EDDY1; 05-19-2011 at 05:38 AM.
 
Old 08-05-2011, 06:29 AM   #5
langerak
LQ Newbie
 
Registered: Jan 2010
Location: Netherlands
Distribution: Ubuntu 12.04
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by EDDY1 View Post
I got this:


from here:
http://lacie.busfreaks.nl/
Hope it helps
That's my blog, but thanks .

I've come further with cross compiling the driver, but when make is issued, I see that it does not see the arch correctly:

Code:
/root/linux-3.0//include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/root/linux-3.0//include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/root/linux-3.0//include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/root/linux-3.0//include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/root/linux-3.0//include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/root/linux-3.0//include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/root/linux-3.0//include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/root/linux-3.0//include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/root/linux-3.0//include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
Obviously there should be "arch/arm" between the double slashes " // ". I've exported ARCH=arm, but does not work, my configure command is:
Code:
./configure --with-cards=kirkwood-soc-t5325 --with-kernel=/root/linux-3.0/ --enable-dynamic-minors --with-debug=full --target=arm-linux
Any tips for this one?
 
Old 08-05-2011, 05:07 PM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
How are you compiling, post links as to how you are compiling or building alsa, so someone here can help you
 
Old 08-14-2011, 09:18 AM   #7
langerak
LQ Newbie
 
Registered: Jan 2010
Location: Netherlands
Distribution: Ubuntu 12.04
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by EDDY1 View Post
How are you compiling, post links as to how you are compiling or building alsa, so someone here can help you
I now started compiling on the box itself, using the same compiler used for compiling the kernel.

My configure options for alsa are:
Code:
./configure --with-kernel=/root/linux-3.0 --with-cards=kirkwood-soc-t5325 --with-card-options=soc-cache-lzo
With the kernel sources being in /root/linux-3.0/ my soundcard being a kirkwood-soc-t5325 and only need the soc card options as mentioned, rest is hda related and not used on this platform.

The make process goes abit further now, but hangs on:
Code:
copying file alsa-kernel/usb/usx2y/usx2yhwdeppcm.c
patching file usx2yhwdeppcm.c
Hunk #2 succeeded at 153 (offset 1 line).
Hunk #3 succeeded at 233 (offset 1 line).
Hunk #4 succeeded at 267 (offset 1 line).
Hunk #5 succeeded at 307 (offset 1 line).
Hunk #6 succeeded at 328 (offset 1 line).
Hunk #7 succeeded at 454 (offset 1 line).
Hunk #8 succeeded at 482 (offset 1 line).
Hunk #9 succeeded at 715 (offset 1 line).
Hunk #10 succeeded at 728 (offset 1 line).
Hunk #11 succeeded at 803 (offset 1 line).
make[3]: Leaving directory `/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/usb/usx2y'
make[2]: Leaving directory `/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/usb'
make[1]: Leaving directory `/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70'
make -C /root/linux-3.0 SUBDIRS=/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70  CPP="gcc -E" CC="gcc" modules
make[1]: Entering directory `/root/linux-3.0'
  CC [M]  /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.o
In file included from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:19:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/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 /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:63,
                 from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:19:
include/linux/gfp.h:147:1: warning: this is the location of the previous definition
In file included from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:19:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:752: error: static declaration of ‘jiffies_to_msecs’ follows non-static declaration
include/linux/jiffies.h:296: note: previous declaration of ‘jiffies_to_msecs’ was here
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:771: error: static declaration of ‘msecs_to_jiffies’ follows non-static declaration
include/linux/jiffies.h:298: note: previous declaration of ‘msecs_to_jiffies’ was here
In file included from include/linux/scatterlist.h:6,
                 from include/linux/dma-mapping.h:7,
                 from include/asm-generic/pci-dma-compat.h:7,
                 from /root/linux-3.0/arch/arm/include/asm/pci.h:5,
                 from include/linux/pci.h:1293,
                 from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:872,
                 from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:19:
include/linux/mm.h:290: error: conflicting types for ‘snd_compat_vmalloc_to_page’
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:673: note: previous declaration of ‘snd_compat_vmalloc_to_page’ was here
In file included from /root/linux-3.0/arch/arm/include/asm/pci.h:5,
                 from include/linux/pci.h:1293,
                 from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:872,
                 from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:19:
include/asm-generic/pci-dma-compat.h:110: error: expected identifier or ‘(’ before numeric constant
In file included from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:19:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h: In function ‘snd_pci_orig_save_state’:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:1121: error: too many arguments to function ‘pci_save_state’
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h: In function ‘snd_pci_orig_restore_state’:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:1125: error: too many arguments to function ‘pci_restore_state’
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:1125: error: void value not ignored as it ought to be
In file included from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:19:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:1526:1: warning: "page_to_pfn" redefined
In file included from /root/linux-3.0/arch/arm/include/asm/memory.h:304,
                 from /root/linux-3.0/arch/arm/include/asm/system.h:165,
                 from /root/linux-3.0/arch/arm/include/asm/bitops.h:27,
                 from include/linux/bitops.h:22,
                 from include/linux/kernel.h:17,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:7,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:63,
                 from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/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 /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:19:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h: At top level:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:1697: error: static declaration of ‘pci_ioremap_bar’ follows non-static declaration
include/linux/pci.h:1444: note: previous declaration of ‘pci_ioremap_bar’ was here
In file included from /root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:19:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/include/adriver.h:1927: error: static declaration of ‘vzalloc’ follows non-static declaration
include/linux/vmalloc.h:54: note: previous declaration of ‘vzalloc’ was here
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c: In function ‘snd_compat_vmalloc_to_page’:
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:38: error: implicit declaration of function ‘VMALLOC_VMADDR’
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:40: error: ‘init_mm’ undeclared (first use in this function)
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:40: error: (Each undeclared identifier is reported only once
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:40: error: for each function it appears in.)
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:44: error: implicit declaration of function ‘pte_offset’
/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.c:44: warning: assignment makes pointer from integer without a cast
make[3]: *** [/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore/memory_wrapper.o] Error 1
make[2]: *** [/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70/acore] Error 2
make[1]: *** [_module_/root/alsa-driver-1.0.24.47.gfa552.1132.g89a70] Error 2
make[1]: Leaving directory `/root/linux-3.0'
make: *** [compile] Error 2
Before this error there is alot of messages of foldes that are being worked through and alot of patches being applied.

Stupidly enough this also occurs when cross-compiling this driver. I've also emailed this to the alsa mailing list, but no answers yet.

From what I can make of it, it seems to be related to some memory related functions given in the kernel.

If you need more info, let me know .

Last edited by langerak; 08-14-2011 at 09:29 AM.
 
  


Reply

Tags
alsa, crosscompile, kernel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cross compiling for arm with buildroot brooko Slackware 3 01-29-2011 11:42 AM
Cross compiling for ARM Hachaso Programming 1 06-26-2009 06:07 AM
Problem compiling BlueZ stack on ARM ( cross compilation from linux x86) shilpates Linux - Wireless Networking 1 08-20-2008 03:02 AM
Cross compiling utftpd on x86 for arm SachinTCS Linux - Software 1 04-13-2007 09:50 PM
Cross compiling utftpd for arm SachinTCS Linux - Desktop 1 04-13-2007 02:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration