# NFORCE nvsound module 1.0-0310 and Gentoo kernels>2.6.12

## achtzehn

Dear all,

I've been trying to use nvsound kernel module for my NForce 2 audio controller.

With Gentoo kernel 2.6.12-r9 this works great. All kernels above (tried 2.6.13-gentoo-r3 and 2.6.14-gentoo-r5) oopsed when I modprobed the module (of course, I recompiled the module for each kernel).

I tried the 1.0-0310 version from NVidia's website as well as an older 1.0-0306.

Anyone having the same problem? Any ideas?

Background: 

System: Athlon XP on a Asus A7N8X-Deluxe mainboard

GCC: gcc-Version 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7. :Cool: 

lspci: 

00:05.0 Multimedia audio controller: nVidia Corporation nForce Audio Processing Unit (rev a2)

00:06.0 Multimedia audio controller: nVidia Corporation nForce2 AC97 Audio Controler (MCP) (rev a1)

By now it didn't bother me, but today hal-0.5 was included in the stable tree which requires a kernel > 2.6.13.

----------

## ppurka

Try installing the nvsound module by running the .bin file directly (after downloading it from nvidia's website).  I don't use emerge while installing the nvsound module, and I didn't have any modprobe problems. 

Also, you could go through the README file contained in the bin package to see that your modules.conf is properly set up.

My System specs: gcc-3.4.4, glibc-2.3.5-r1, 2.6.14-gentoo-r5 i686), AMD Athlon(tm) XP 3200+, A7N8XE-DLX, nvsound-1.0310

----------

## achtzehn

That's what I did. The installer compiles the nvnet-module flawlessly, then it compiles the nvsound module, insmods it for testing purposes and the kernel oopses. Compiling the module manually works, when inserting it into the kernel the kernel oopses again.

----------

## ]Trix[

I have the same problem with nvsound.

Mine works on gentoo-sources-2.6.12-r10 but on newer kernel versions it doesn't.

I need to install newer kernel if I want to update gnome 2.12.2 because hal won't compile with kernels < 2.6.13.

So all I can do is wait... or what? Is there a solution? 

Switching to ALSA is out of the question, cause I really like nforce-audio...

----------

## achtzehn

I wrote something in the ReleaseNotes.html today that 1.0-306 introduced support for kernel 2.6.12 into the module. This means every new kernel since then is not supported.  :Sad: 

In some forum pages I found people having problems with nvsound+reiserfs. Very strange.

----------

## ]Trix[

Is there a way to contact nvidia driver developers to ask them directly about this problem... I have been searching for their email but no luck (i didnt try hard thou)

----------

## ]Trix[

Just asked nvidia support group... waitnig for an answer

----------

## achtzehn

Dito.  :Smile: 

----------

## PrakashP

It must be gentoo specific, as I have nor prob using it with 2.6.16-rc1 vanilla kernel.

----------

## ]Trix[

You mean gentoo-sources kernel specific or distro specific...

Then there must be a bypass for this error.

Too bad it doesnt log when kernel crashes.

----------

## PrakashP

gentoo-kernel specific....

----------

## ]Trix[

Hmmm... Tried vanilla-sources 2.6.15-r1... 

It doesn't work... What do you have enabled or disabled in your kernel so that it works for you?

Well lets try 2.6.16 rc1...

----------

## achtzehn

 *]Trix[ wrote:*   

> Hmmm... Tried vanilla-sources 2.6.15-r1... 

 

Did so too. Same problem. NULL pointer when loading the module.

----------

## ]Trix[

On 2.6.16 rc1 I get on modprobe:

FATAL: Error inserting nvsound (/lib/modules/2.6.16-rc1/misc/nvsound.ko): Unknown symbol in module, or unknown parameter (see dmesg)

dmesg:

nvsound: Unknown symbol remap_page_range

Anyone knows how to fix this?

----------

## achtzehn

 *]Trix[ wrote:*   

> On 2.6.16 rc1 I get on modprobe:
> 
> FATAL: Error inserting nvsound (/lib/modules/2.6.16-rc1/misc/nvsound.ko): Unknown symbol in module, or unknown parameter (see dmesg)
> 
> dmesg:
> ...

 

Don't know how to fix that, but at least I can tell you that it is not only with your system. I'm getting the same error message as well as some error messages about the fglrx (ati-drivers) modules (unknown symbols of type inter_module_*)

----------

## ]Trix[

http://www.nvnews.net/vbulletin/showthread.php?t=43177

Here I have found a fix but for 292 drivers... I guess this fix doesn't work for 310.

----------

## PrakashP

You probably used gcc4.1. Search in gentoo bugs. I submitted a patch.

----------

## ]Trix[

No. I use gcc 3.4.4...

----------

## PrakashP

Perhaps you still want to try that patch, as I got the same error w/o it.

----------

## ]Trix[

can you post link....ok found your patch... how do i patch the file now... I have forgotten how to do it...

----------

## PrakashP

emerge nforce-audio

press ctrl+z wehen source was unpacked

cd /var/tmp/portage/nforce-bla/work/nforce-bla/usr [<- I think, otherwise search for the file mentioned in patch]

patch -p0 < patch [<- or -p1]

fg

----------

## achtzehn

 *]Trix[ wrote:*   

> can you post link....ok found your patch... how do i patch the file now... I have forgotten how to do it...

 

```
cd NFORCE-*/nvsound/main

patch < patch-file
```

did the trick. The nvsound module compiles and is even inserted in the kernel, but then it oopses again. :-/

I went to look over the patch that you mentioned before. The if condition is used to determine whether the kernel uses remap_page_range or remap_pfn_range. I figured the 2.6.16 uses remap_pfn_range, why the module could not be inserted into the kernel.

I changed the if condition so to use remap_pfn_range  and *RING* the module worked. Is that essentially what your patch does?

----------

## PrakashP

I don't know what the patch does.  :Wink:  I just converted zander's patch for nvidia gfx driver for the nvsound module.

----------

## achtzehn

Ok, I tried to reproduce what I did when playing around with the if condition stated above. 

I've been a bit messy and copied the if-condition into the else-part.

The module compiled as it did with the gcc-4.1 patch, so I suppose they do essentially the same but the gcc-patch is cleaner.

My module still oopses. I suppose, the time I got it running without an oops was just plain luck.

So no solution ahead by now. 

Besides: I'd like to switch back to 2.6.15 or gentoo-2.6.15-rc1 for the fglrx module doesn't work in 2.6.16 (inter_module_* dependencies not fulfilled)

----------

## ]Trix[

Same for me, it doesn't work... Maybe NVIDIA guys will have some ideas... We will just have to wait...

----------

## ]Trix[

Any more ideas how to make it work?

----------

## PrakashP

Hm, perhaps there is a race somewhere? I remember I once got an oops when I unloaded and reloaded the module, but loading the module on start-up works for me. I don't use coldplug and use a monolithic kernel, ie the only modules I load are nvidia and nvsound.

Are you guys using APIC? I use apic, regparm, preempt.

----------

## achtzehn

 *PrakashP wrote:*   

> Hm, perhaps there is a race somewhere? I remember I once got an oops when I unloaded and reloaded the module, but loading the module on start-up works for me.

 

Tried booting with nvsound in autload. Didn't work. Machine stopped with general exception failure.

 *PrakashP wrote:*   

> Are you guys using APIC? I use apic, regparm, preempt.

 

No. In standard Gentoo config it seems to be disabled in favor of SMP. I changed this now and activated APIC, IO-APIC, regparm, preempt (low-latency desktop).

Compiling...

----------

## ]Trix[

So... Did it work?

----------

## achtzehn

 *]Trix[ wrote:*   

> So... Did it work?

 

No. The kernel compiled very strange. Almost no modules were built, almost all the stuff was compiled _into_ the kernel. When booting, the framebuffer doesn't work as well as the ram0 device, which I need for starting the initrd, is not recognized.

----------

## ]Trix[

I am just compiling with regparm and other stuff will tell you after 5 minutes how did it go.

----------

## ]Trix[

Weeeeellllll. It didn't go. Gonna try something else.

----------

## ]Trix[

Nop.

BAD EIP Value? What is that?

----------

## m00re

I have the same or similar problem. Just upgraded to gentoo-sources-2.6.15-r1 and every time I modprobe nvsound, I get:

```

nvsound: module license 'NVIDIA' taints kernel.

Nvsound: Nvidia Audio Init Module, 09:34:04 Feb  1 2006 version 1.0-7

ACPI: PCI Interrupt Link [LAPU] enabled at IRQ 12

PCI: setting IRQ 12 as level-triggered

ACPI: PCI Interrupt 0000:00:05.0[A] -> Link [LAPU] -> GSI 12 (level, low) -> IRQ 12

PCI: Setting latency timer of device 0000:00:05.0 to 64

Nvsound:  NVIDIA nForce2 Controller Mem 0xe0000000 and IRQ c

ACPI: PCI Interrupt Link [LACI] enabled at IRQ 5

PCI: setting IRQ 5 as level-triggered

ACPI: PCI Interrupt 0000:00:06.0[A] -> Link [LACI] -> GSI 5 (level, low) -> IRQ 5

PCI: Setting latency timer of device 0000:00:06.0 to 64

Nvsound: NVIDIA nForce2 Audio aci 0xd400 and ac97 0xd000, IRQ 5

modprobe: page allocation failure. order:2, mode:0x20

 [<c012d7a9>] __alloc_pages+0x25f/0x271

 [<c012d7e7>] __get_free_pages+0x2c/0x3f

 [<c01073a0>] dma_alloc_coherent+0xb8/0xee

 [<e15aa606>] AosMemoryAllocPhysical+0xe4/0x1f5 [nvsound]

 [<e15a1568>] aosAllocateMem+0x18e/0x214 [nvsound]

 [<e15a3ff5>] _ZN11CScratchDma7AddPageEPjj+0x5d/0x92 [nvsound]

 [<e15a3d55>] _ZN11CScratchDma8AllocateEP8_memdescPj+0x39/0x84 [nvsound]

 [<e15a2303>] _ZN14CHalGlobalProc14AllocateMemoryEP8_memdescPj+0x33/0x3c [nvsound]

 [<e15a624c>] _ZN8CHalMCP120AllocateObjectMemoryEP8_memdescjPj+0x42/0x4e [nvsound]

 [<e15a1b79>] AllocObjectMemory+0x2d/0x32 [nvsound]

 [<e15a108b>] RmAllocAudioMemory+0x65/0x74 [nvsound]

 [<e15a1155>] NvAuAlloc+0x5b/0x1de [nvsound]

 [<e15a18c2>] NVARM_Alloc+0x1e/0x28 [nvsound]

 [<e159f08a>] _ZN22RealMCPXVoiceProcessor9NvRMAllocEjP17NVOS21_PARAMETERS+0x18/0x1c [nvsound]

 [<e1568d1e>] _ZN7AUDIOFX15AllocScratchMemEjPPv+0xb8/0xdc [nvsound]

 [<e156a405>] _Z20DefaultAfxParametersP18audiofx_parameters+0x8f/0x190 [nvsound] [<e156746d>] _ZN7AUDIOFX9AddModuleEPcPj+0x1e1/0x210 [nvsound]

 [<e15674c2>] _ZN7AUDIOFX9AddModuleEiPj+0x26/0x2a [nvsound]

 [<e1531ca5>] _ZN11CNvFxReverb4InitEP16INvAudioInternalP12INvFxManagerP35NVFXINST_FXMANAGER_FXADD_DESCRIPTORP21INv3dListenerInternal+0x18d/0x23e [nvsound]

 [<e1539b41>] _ZN15CLocalFxManager5FxAddEP35NVFXINST_FXMANAGER_FXADD_DESCRIPTORP9NV3264PTR+0x4a1/0x57e [nvsound]

 [<e1552d4c>] _ZN8CNvAudio13FxManagerInitEv+0x17ea/0x3f16 [nvsound]

 [<c0114d09>] tasklet_action+0x3a/0x59

 [<c0114ae0>] __do_softirq+0x34/0x7d

 [<e15a9f7f>] AosMemoryAlloc+0x1f/0x4e [nvsound]

 [<e154c998>] _ZN8CNvAudio16InitResourceMapsEv+0x12e/0x16e [nvsound]

 [<e154de46>] _ZN8CNvAudio10InitializeEP14NVAUDIO_CONFIG+0x24a/0x46c [nvsound]

 [<e158f7b1>] _ZN13CApuExecutive4InitEP9_nvhwbase+0x3b1/0x45c [nvsound]

 [<e158fa3e>] _Z19ApuInterruptHandlerPvjj+0x0/0x82 [nvsound]

 [<e15a0b6f>] _ZN13CApuExecutive6AddRefEv+0x17/0x1c [nvsound]

 [<e1507baf>] _ZN10NvaUnknown8FinishQIEP8IUnknownPPv+0x1f/0x28 [nvsound]

 [<e158cc86>] Nv_CreateApuExec+0x1b2/0x40e [nvsound]

 [<e15ae1fa>] Nvaudio_apuinit+0xf/0x1f [nvsound]

 [<e15ae881>] Nvaudio_probe+0x677/0x717 [nvsound]

 [<c0252b41>] pci_call_probe+0xf/0x12

 [<c0252b77>] __pci_device_probe+0x33/0x47

 [<c0252baa>] pci_device_probe+0x1f/0x34

 [<c02a63b6>] driver_probe_device+0x37/0x81

 [<c02a6460>] __driver_attach+0x0/0x36

 [<c02a6484>] __driver_attach+0x24/0x36

 [<c02a5c1a>] bus_for_each_dev+0x47/0x6d

 [<c02485a3>] kobject_add+0x83/0xa2

 [<c02a64aa>] driver_attach+0x14/0x18

 [<c02a6460>] __driver_attach+0x0/0x36

 [<c02a5ff2>] bus_add_driver+0x54/0x96

 [<c02a67ed>] driver_register+0x34/0x39

 [<c0252d8a>] __pci_register_driver+0x77/0x88

 [<c0111027>] printk+0xe/0x11

 [<e0ef402b>] Nvaudio_init_module+0x2b/0x2f [nvsound]

 [<c0126ec5>] sys_init_module+0xb9/0x1b1

 [<c01025ff>] sysenter_past_esp+0x54/0x75

...

```

Will check if this is really a gentoo-sources specific problem or if this also happens with vanilla-sources.

cheers m00re

----------

## ]Trix[

In my case it doesn't metter. Either is it vanilla or gentoo sources...

----------

