linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Q] udev and soc-camera
@ 2010-01-27 23:25 Valentin Longchamp
  2010-01-28  9:18 ` Kay Sievers
  0 siblings, 1 reply; 4+ messages in thread
From: Valentin Longchamp @ 2010-01-27 23:25 UTC (permalink / raw)
  To: linux-media, linux-hotplug

Hello,

I have a system that is built with OpenEmbedded where I use a mt9t031 
camera with the soc-camera framework. The mt9t031 works ok with the 
current kernel and system.

However, udev does not create the /dev/video0 device node. I have to 
create it manually with mknod and then it works well. If I unbind the 
device on the soc-camera bus (and then eventually rebind it), udev then 
creates the node correctly. This looks like a "timing" issue at "coldstart".

OpenEmbedded currently builds udev 141 and I am using kernel 2.6.33-rc5 
(but this was already like that with earlier kernels).

Is this problem something known or has at least someone already 
experienced that problem ?

Thanks and best regards

Val

-- 
Valentin Longchamp, PhD Student, EPFL-STI-LSRO1
valentin.longchamp@epfl.ch, Phone: +41216937827
http://people.epfl.ch/valentin.longchamp
MEB3494, Station 9, CH-1015 Lausanne

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Q] udev and soc-camera
  2010-01-27 23:25 [Q] udev and soc-camera Valentin Longchamp
@ 2010-01-28  9:18 ` Kay Sievers
  2010-01-28 14:02   ` Valentin Longchamp
  0 siblings, 1 reply; 4+ messages in thread
From: Kay Sievers @ 2010-01-28  9:18 UTC (permalink / raw)
  To: Valentin Longchamp; +Cc: linux-media, linux-hotplug

On Thu, Jan 28, 2010 at 00:25, Valentin Longchamp
<valentin.longchamp@epfl.ch> wrote:
> I have a system that is built with OpenEmbedded where I use a mt9t031 camera
> with the soc-camera framework. The mt9t031 works ok with the current kernel
> and system.
>
> However, udev does not create the /dev/video0 device node. I have to create
> it manually with mknod and then it works well. If I unbind the device on the
> soc-camera bus (and then eventually rebind it), udev then creates the node
> correctly. This looks like a "timing" issue at "coldstart".
>
> OpenEmbedded currently builds udev 141 and I am using kernel 2.6.33-rc5 (but
> this was already like that with earlier kernels).
>
> Is this problem something known or has at least someone already experienced
> that problem ?

You need to run "udevadm trigger" as the bootstrap/coldplug step,
after you stared udev. All the devices which are already there at that
time, will not get created by udev, only new ones which udev will see
events for. The trigger will tell the kernel to send all events again.

Or just use the kernel's devtmpfs, and all this should work, even
without udev, if you do not have any other needs than plain device
nodes.

Kay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Q] udev and soc-camera
  2010-01-28  9:18 ` Kay Sievers
@ 2010-01-28 14:02   ` Valentin Longchamp
  2010-01-28 14:13     ` Kay Sievers
  0 siblings, 1 reply; 4+ messages in thread
From: Valentin Longchamp @ 2010-01-28 14:02 UTC (permalink / raw)
  To: Kay Sievers; +Cc: linux-media@vger.kernel.org, linux-hotplug@vger.kernel.org

Kay Sievers wrote:
> On Thu, Jan 28, 2010 at 00:25, Valentin Longchamp
> <valentin.longchamp@epfl.ch> wrote:
>> I have a system that is built with OpenEmbedded where I use a mt9t031 camera
>> with the soc-camera framework. The mt9t031 works ok with the current kernel
>> and system.
>>
>> However, udev does not create the /dev/video0 device node. I have to create
>> it manually with mknod and then it works well. If I unbind the device on the
>> soc-camera bus (and then eventually rebind it), udev then creates the node
>> correctly. This looks like a "timing" issue at "coldstart".
>>
>> OpenEmbedded currently builds udev 141 and I am using kernel 2.6.33-rc5 (but
>> this was already like that with earlier kernels).
>>
>> Is this problem something known or has at least someone already experienced
>> that problem ?
> 
> You need to run "udevadm trigger" as the bootstrap/coldplug step,
> after you stared udev. All the devices which are already there at that
> time, will not get created by udev, only new ones which udev will see
> events for. The trigger will tell the kernel to send all events again.
> 
> Or just use the kernel's devtmpfs, and all this should work, even
> without udev, if you do not have any other needs than plain device
> nodes.
> 

Thanks a lot Kay, you pointed me exactly where I needed to watch. 
OpenEmbedded adds udevadm trigger a big list of --susbsystem-nomatch 
options as soon as you are not doing your first boot anymore and 
video4linux is among them.

I either have to remove this option in the script or understand why my 
other /dev nodes are kept (ttys are doing fine with the same treatment 
for instance) and not video4linux ones (it looks like they are using 
DEVCACHE or something like this). But I would prefer the first 
alternative since cameras may be unplugged on some robots.

Val

-- 
Valentin Longchamp, PhD Student, EPFL-STI-LSRO1
valentin.longchamp@epfl.ch, Phone: +41216937827
http://people.epfl.ch/valentin.longchamp
MEB3494, Station 9, CH-1015 Lausanne

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Q] udev and soc-camera
  2010-01-28 14:02   ` Valentin Longchamp
@ 2010-01-28 14:13     ` Kay Sievers
  0 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2010-01-28 14:13 UTC (permalink / raw)
  To: Valentin Longchamp
  Cc: linux-media@vger.kernel.org, linux-hotplug@vger.kernel.org

On Thu, Jan 28, 2010 at 15:02, Valentin Longchamp
<valentin.longchamp@epfl.ch> wrote:
> Kay Sievers wrote:
> Thanks a lot Kay, you pointed me exactly where I needed to watch.
> OpenEmbedded adds udevadm trigger a big list of --susbsystem-nomatch options
> as soon as you are not doing your first boot anymore and video4linux is
> among them.
>
> I either have to remove this option in the script or understand why my other
> /dev nodes are kept (ttys are doing fine with the same treatment for
> instance) and not video4linux ones (it looks like they are using DEVCACHE or
> something like this). But I would prefer the first alternative since cameras
> may be unplugged on some robots.

Really, that logic sounds awfully wrong. Any /dev-caching and games
with skipping selected subsystems at coldplug can never reliably work
as you have found out. :) You should definitely go for devtmpfs
instead of such needless and misguided hacks, if a plain "udevadm
trigger" does not work for some reason.

Good luck.
Kay

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-28 14:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-27 23:25 [Q] udev and soc-camera Valentin Longchamp
2010-01-28  9:18 ` Kay Sievers
2010-01-28 14:02   ` Valentin Longchamp
2010-01-28 14:13     ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).