2005-02-15 09:49:03

by Sebastian Roth

[permalink] [raw]
Subject: [Bluez-devel] snd-bt-sco built-in

Hi,

I'm trying to build snd-bt-sco directly into the kernel.
Patched the kernel source a bit and it built ok.
On bootup my kernel oopses:

snd-bt-sco revision 1.4 $
Unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip:
c02b7f92
*pde = 00000000
Oops: 0000 [#1]
Modules linked in:
CPU: 0
EIP: 0060: [<C02B7F92>] Not tainted VLI
EFLAGS: 00010246 (2.6.10-mh4-sr1)
EIP is at snd_minor_search+0x12/0x50
eax: 00000000 ebx: c7e3a8e0 ecx: c7ffb160 edx: 00000000
esi: 00000000 edi: c7e3a802 ebp: c7fc7f38 esp: c7fc7eec
ds: 007b es: 007b ss: 0068
Process swapper (pid: 1, threadinfo: c7fc6000, task: c113f9e0)
Stack: c7e3a8e0 c7fc7f42 c02b8259 00000000 000000d0 00000000 380380c8
00000000
00000000 c0434384 c7e30000 00000000 00000000 c02bce8d 00000000
c7e30000
00000000 c0434384 c7fc7f38 746e6f63 436c6f72 00000030 c04a2bb0
c7e30000
Call Trace:
[<c02b8259>] snd_register_device+0xc9/0x1a0
[<c02bce8d>] snd_ctl_register+0x4d/0x70
[<c02b8c70>] snd_card_free_thread+0x0/0x80
[<c02b877a>] snd_card_new+0x19a/0x280
[<c0498009>] snd_card_bt_sco_probe+0x29/0x260
[<c0498267>] alsa_card_bt_sco_init+0x27/0x40
[<c04788f3>] do_initcalls+0x23/0xc0
[<c049a9f6>] sock_init+0x46/0x50
[<c0100440>] init+0x0/0x120
[<c010046a>] init+0x2a/0x120
[<c0100858>] kernel_thread_helper+0x0/0x18
[<c010085d>] kernel_thread_helper+0x5/0x18
Code: 20 3c c0 89 44 24 04 e9 ad e1 e6 ff 8d b6 00 00 00 00 8d bc 27 00
00 00 0
0 56 53 8b 74 24 0c 89 f0 c1 f8 05 8b 14 c5 a0 75 4c c0 <8b> 0a 8b 74 26
00 8d
04 c5 a0 75 4c c0 39 c2 74 22 89 c3 8d 74
<0>Kernel panic - not syncing: Attempted to kill init!


Digging through the source I found this in sound/core/sound.c:
...
static snd_minor_t *snd_minor_search(int minor)
{
struct list_head *list;
snd_minor_t *mptr;

list_for_each(list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]) {
mptr = list_entry(list, snd_minor_t, list);
if (mptr->number == minor)
return mptr;
}
return NULL;
}
...

To find out what's going wrong I added some debug messages:
...
printk(KERN_INFO "snd_minors_hash: minor: %d\n", minor);
list_for_each(list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]) {
printk(KERN_INFO "snd_minors_hash: list_for_each\n");
...

The kernel oopses the same way:
...
snd-bt-sco revision 1.4 $
snd_minors_hash: minor: 0
Unable to handle kernel NULL pointer dereference at virtual address 00000000
...

As other soundcard drivers can be built in I think this is no problem
with the kernel or ALSA-core.
Can someone please point me to why this is happening or is it known
that snd-bt-sco is working as module only?
Thanks in advance.

Best regards,
Sebastian



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2005-02-15 16:07:33

by Sebastian Roth

[permalink] [raw]
Subject: [Bluez-devel] Re: snd-bt-sco built-in (solved)

Hi,

I found the problem! To built it into the kernel I added a directory
under sound called bluetooth. Getting the make-system to compile the
module you have to add this path to sound/Makefile:

cat /usr/src/linux/sound/Makefile
...
obj-$(CONFIG_SND) += bluetooth/ core/ i2c/ drivers/ isa/ pci/ ppc/ arm/
synth/ usb/ sparc/ parisc/ pcmcia/
...

Really don't know why but I've put it in the first position (before
core). This leads to the problem that on bootup ALSA isn't initialized
yet when snd_bt_sco is trying to use it. oops...


cat /usr/src/linux/sound/Makefile #(correct one!)
...
obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ synth/
usb/ sparc/ parisc/ pcmcia/ bluetooth/
...

Now the kernel boots up! A brief test with one of the headsets was ok!

Best regards,
Sebastian



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-02-15 12:02:52

by Sebastian Roth

[permalink] [raw]
Subject: [Bluez-devel] Re: snd-bt-sco built-in

Hi Lars,

thanks for your fast reply!

> | I'm trying to build snd-bt-sco directly into the kernel.
>
> why?
I'm working on a project in which a "communication-server" should use
bluetooth headsets...
So I want to have the kernel with all functions built-in. If this is
not possible I'll have to load it on startup. ;-(


> I can't tell for sure why this function is failing this way. Did you
> build snd-hw-dep and put it in the kernel, too? If it's missing than
> that could be the problem.
That was my first guess too! But it's built-in

grep SND /boot/config-2.6.10-mh4-sr1 | grep -v "^#"
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_HWDEP=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_RTCTIMER=m
CONFIG_SND_AC97_CODEC=y
CONFIG_SND_EMU10K1=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_BT_SCO=y


Best regards,
Sebastian



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-02-15 10:04:00

by Lars Grunewaldt

[permalink] [raw]
Subject: Re: [Bluez-devel] snd-bt-sco built-in

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sebastian Roth wrote:
| Hi,
|
| I'm trying to build snd-bt-sco directly into the kernel.

why?

| As other soundcard drivers can be built in I think this is no problem
| with the kernel or ALSA-core.
| Can someone please point me to why this is happening or is it known
| that snd-bt-sco is working as module only?

I think nobody ever tried to compile it into the kernel, and I definitly
never did. I think it's not written with that in mind.

I can't tell for sure why this function is failing this way. Did you
build snd-hw-dep and put it in the kernel, too? If it's missing than
that could be the problem. I think the dynamic loader would notice in a
module, but propably not if the kernel itself is missing it.

best regards,
~ Lars

|
| -------------------------------------------------------
| SF email is sponsored by - The IT Product Guide
| Read honest & candid reviews on hundreds of IT Products from real users.
| Discover which products truly live up to the hype. Start reading now.
| http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
| _______________________________________________
| Bluez-devel mailing list
| [email protected]
| https://lists.sourceforge.net/lists/listinfo/bluez-devel
|


- --
Lars Grunewaldt
* software development
* multimedia design
skills: C/C++/Java/PHP/(X)HTML/Flash/audio/video
web: http://www.dark-reality.de
mail: [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCEckQQWC6DTWkDAoRAgOZAJ9HKs/CoqCdoIuBAou5UlUcrPisYQCglwlJ
ai8YKl5y0NI5RV7HMv1Lczw=
=QLIf
-----END PGP SIGNATURE-----


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel