UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
8,931 Views
Registered: ‎06-09-2014

Can't load ALSA soundcard driver

Jump to solution


With PetaLinux 2014.4, I'm trying to write an ALSA soundcard driver module for a picozed based platform but I haven't been able to get it to load.

 

I created a module within my project in components/modules with:

 

    petalinux-create -t modules -n riu_card --enable

 

As I added the following to the install target of the generated Makefile:

 

    $(TARGETINST) -d -a "riu_card" /etc/modules;

 

I replaced the generated riu_card.c with the soundcard driver I'm writing, which is still fairly basic, being still under development. The project builds successfully and puts the built module riu_card.ko into /lib/modules/3.17.0-xilinx/extra and the module name is placed into /etc/modules for loading.

 

When loaded on SD card and booted on the target, the module hasn't loaded, while the Dummy and Loopback ALSA soundcard drivers have.

 

I tried to manually load it with:

 

    modprobe riu_card

 

but it fails with the following error output:

 

    riu_card: Unknown symbol snd_soc_register_card (err 0)
    riu_card: Unknown symbol platform_driver_unregister (err 0)
    riu_card: Unknown symbol snd_soc_dai_set_fmt (err 0)
    riu_card: Unknown symbol snd_soc_dai_set_sysclk (err 0)
    riu_card: Unknown symbol soc_dai_hw_params (err 0)
    riu_card: Unknown symbol snd_soc_unregister_card (err 0)
    riu_card: Unknown symbol __platform_driver_register (err 0)
    riu_card: Unknown symbol snd_soc_pm_ops (err 0)
    modprobe: can't load module riu_card (extra/riu_card.ko): unknown symbol in module, or unknown parameter

 

So I've hit a roadblock here and don't know what to do next. Does anyone have any ideas?

 

0 Kudos
1 Solution

Accepted Solutions
Contributor
Contributor
17,362 Views
Registered: ‎06-09-2014

Re: Can't load ALSA soundcard driver

Jump to solution

The problem I've found (for all but one of the symbols listed in the errors) was because I didn't include:

 

    MODULE_LICENSE("GPL");

 

in my module.

 

The annoying thing about this is that this is specifically tested for (in kernel/module.c) to fail when resolving symbols on loading modules, but no indication is given that this is the reason for failure.  Result: much wasted debugging time!!!

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
8,916 Views
Registered: ‎09-10-2008

Re: Can't load ALSA soundcard driver

Jump to solution
Hi,

Modules don't load automatically in Petalinux without you doing something to cause it.

You are going the right path. Your driver module is trying to access kernel symbols that are not exported. A driver in the kernel has access to everything in the kernel while a driver module does not, the symbol has to be exported from the kernel. Yes it will build, but it won't load.

Thanks
John
0 Kudos
Contributor
Contributor
17,363 Views
Registered: ‎06-09-2014

Re: Can't load ALSA soundcard driver

Jump to solution

The problem I've found (for all but one of the symbols listed in the errors) was because I didn't include:

 

    MODULE_LICENSE("GPL");

 

in my module.

 

The annoying thing about this is that this is specifically tested for (in kernel/module.c) to fail when resolving symbols on loading modules, but no indication is given that this is the reason for failure.  Result: much wasted debugging time!!!

0 Kudos
Contributor
Contributor
8,908 Views
Registered: ‎06-09-2014

Re: Can't load ALSA soundcard driver

Jump to solution

Thanks John.

 

The reason for the added line in the Makefile is to put the module name into /etc/modules so that it *will* be automatically loaded.

 

It turns out that the symbol "soc_dai_hw_params" isn't exported by the kernel, but all the other symbols are.  Resolving the symbols was refused because of the lack of "MODULE_LICENSE("GPL");" in my module.  I just wish the error message told me that was why.

0 Kudos