Fwd: Re: [comedi] comedi / beagle / usbdux / ubuntu

179 views
Skip to first unread message

super...@gmail.com

unread,
Jun 15, 2010, 7:06:12 PM6/15/10
to comed...@googlegroups.com

After a bit of pratting around I now have ubuntu lucid running on my beagle
board. Please be patient with the following dumb questions because ubuntu is
not my usual flavour of linux and it is many years since I used debian.

I believe I have comedi lib installed using:
aptitude install comedi-lib/lucid-proposed

Similarly I have the following installed:

i comedi-source - Comedi kernel module source
i libcomedi-dev - Development library for Comedi
i libcomedi0 - Library for Comedi
i libcomerr2 - common error description library

I am assuming that somewhere there is an automated system to build comedi but
I may be wrong! what is my next step?

I saw in this thread
http://groups.google.com/group/comedi_list/browse_thread/thread/6414f072db839853/a33e7b1fe8e01bbf?lnk=gst&q=ubuntu+comedi-source#a33e7b1fe8e01bbf
the drivers should in installed but I have no staging directory on my system
and no idea how to fix / change / solve this.

Cheers,

SA

Bernd Porr

unread,
Jun 16, 2010, 3:29:39 AM6/16/10
to comed...@googlegroups.com
Hi!

there's no need to compile the drivers. That the compiled ones are in
the staging subdir doesn't matter. It works. Just start playing.

/Bernd

--
www: http://www.berndporr.me.uk/
http://www.linux-usb-daq.co.uk/
http://www.imdb.com/name/nm3293421/
Mobile: +44 (0)7840 340069
Work: +44 (0)141 330 5237
University of Glasgow
Department of Electronics & Electrical Engineering
72 Oakfield Avenue (Rankine Building for deliveries)
Glasgow, G12 8LT

Bernd Porr

unread,
Jun 16, 2010, 3:34:55 AM6/16/10
to comed...@googlegroups.com
Have you updated your source lists with "apt-get update"? Also check
that "/etc/apt/sources.list" contains the proposed repositories.

/Bernd

super...@gmail.com

unread,
Jun 16, 2010, 4:17:11 AM6/16/10
to comed...@googlegroups.com

Wednesday 16 June 2010 08:34:55 Bernd Porr wrote:
> Have you updated your source lists with "apt-get update"? Also check
> that "/etc/apt/sources.list" contains the proposed repositories.
>
> /Bernd
>
> Bernd Porr wrote:
> > Hi!
> >
> > there's no need to compile the drivers. That the compiled ones are in
> > the staging subdir doesn't matter. It works. Just start playing.
> >

Bernd,

Sorry if this seems a bit lame because I'm not entirely sure what I am doing
yet but:

/etc/apt/sources.list contains:
deb http://ports.ubuntu.com/ubuntu-ports lucid main universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports lucid-proposed mainuniverse
deb http://ports.ubuntu.com/ubuntu-ports lucid-updates main universe
multiverse

and I've run apt-get update.

aptitude knows the following comedi packages:
python2.5-comedilib python-comedilib python2.6-comedilib comedi-source
libcomedi-dev libcomedi0

and libcomedi-dev libcomedi0 comedi-source are installed.

I believe this device is the usbdux:
Bus 001 Device 004: ID 13d8:0001

My problem is:

modprobe usbdux
FATAL: Module usbdux not found.

Cheers,

SA

Bernd Porr

unread,
Jun 16, 2010, 4:46:30 AM6/16/10
to comed...@googlegroups.com
Hi!

sometimes grub is not properly updated and you are still running an
older kernel. The kernel version which contains comedi is:

2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 07:54:58 UTC 2010 i686

/Bernd

--

super...@gmail.com

unread,
Jun 16, 2010, 5:13:19 AM6/16/10
to comed...@googlegroups.com
On Wednesday 16 June 2010 09:46:30 Bernd Porr wrote:
> Hi!
>
> sometimes grub is not properly updated and you are still running an
> older kernel. The kernel version which contains comedi is:
>
> 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 07:54:58 UTC 2010 i686
>

uname -a
Linux beagleboard 2.6.32.11-l13 #1 PREEMPT Tue Apr 13 04:25:20 UTC 2010 armv7l
GNU/Linux

I am pretty sure I'm not using grub but uboot.

It is quite possible that the arm port is lagging slightly but I have no idea
how to tell. Please don't rule out user error here - I might merely need to
do an "apt update kernel" or something...

Thanks,

SA

super...@gmail.com

unread,
Jun 16, 2010, 5:18:29 AM6/16/10
to comed...@googlegroups.com
On Wednesday 16 June 2010 09:46:30 Bernd Porr wrote:
> Hi!
>
> sometimes grub is not properly updated and you are still running an
> older kernel. The kernel version which contains comedi is:
>
> 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 07:54:58 UTC 2010 i686
>
> /Bernd

According to aptitude my sources are:
2.6.32-23.37

but I am running 2.6.32.11 and definitely only have 2.6.32.11 in /boot so I am
going to see about finding out (a) how to get boot images for 2.6.32-23.37
and (b) how to push these to /boot

Bernd Porr

unread,
Jun 16, 2010, 5:34:24 AM6/16/10
to comed...@googlegroups.com
Yepp. Looks like that.

/Bernd

--

super...@gmail.com

unread,
Jun 16, 2010, 5:34:52 AM6/16/10
to comed...@googlegroups.com
On Wednesday 16 June 2010 09:46:30 Bernd Porr wrote:
> Hi!
>
> sometimes grub is not properly updated and you are still running an
> older kernel. The kernel version which contains comedi is:
>
> 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 07:54:58 UTC 2010 i686
>
> /Bernd

Ok trying to install linux-omap.2.6.32.501 which should be the latest kernel
and all the flash / boot utilities sorted...

It is working... fingers crossed I'm not bricking my beagleboard... rebooting

Hmmm 2.6.32.11-l13 again...

I'm wondering if it is time to build comedi from scratch?

Ian Abbott

unread,
Jun 16, 2010, 5:36:47 AM6/16/10
to comed...@googlegroups.com

None of the Lucid kernels for the beagleboard (and other OMAP boards)
appear to have any comedi stuff configured in, so you'll probably end up
building your own kernel. It might be worth asking the maintainers of
those kernels if at least the USB comedi drivers could be added to the
default config, but perhaps they'd be unwilling to do that until someone
had tested it (in which case, I guess you end up being the lucky guinea
pig!).

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-

super...@gmail.com

unread,
Jun 16, 2010, 5:45:51 AM6/16/10
to comed...@googlegroups.com

> None of the Lucid kernels for the beagleboard (and other OMAP boards)
> appear to have any comedi stuff configured in, so you'll probably end up
> building your own kernel. It might be worth asking the maintainers of
> those kernels if at least the USB comedi drivers could be added to the
> default config, but perhaps they'd be unwilling to do that until someone
> had tested it (in which case, I guess you end up being the lucky guinea
> pig!).
>
> --
> -=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
> -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-


Ian / Bernd,

Yep coming to the same conclusion myself - happy to ask but since I'm on a
tight timescale having wasted a lot of time trying to get OE to work with
comedi can I not just build the comedi-source package?

Cheers,


Matt

Ian Abbott

unread,
Jun 16, 2010, 5:56:02 AM6/16/10
to comed...@googlegroups.com

You could try building the comedi-source package using module-assistant.
If it works, it should create a deb containing comedi kernel modules
for your kernel.

At some point, when you finally get a usbdux.ko module built and
installed, you're going to need the linux-firmware package as well, as
the USB-DUX won't work without it!

Ian Abbott

unread,
Jun 16, 2010, 5:58:29 AM6/16/10
to comed...@googlegroups.com

I replied on another branch of the thread, but yes, you can give it a
try using module-assistant.

Also, "tight schedules" and "embedded" never seem to mix very well!

super...@gmail.com

unread,
Jun 16, 2010, 6:00:52 AM6/16/10
to comed...@googlegroups.com
On Wednesday 16 June 2010 10:56:02 Ian Abbott wrote:
> You could try building the comedi-source package using module-assistant.
>  If it works, it should create a deb containing comedi kernel modules
> for your kernel.
>
> At some point, when you finally get a usbdux.ko module built and
> installed, you're going to need the linux-firmware package as well, as
> the USB-DUX won't work without it!

Without appearing to be too thick: how do I build with module-assistant?

Also do I just need the usbdux module or should I build something else (I was
just going to build the lot as normal)?

As for the firmware - is this not in the comedi-source package (if not where
should I look)?

Thanks and thanks for you patience!

SA


super...@gmail.com

unread,
Jun 16, 2010, 6:02:01 AM6/16/10
to comed...@googlegroups.com
On Wednesday 16 June 2010 10:58:29 Ian Abbott wrote:
> Also, "tight schedules" and "embedded" never seem to mix very well!

Very true!

super...@gmail.com

unread,
Jun 16, 2010, 6:09:25 AM6/16/10
to comed...@googlegroups.com
On Wednesday 16 June 2010 10:58:29 Ian Abbott wrote:
> I replied on another branch of the thread, but yes, you can give it a
> try using module-assistant.

Ok module-assistant seems a good thing, currently stuck on this:

"Bad luck, the kernel headers for the target kernel version could not be found
and you did not specify other valid kernel headers to use."

Not sure where to go now, aptitude lists kernel headers for a list of kernels
that I don't have... out of time now, tomorrow!

Cheers,

SA

super...@gmail.com

unread,
Jun 16, 2010, 6:56:47 AM6/16/10
to comed...@googlegroups.com
Just for the record after installing the linux-imagexxxxx package I had to do
this:

mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n
2.6.33-501-omap -d /boot/vmlinuz-2.6.33-501-omap /boot/uboot/uImage

to push the change to uboot.

Ian Abbott

unread,
Jun 16, 2010, 7:09:36 AM6/16/10
to comed...@googlegroups.com
On 16/06/10 11:00, super...@gmail.com wrote:
> On Wednesday 16 June 2010 10:56:02 Ian Abbott wrote:
>> You could try building the comedi-source package using module-assistant.
>> If it works, it should create a deb containing comedi kernel modules
>> for your kernel.
>>
>> At some point, when you finally get a usbdux.ko module built and
>> installed, you're going to need the linux-firmware package as well, as
>> the USB-DUX won't work without it!
>
> Without appearing to be too thick: how do I build with module-assistant?

I'm not sure about the beagleboard, but on a PC you'd do something like:

sudo module-assistant auto-install comedi-source

Using "auto-build" instead of "auto-install" will skip the actual
installation of the deb file at the end.

Trouble is, I'm pretty sure the latest comedi-source package
(comedi-source_0.7.76+20090411cvs-3_all.deb) is incompatible with the
2.6.32 kernel, so you'd probably have to build the latest comedi CVS
sources anyway if you go down this route.

> Also do I just need the usbdux module or should I build something else (I was
> just going to build the lot as normal)?

It will build a lot of useless modules, but it should at least skip
building the PCI and PCMCIA drivers since your kernel won't be
configured to support those.

> As for the firmware - is this not in the comedi-source package (if not where
> should I look)?

There should be a package in lucid main repository called "linux-firmware".

super...@gmail.com

unread,
Jun 16, 2010, 7:15:51 AM6/16/10
to comed...@googlegroups.com
On Wednesday 16 June 2010 12:09:36 Ian Abbott wrote:
> Trouble is, I'm pretty sure the latest comedi-source package
> (comedi-source_0.7.76+20090411cvs-3_all.deb) is incompatible with the
> 2.6.32 kernel, so you'd probably have to build the latest comedi CVS
> sources anyway if you go down this route.
>
> > Also do I just need the usbdux module or should I build something else (I
> > was just going to build the lot as normal)?
>
> It will build a lot of useless modules, but it should at least skip
> building the PCI and PCMCIA drivers since your kernel won't be
> configured to support those.
>
> > As for the firmware - is this not in the comedi-source package (if not
> > where should I look)?
>
> There should be a package in lucid main repository called "linux-firmware".

Thanks- Assuming I find the kernel source to match my kernel binary (currently
they don't match in the repos) I can grab the current comedi tar ball and
build from scratch the good old way (this at least I understand). Next
problem would be where in ubuntu / debian will I find the kernel config files
needed for this build?

Cheers,

SA

Ian Abbott

unread,
Jun 16, 2010, 7:16:12 AM6/16/10
to comed...@googlegroups.com

The linux-headers packages are closely coupled to the matching
linux-image packages, and you can't build kernel modules without them.

You'll probably end up building your own kernel, in which base you might
as well configure in the "staging" comedi stuff.

Bernd Porr

unread,
Jun 16, 2010, 7:23:27 AM6/16/10
to comed...@googlegroups.com
Hi!

You can get the firmware from the drivers page on
http://www.linux-usb-daq.co.uk/ or you just install the ubuntu firmware
package. Should be in /lib/firmware.

/Bernd

--

Mobile: +44 (0)7840 340069
Work: +44 (0)141 330 5237
University of Glasgow
Department of Electronics & Electrical Engineering

72 Oakfield Avenue (for deliveries: Rankine Building)
Glasgow, G12 8LT

Bernd Porr

unread,
Jun 16, 2010, 7:23:47 AM6/16/10
to comed...@googlegroups.com
;)

--

Ian Abbott

unread,
Jun 16, 2010, 7:36:19 AM6/16/10
to comed...@googlegroups.com

A linux-headers package that matches the linux-image package would do,
but those matching linux-headers packages don't seem to exist either!
At least the linux-image package should contain a config file in /boot.
There should also be a script in the kernel sources
(scripts/extract-ikconfig) to extract a config from a kernel image (as
long as the kernel was configured with CONFIG_IKCONFIG support).

super...@gmail.com

unread,
Jun 16, 2010, 7:42:59 AM6/16/10
to comed...@googlegroups.com

> A linux-headers package that matches the linux-image package would do,
> but those matching linux-headers packages don't seem to exist either!
> At least the linux-image package should contain a config file in /boot.
> There should also be a script in the kernel sources
> (scripts/extract-ikconfig) to extract a config from a kernel image (as
> long as the kernel was configured with CONFIG_IKCONFIG support).

I have a headers package that matches but module-assistant insists on the
kernel source package that isn't there.
i A linux-headers-2.6.33-501 - Header files related to linux-ti-omap
i linux-headers-2.6.33-501-omap - Linux kernel headers for version 2.6.33

I have found the kernel source as a tar ball + patch file so if I can convince
module-assistant that it exists I might be able to get away with it.

The config file is in /boot - thanks.


Bernd Porr

unread,
Jun 16, 2010, 7:47:32 AM6/16/10
to comed...@googlegroups.com
Hi Guys,

Well. I think the simplest way is to compile 2.6.33 from www.kernel.org.
Download it. Copy the latest config file from /boot to your kernel dir
and call it .config. Or you could just do a make menuconfig and choose
the option "import kernel config". Then go to drivers/staging/comedi and
enable all modules you want to have (they should be enabled already).
then "make", "make bzImage modules modules_install". Then you have a
clean kernel with all driver, headers etc. And while kernel compiles you
can do some other work... ;)

/Bernd

--

Bernd Porr

unread,
Jun 16, 2010, 7:58:58 AM6/16/10
to comed...@googlegroups.com
just to add: from 2.6.33 comedi should be basically stable, especially
the USBDUXdrivers. The ubuntu team was nice enough to backport my fixes
to 2.6.32 so that lucid also benefits from them. But in your special
case I would recommend to compile the whole kernel. Then you can also
tweak other things for your beagle board.

/Bernd

Rafael Campos

unread,
Jun 16, 2010, 8:00:00 AM6/16/10
to comed...@googlegroups.com
Hi all,


--
Rafael Campos Las Heras

Rafael Campos

unread,
Jun 16, 2010, 8:04:44 AM6/16/10
to comed...@googlegroups.com
Hi all,
Em Qua, 2010-06-16 às 12:42 +0100, super...@gmail.com escreveu:

The easiest "Ubuntu" way is to do:

# apt-get source linux-image-2.6.33-501-omap (or the propper linux-image
installed in your system)
# cd linux-image-2.6.33-501-omap
# cp /boot/config-2.6.33-501-omap .config
# make oldconfig
# make menuconfig (select comedi drivers)
# make-kpkg clean; make-kpkg --rootcmd fakeroot --append-to-version
-omap-comedi --revision 1 linux_headers linux_image

And install the generated deb linux-image-2.6.33-omap-comedi_1_omap.deb
(or something like that).

It works wit cross compilation too (but i only tested in x86 and x86_64
systems)

Good luck

Bernd Porr

unread,
Jun 16, 2010, 8:56:03 AM6/16/10
to comed...@googlegroups.com
Thanks. That's looking indeed "easy". ;)

/Bernd

Rafael Campos wrote:
> Hi all,

--

http://www.imdb.com/name/nm3293421/


Mobile: +44 (0)7840 340069
Work: +44 (0)141 330 5237
University of Glasgow
Department of Electronics & Electrical Engineering

super...@gmail.com

unread,
Jun 16, 2010, 8:13:29 PM6/16/10
to comed...@googlegroups.com
On Wednesday 16 June 2010 13:04:44 Rafael Campos wrote:
> The easiest "Ubuntu" way is to do:
>
> # apt-get source linux-image-2.6.33-501-omap (or the propper linux-image
> installed in your system)
> # cd linux-image-2.6.33-501-omap
> # cp /boot/config-2.6.33-501-omap .config
> # make oldconfig
> # make menuconfig (select comedi drivers)
> # make-kpkg clean; make-kpkg --rootcmd fakeroot --append-to-version
> -omap-comedi --revision 1 linux_headers linux_image
>
> And install the generated deb linux-image-2.6.33-omap-comedi_1_omap.deb
> (or something like that).
>
> It works wit cross compilation too (but i only tested in x86 and x86_64
> systems)
>
> Good luck

Ok this looks like it may have solved the problems - the deb-src lines were
missing in /etc/apt/sources.list and the source files were called
linux-ti-omap rather than linux-image-2.6.33-501-omap. So now I have
downloaded the source files using:

apt-get source linux-image-2.6.33-501-omap (this seemed to know about the name
changes).

I thought I'd try module assistant again rather than build the kernel from
scratch but this failed because m-a says install the headers (but they are
already installed).

Ho hum...


Ian Abbott

unread,
Jun 17, 2010, 5:35:02 AM6/17/10
to comed...@googlegroups.com
On 17/06/10 01:13, super...@gmail.com wrote:
> I thought I'd try module assistant again rather than build the kernel from
> scratch but this failed because m-a says install the headers (but they are
> already installed).
>
> Ho hum...

The current CVS comedi sources should build okay for 2.6.33 as long as
PCMCIA support is disabled. Debian's comedi-sources package is too old
(even though it's only 14 months old).

super...@gmail.com

unread,
Jun 17, 2010, 8:12:48 AM6/17/10
to comed...@googlegroups.com
On Wednesday 16 June 2010 13:04:44 Rafael Campos wrote:
> -omap-comedi --revision 1 linux_headers linux_image

make[2]: Leaving directory `/usr/src/linux-headers-2.6.33-501-omap'
make[2]: Entering directory `/usr/src/linux-headers-2.6.33-501-omap'
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[3]: *** No rule to make target `arch/arm/tools/gen-mach-types', needed by
`include/generated/mach-types.h'. Stop.
make[2]: *** [archprepare] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-2.6.33-501-omap'
make[1]: *** [debian/stamp/conf/kernel-conf] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.33-501-omap'
make: *** [debian/stamp/conf/minimal_debian] Error 2
Failed to create a ./debian directory: No such file or directory
at /usr/bin/make-kpkg line 971.

Still nothing runs smoothly! any clues anyone?

super...@gmail.com

unread,
Jun 17, 2010, 7:25:05 PM6/17/10
to comed...@googlegroups.com
Ok - I am trying to compile the kernel as suggested by Rafael, so far so good
(apart from lots of small niggles).

After many hours of compilation I finally have a comedi specific problem:


CC [M] drivers/staging/comedi/range.o
CC [M] drivers/staging/comedi/drivers.o
drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’:
drivers/staging/comedi/drivers.c:510: error: ‘PAGE_KERNEL_NOCACHE’ undeclared
(first use in this function)
drivers/staging/comedi/drivers.c:510: error: (Each undeclared identifier is
reported only once
drivers/staging/comedi/drivers.c:510: error: for each function it appears in.)
make[4]: *** [drivers/staging/comedi/drivers.o] Error 1
make[3]: *** [drivers/staging/comedi] Error 2
make[2]: *** [drivers/staging] Error 2
make[1]: *** [drivers] Error 2
make[1]: Leaving directory `/root/linux-ti-omap-2.6.33'
make: *** [debian/stamp/build/kernel] Error 2

A quick bit of analysis reveals that the page protection
flag ‘PAGE_KERNEL_NOCACHE’ does not exist for the ARM port of the kernel. I
don't know what I am doing but I have subsituted PAGE_KERNEL instead, because
looking at the options it appeared to be the most sensible.


I think this has come up before, in the context of the PPC port which had a
different fix. I think it needs a more qualified look at than I can give.
There must be an example somewhere in the kernel on how to allocate a large
DMA buffer in the kernel in a manner that is cross platform.

My quick hack (above) just took me to the next compile error which isn't
comedi related (a gcc bug hopefully side stepped by ditching the sound
drivers).

Cheers,

SA


Thanks,

SA

super...@gmail.com

unread,
Jun 19, 2010, 5:02:26 AM6/19/10
to comed...@googlegroups.com
My attempts to build on the beagleboard failed- I am trying again using
another method but it will take many hours before I know if it has worked.

In the meantime I am trying to install comedi on my straight up ubuntu laptop
running lucid and k 2.6.32-22.

I have all the comedi stuff install from aptitude.

It doesn't <just work> because the comedi drivers are not in the staging dirs.

module-assistant failed to build the comedi drivers from comedi-source (I
recall that these were too old according to a previous post).

the kernel-source install doesn't appear to be straight forward either
(https://help.ubuntu.com/community/Kernel/Compile). Assuming I have the
correct sources installed in /somewhere/ prepare with make oldconfig; make
modules_prepare how do I tell the comedi cvs packaege where to look?

Any suggestions?

I've spent so long banging my head against a brick wall trying to get this
working I probably need a "start from the top" set of instructions for the
stock ubuntu lucid install.

Ta SA

Bernd Porr

unread,
Jun 19, 2010, 5:30:33 AM6/19/10
to comed...@googlegroups.com
Indeed it "just works". See here:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/563436
I've made quite an effort to get comedi working in lucid because it's
LTS and it's quite nice to have it for the next 5 years just plug and
play (and we've got a lab full of DUX boards which will make the lab
technician also happy).

If you don't see the drivers you haven't enabled "proposed updates". See
also the bug report.

(of course I won't stop you from trying other methods, always
interesting to hear your reports... ;) Weather is gorgeous here in
Glasgow. Enough comedi for today!

/Bernd

--

super...@gmail.com

unread,
Jun 19, 2010, 5:58:06 AM6/19/10
to comed...@googlegroups.com
Yes I came across this - enabled proposed - apt-get update and apt-get upgrade
and 1/2 way through my laptop starts hibernating for no good reason and then
the network manager manages to forget the dns settings so the upgrade borks,
then the network manager won't set the dns setting despite knowing them etc
etc etc etc

Something is not right and I am so annoyed now. Waiting for another reboot.
This sort of nonse never happened in suse (but then the sound didn't work!).

Comedi doesn't work on the beagleboard because of the .._NOCACHE problem in
the kernel drivers.

super...@gmail.com

unread,
Jun 19, 2010, 3:52:42 PM6/19/10
to comed...@googlegroups.com
After another epic build on the beagleboard I now have 2.6.34 with comedi
configured running (with the _NOCACHE hack). Unfortunately the usbdux
drivers did not build. They following drivers did build:

comedi_bond.ko
comedi_fc.ko
comedi_parport.ko
comedi_test.ko
pcm_common.ko

So I guess there is some essential dependency in the config file - does anyone
have any idea what this could be (or how I would find out)?

Cheers,

SA

super...@gmail.com

unread,
Jun 19, 2010, 7:00:54 PM6/19/10
to comed...@googlegroups.com
On Saturday 19 June 2010 10:30:33 Bernd Porr wrote:
> Indeed it "just works". See here:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/563436
> I've made quite an effort to get comedi working in lucid because it's
> LTS and it's quite nice to have it for the next 5 years just plug and
> play (and we've got a lab full of DUX boards which will make the lab
> technician also happy).
>
> If you don't see the drivers you haven't enabled "proposed updates". See
> also the bug report.
>
> (of course I won't stop you from trying other methods, always
> interesting to hear your reports... ;) Weather is gorgeous here in
> Glasgow. Enough comedi for today!
>

Ok on my laptop comedi is finally running and did work as adevertised with
ubuntu lucid proposed updates package. The update to "proposed updates"
however didn't go smoothly, taking out the video driver, network manager,
trackpad driver and doing something nasty to the power management. Seems the
wrong kernel headers got left and anything requiring building got trashed or
stuck halfway when the network tripped up.

comedi seems fine on the laptop now except once on removing the usbdux the
laptop locked and required a hard reboot to get it back (I have tried several
times now and it seems fine).

The beagleboard problem (_NOCACHE page protection in drivers.c) maybe solved.
I replaced vmap(pages, n_pages, VM_MAP, PAGE_KERNEL_NO_CACHE); with
PAGE_KERNEL and the comile went fine and the driver is installed and working.
I couldn't figure out how to install it properly but once I got it to compile
I placed the usbdux module in the right place and it <just worked>. My advice
to anyone trying this is to get a bigger disk than I had (2Gb) because I ran
out of space several times.

I am not sure it was a sensible change or if it is stable but it seemed from
looking at a few files the safest bet short of a big changed. I think this
would be a problem on several platforms.

As long as both these stay working I'm not going to touch anything other than
tidying up...

Thanks for your help!

SA


Anyway currently working on PC and beagleboard

Bernd Porr

unread,
Jun 20, 2010, 9:47:24 AM6/20/10
to comed...@googlegroups.com
Sorry to hear that the proposed update didn't go smoothly. I'm testing
luicd on two different computers and for me there haven't been any
problems. Good to hear that you finally managed to get it working. Could
you make a patch for PAGE_KERNEL_NO_CACHE for the comedi CVS and for the
most recent linux kernel so that at least the next kernel won't have
these problems. Please send the kernel patches to Greg KH.

/Bernd

--

super...@gmail.com

unread,
Jun 20, 2010, 10:33:59 AM6/20/10
to comed...@googlegroups.com
On Sunday 20 June 2010 14:47:24 Bernd Porr wrote:
> Sorry to hear that the proposed update didn't go smoothly. I'm testing
> luicd on two different computers and for me there haven't been any
> problems. Good to hear that you finally managed to get it working. Could
> you make a patch for PAGE_KERNEL_NO_CACHE for the comedi CVS and for the
> most recent linux kernel so that at least the next kernel won't have
> these problems. Please send the kernel patches to Greg KH.
>
I don't think laptop problems were a comedi problem - more a very unfortunate
mix of flakyness elsewhere I don't know why, but, the laptop hibernated
spontaneously during the change to proposed and when it came back the network
manager screwed up and then everything went haywire.

As for a patch - I'd be glad to _but_ I'm not really up to the job and I
don't know if my kludge is a sensible option. It will require a lot more code
analysis than I have done. The problem is that the page protection flags
required for vmap are platform dependent and PAGE_KERNEL_NOCACHE is only
defined for only around half of platforms making this drivers.c unportable.

I don't understand what I should be using - I just guessed PAGE_KERNEL because
it sounded like the most restricted of the options available - it works fine
at the moment but it hasn't been properly tested.

AFAIK this bit of code (line ~ 500 / drivers.c) is for allocating a large
(>page sized) buffer which is DMA capable - I don't even know if it is used
by usbdux. And vmap is used to assemble the pages into a continuous looking
block of memory and set the page protection (which is platform dependent).
The surrounding code is rather complicated and I don't understand it...

I think this is one for the code maintainer and the LKML...

Cheers,

SA

Ian Abbott

unread,
Jun 21, 2010, 5:40:21 AM6/21/10
to comed...@googlegroups.com
On 20/06/10 14:47, Bernd Porr wrote:
> Sorry to hear that the proposed update didn't go smoothly. I'm testing
> luicd on two different computers and for me there haven't been any
> problems. Good to hear that you finally managed to get it working. Could
> you make a patch for PAGE_KERNEL_NO_CACHE for the comedi CVS and for the
> most recent linux kernel so that at least the next kernel won't have
> these problems. Please send the kernel patches to Greg KH.
>
> /Bernd

It's already known about - there was a thread related to it just over a
year ago: http://thread.gmane.org/gmane.linux.kernel/847085

There hasn't been any progress on the matter since then though, and I'm
not sure what consensus was reached at the time, but there were strong
suggestions that comedi shouldn't be allocating buffers like this for
architecture portability reasons.

I don't think any simple '#ifdef __arm__' type patches will be accepted
by the kernel folks, as they already rejected similar patches for PPC64.
That doesn't stop us accepting such workaround patches into the comedi
CVS sources though!

AFAIK, the allocation of the comedi buffer using PAGE_KERNEL_NOCACHE is
only needed for the MITE-based drivers for National Instruments PCI
cards. Maybe it's possible to change these drivers to use streamed DMA
mappings instead of coherent DMA mappings, but that might make
synchronization between the DMA controller and the buffer even more of a
nightmare that it is already. Another possibility would be for these
drivers to allocate their own, private DMA buffers and memcpy data
between these buffers and the main comedi buffer, but the extra copy
would add extra overhead and reduce maximum throughput.

--

Rafael Campos

unread,
Jun 21, 2010, 8:39:51 AM6/21/10
to comed...@googlegroups.com
Hi SA,

Em Dom, 2010-06-20 às 15:33 +0100, super...@gmail.com escreveu:
> On Sunday 20 June 2010 14:47:24 Bernd Porr wrote:
> > Sorry to hear that the proposed update didn't go smoothly. I'm testing
> > luicd on two different computers and for me there haven't been any
> > problems. Good to hear that you finally managed to get it working. Could
> > you make a patch for PAGE_KERNEL_NO_CACHE for the comedi CVS and for the
> > most recent linux kernel so that at least the next kernel won't have
> > these problems. Please send the kernel patches to Greg KH.
> >
> I don't think laptop problems were a comedi problem - more a very unfortunate
> mix of flakyness elsewhere I don't know why, but, the laptop hibernated
> spontaneously during the change to proposed and when it came back the network
> manager screwed up and then everything went haywire.

For the Ubuntu proposed related problems, i recommend the option to be
"Selective upgrading from -proposed" in the help page [1]. To be sure
you don't update untested packages, or test them package by package.
Getting easy to revert the breaking package. ;)

>
> As for a patch - I'd be glad to _but_ I'm not really up to the job and I
> don't know if my kludge is a sensible option. It will require a lot more code
> analysis than I have done. The problem is that the page protection flags
> required for vmap are platform dependent and PAGE_KERNEL_NOCACHE is only
> defined for only around half of platforms making this drivers.c unportable.
>
> I don't understand what I should be using - I just guessed PAGE_KERNEL because
> it sounded like the most restricted of the options available - it works fine
> at the moment but it hasn't been properly tested.
>
> AFAIK this bit of code (line ~ 500 / drivers.c) is for allocating a large
> (>page sized) buffer which is DMA capable - I don't even know if it is used
> by usbdux. And vmap is used to assemble the pages into a continuous looking
> block of memory and set the page protection (which is platform dependent).
> The surrounding code is rather complicated and I don't understand it...
>
> I think this is one for the code maintainer and the LKML...
>
> Cheers,
>
> SA
>
>

[1] https://wiki.ubuntu.com/Testing/EnableProposed

Reply all
Reply to author
Forward
0 new messages