Hi all,

I had some luck getting rid of the warnings, but I still get a
segmentation fault when loading em28xx-audio - however, now the
message is a BUG: unable to handle kernel paging request (output of
dmesg when modprobe em28xx-audio: http://pastebin.com/f6513908a ).

I would greatly appreciate any help and guidance to get rid of it. I
too believe, like elsewhere said, that this may be a problem with
versions of objects / kernels - in that case, I'd be ready to go back
to other drivers or objects or kernels, or compile the kernel and ALSA
drivers and v4l from scratch, but I really need some guidance on what
would be the most viable to do - and in particular, how to read / keep
track of current versions of objects and whether they do not match...

The procedure I did to get rid of the symbols is outlined below..

Thanks in advance for any comments,
Cheers


........................


First of all, I got inspired by
http://groups.google.com/group/linux.kernel/msg/d19d43a4f3de4ff1
Author: S.Çağlar Onur <[EMAIL PROTECTED]>
Date:   Sun Feb 10 05:27:23 2008 +0200
    drivers/media/video/em28xx/: Fix undefined symbol error with CONFIG_SND=N
    Without this you get undefined symbol errors with CONFIG_SND=N:
      ERROR: "snd_pcm_period_elapsed"
[drivers/media/video/em28xx/em28xx-alsa.ko] undefined!
--- drivers/media/video/em28xx/Kconfig
+++ drivers/media/video/em28xx/Kconfig
@@ -13,7 +13,8 @@
          module will be called em28xx
  config VIDEO_EM28XX_ALSA
-       depends on VIDEO_EM28XX
+       depends on VIDEO_EM28XX && SND
+       select SND_PCM
        tristate "Empia EM28xx ALSA audio module"

What this probably says that functions in snd.ko and snd-pcm.ko should
somehow be 'linked' to em28xx-alsa, so that the symbols are resolved.

I also realised that there are several versions of v4l-dvb, which
em28xx is a part of. Turns out, I have used both
http://mcentral.de/hg/~mrec/v4l-dvb-kernel and
http://linuxtv.org/hg/v4l-dvb (and possibly others). It is that
linuxtv.org/hg/v4l-dvb driver (or rather the one I got at
http://linuxtv.org/hg/v4l-dvb/archive/tip.tar.gz, which I think is the
same), is the one where there is a em28xx-audio source, which compiles
to em28xx-alsa.ko. So the above symbol linking problem should apply to
em28xx-audio as well?

Now, the problem is that I don't know how to use Kconfig ( or kbuild?
is that for KDE? I'm on ubuntu 8.04 gnome) which the fix seems to be
for; and I don't know how to make dependencies in makefiles. What I
found, is that I can sort of simulate linking in makefiles, my editing
the /v4l/Module.symvers file that gets generated by the v4l-dvb make
process.

So, after all those builds and cleanings, last time I compiled
linuxtv.org/hg/v4l-dvb, even em28xx itself had symbol problems. So, I
tried to start from scratch - clean everything and run:

hg clone http://mcentral.de/hg/~mrec/v4l-dvb-kernel
cd v4l-dvb-kernel
sudo make LINUXINCLUDE="-I`pwd`/linux/include -I`pwd`/v4l -Iinclude
-I/usr/src/linux-headers-2.6.24-12-generic/include/linux -include
include/linux/autoconf.h"

I build all modules (some 199), although I found since, that one can
use 'make menuconfig' to select only the needed drivers..

at this make, I get the famous errors:

  Building modules, stage 2.
  MODPOST 199 modules
WARNING: "snd_pcm_lib_ioctl"
[/usr/src/v4l-dvb-kernel/v4l/em28xx-audio.ko] undefined!
WARNING: "snd_pcm_period_elapsed"
[/usr/src/v4l-dvb-kernel/v4l/em28xx-audio.ko] undefined!
WARNING: "snd_pcm_hw_constraint_integer"
[/usr/src/v4l-dvb-kernel/v4l/em28xx-audio.ko] undefined!
WARNING: "snd_card_register"
[/usr/src/v4l-dvb-kernel/v4l/em28xx-audio.ko] undefined!
WARNING: "snd_pcm_set_ops"
[/usr/src/v4l-dvb-kernel/v4l/em28xx-audio.ko] undefined!
WARNING: "snd_pcm_new" [/usr/src/v4l-dvb-kernel/v4l/em28xx-audio.ko] undefined!
WARNING: "snd_card_new" [/usr/src/v4l-dvb-kernel/v4l/em28xx-audio.ko] undefined!
WARNING: "snd_card_free" [/usr/src/v4l-dvb-kernel/v4l/em28xx-audio.ko]
undefined!

Now, first I try running
modinfo snd
modinfo snd-pcm

to find the locations of the .ko modules that get loaded by default. I get:
filename:
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd.ko
filename:
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd-pcm.ko

Then I 'dump' the symbol tables of these .ko files:

readelf -s /lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd.ko
> snd.txt
readelf -s 
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd-pcm.ko
> snd-pcm.txt

Then, open these text files in gedit, and search for all missing
symbols like "snd_pcm_period_elapsed".. One gets at least two finds,
say:
   121: 000022e0   841 FUNC    GLOBAL DEFAULT    2 snd_pcm_period_elapsed
   139: f9efe8b0     0 NOTYPE  GLOBAL DEFAULT  ABS __crc_snd_pcm_period_elapsed

It is the hex adress of the __crc_ entry (the one with ABS) that is needed..

Finally, I open  /v4l-dvb-kernel/v4l/Module.symvers, and add entries
for all missing symbols, like
0x640dad5e      snd_pcm_new     
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd-pcm   
EXPORT_SYMBOL
0x55ccbe2a      snd_pcm_set_ops 
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd-pcm   
EXPORT_SYMBOL
0x24ff27d0      snd_pcm_lib_ioctl       
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd-pcm   
EXPORT_SYMBOL
0xf9efe8b0      snd_pcm_period_elapsed  
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd-pcm   
EXPORT_SYMBOL
0x53dac402      snd_pcm_hw_constraint_integer   
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd-pcm   
EXPORT_SYMBOL
0x497891bc      snd_card_new    
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd       
EXPORT_SYMBOL
0xe594a857      snd_card_register       
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd       
EXPORT_SYMBOL
0xed23649b      snd_card_free   
/lib/modules/2.6.24-12-generic/ubuntu/sound/alsa-driver/acore/snd       
EXPORT_SYMBOL

Then save Module.symvers, run make again. em28xx-audio recompiles, no
errors are reported. However, then when it is loaded (either by
modprobe or by /etc/modules) the above BUG: unable to handle kernel
paging request occurs...


My latest data:
cat /proc/asound/version: Advanced Linux Sound Architecture Driver
Version 1.0.16.
Compiled on Mar 11 2008 for kernel 2.6.24-12-generic (SMP).
uname -a: Linux LJUTFRAER 2.6.24-12-generic #1 SMP Wed Mar 12 23:01:54
UTC 2008 i686 GNU/Linux
cat /proc/version: Linux version 2.6.24-12-generic ([EMAIL PROTECTED])
(gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu4)) #1 SMP Wed Mar 12 23:01:54
UTC 2008
cat /etc/issue: Ubuntu hardy (development branch)
_______________________________________________
Em28xx mailing list
Em28xx@mcentral.de
http://mcentral.de/mailman/listinfo/em28xx

Reply via email to