Unknown symbol video_device_alloc

Asked by Joe Kreidler on 2013-03-15

I am working on a V4L2 USB camera driver and I am unable to install the driver due to unknown symbols.

I am building my driver piecmeal. I first created the driver skeleton and was able to install the driver. I then added the USB
probe() and disconnect() capability and I can detect when the camera is inserted and removed from a USB port. I then added my V4L2 calls and this is where I encountered a problem.

My kernel is :
$ uname -r

The OS version is:
$ cat os-release
VERSION="12.04.1 LTS, Precise Pangolin"
PRETTY_NAME="Ubuntu precise (12.04.1 LTS)"

When I install my driver, here is the error:
$ sudo insmod mydriver.ko
insmod: error inserting 'mydriver.ko': -1 Unknown symbol in module

The kernel log provided more information:
[146129.548776] mydriver: Unknown symbol video_unregister_device (err 0)
[146129.548809] mydriver: Unknown symbol video_device_alloc (err 0)
[146129.548844] mydriver: Unknown symbol __video_register_device (err 0)
[146129.548866] mydriver: Unknown symbol video_device_release (err 0)

What I can not figure out is why the video functions are not resolved.
Shouldn't these functions be part of the pre-built kernel?
Is there a work around by manually installing a driver that contains these symbols?

Any suggestions would be greatly appreciated.


Question information

English Edit question
Ubuntu linux Edit question
No assignee Edit question
Solved by:
Joe Kreidler
Last query:
Last reply:
Joe Kreidler (talljoek) said : #1

I was finally able to resolve this question on my own and I am posting the resolution for others who may run into this issue in the future.

From http://www.linuxtv.org/downloads/legacy/video4linux/v4l2dwgNew.html, I learned that V4L2 is a two-layered driver system and the top layer is the videodev module. After some more searching, I figured out that the Linux kernel configuration parameter for this module is CONFIG_VIDEO_DEV.

>> cd /boot
>> grep CONFIG_VIDEO_DEV config-3.2.0-31-generic

On my system, videodev is not built into the kernel but it is build as a module so I have to load the module.
I verified that the module is available in my distribution

>> cd lib/modules/3.2.0-31-generic/kernel/drivers/media/video/
>> ls videodev.ko

I was then able to install the module.

>> sudo modprobe videodev

Next, I installed my driver again and this time, there were no symbol errors.

>> sudo insmod mydriver.ko