DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 11th January 2020
attilio attilio is offline
Port Guard
 
Join Date: Jun 2015
Posts: 40
Default where is uvideo0?

Hi.
I was exploring dmesg output to understand drivers' tree and to read something about them in their man pages, but I can't find uvideo0 in /dev
Should I?

Code:
lava$ dmesg|grep video
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
uvideo0 at uhub1 port 3 configuration 1 interface 0 "SunplusIT INC. HP Truevision HD" rev 2.00/1.04 addr 5
video0 at uvideo0
Code:
lava$ ls /dev | grep video
video
video0
video1
lava$
Reply With Quote
  #2   (View Single Post)  
Old 11th January 2020
victorvas's Avatar
victorvas victorvas is offline
Real Name: Victor
Fdisk Soldier
 
Join Date: May 2019
Posts: 62
Default

You can install dmassage
Code:
pkg_add dmassage
It will display convenient information about your devices
Code:
dmassage -t
Reply With Quote
  #3   (View Single Post)  
Old 11th January 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,965
Default

You should be able to use your video(4) device node.
Quote:
Originally Posted by attilio View Post
Code:
video0 at uvideo0
Reply With Quote
  #4   (View Single Post)  
Old 11th January 2020
attilio attilio is offline
Port Guard
 
Join Date: Jun 2015
Posts: 40
Default

Thanks victorvas and jggimi.
I'm not interested in using uvideo0 indeed, but just to understand why something is present in /dev and somethng not.
For example video0 is present, uvideo0 is absent.
I studied the output of dmesg and I made this tree
Code:
root
   mpath0
      scsibus0
   mainbus0
      bios0
         acpi0
            acpitimer0
            acpihpet0
            acpimadt0
            acpimcfg0
            acpiprt0
            acpiprt1
            acpiprt2
            acpiprt3
            acpiprt4
            acpiec0
            acpicpu0
            acpicpu1
            acpipwrres0
            acpitz0
            acpicmos0
            acpipci0
            acpibat0
            acpiac0
            acpibtn0
            acpibtn1
            acpivideo0
               acpivout0
      pci0
         pchb0
         inteldrm0
            drm0
            wsdisplay0
         ahci0
            scsibus1
               sd0
               cd0
         xhci0
            usb0
               uhub0
                  urtwn0
                  uhub1
                     ugen0
                     uvideo0
                        video0
         azalia0
            audio0
         ppb0
            pci1
         ppb1
            pci2
               re0
                  rlphy0
         ppb2
            pci3
         pcib0
            isa0
               isadma0
                  com0
               pckbc0
                  pckbd0
                     wskbd0
                  pms0
                     wsmouse0
               pcppi0
                  spkr0
         ichiic0
            iic0
               spdmem0
      cpu0
      cpu1
      ioapic0
   vscsi0
      scsibus2
   softraid0
      scsibus3
Where, with indentation, one should understand what is attached to what.
I began to read (very quickly) the man pages of the various objects of these tree, just to have an idea of the chains of attachments.
Why something is in /dev and something not?
Reply With Quote
  #5   (View Single Post)  
Old 11th January 2020
victorvas's Avatar
victorvas victorvas is offline
Real Name: Victor
Fdisk Soldier
 
Join Date: May 2019
Posts: 62
Default

Something like mainbus0 is a logical device created by kernel. It is a point where kernel attaches all other devices. Look into dmesg.boot to see that every device is attached to another device and so on. OpenBSD finds devices from the root outward - everything is listed in reverse order.
Reply With Quote
  #6   (View Single Post)  
Old 11th January 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,965
Default

A device special file is provisioned when a device driver communicates directly with a userland program using ioctl(2) system calls.

If you read the video(4) man page, you will see the ioctl() calls available to programmers. You'll also see this in the description section, which explains why there is no need for a /dev/uvideo* special file.
Quote:
The video driver provides support for various video devices. It provides a uniform programming interface layer above different underlying video hardware drivers....
Reply With Quote
  #7   (View Single Post)  
Old 11th January 2020
attilio attilio is offline
Port Guard
 
Join Date: Jun 2015
Posts: 40
Default

Thanks! My knowledge is (slowly) growing!
Reply With Quote
  #8   (View Single Post)  
Old 12th January 2020
attilio attilio is offline
Port Guard
 
Join Date: Jun 2015
Posts: 40
Default

After your answers, another old question waked up in me, about chains of communication.
I submitted it in daemonforums/miscellaneous/programming days ago,
they suggested me to use ktrace, but a simple
Code:
ktrace echo hello
ktrace -C
kdump
produced a not simple (to me) output.

So let's suppose I have an application (app) that allows to see on the screen
what my webcam sees.
I would like to understand the chain of communication, starting from
the physical webcam device (pwd) and ending to physical screen device (psd), with the action of app and kernel.

I post the tree obtained with dmassage
Code:
lava$ dmassage -t
root
 |-mainbus0
 |  |-bios0
 |  |  \-acpi0
 |  |     |-acpiac0
 |  |     |-acpibat0
 |  |     |-acpibtn0
 |  |     |-acpibtn1
 |  |     |-acpicmos0
 |  |     |-acpicpu0
 |  |     |-acpicpu1
 |  |     |-acpiec0
 |  |     |-acpihpet0
 |  |     |-acpimadt0
 |  |     |-acpimcfg0
 |  |     |-acpipci0
 |  |     |-acpiprt0
 |  |     |-acpiprt1
 |  |     |-acpiprt2
 |  |     |-acpiprt3
 |  |     |-acpiprt4
 |  |     |-acpipwrres0
 |  |     |-acpitimer0
 |  |     |-acpitz0
 |  |     \-acpivideo0
 |  |        \-acpivout0
 |  |-cpu0
 |  |-cpu1
 |  |-ioapic0
 |  \-pci0
 |     |-ahci0
 |     |  \-scsibus1
 |     |     |-cd0
 |     |     \-sd0
 |     |-azalia0
 |     |  \-audio0
 |     |-ichiic0
 |     |  \-iic0
 |     |     \-spdmem0
 |     |-inteldrm0
 |     |  |-drm0
 |     |  \-wsdisplay0
 |     |-pchb0
 |     |-pcib0
 |     |  \-isa0
 |     |     |-com0
 |     |     |-isadma0
 |     |     |-pckbc0
 |     |     |  |-pckbd0
 |     |     |  |  \-wskbd0
 |     |     |  \-pms0
 |     |     |     \-wsmouse0
 |     |     \-pcppi0
 |     |        \-spkr0
 |     |-ppb0
 |     |  \-pci1
 |     |-ppb1
 |     |  \-pci2
 |     |     \-re0
 |     |        \-rlphy0
 |     |-ppb2
 |     |  \-pci3
 |     \-xhci0
 |        \-usb0
 |           \-uhub0
 |              |-uhub1
 |              |  |-ugen0
 |              |  \-uvideo0
 |              |     \-video0
 |              \-urtwn0
 |-mpath0
 |  \-scsibus0
 |-softraid0
 |  \-scsibus3
 \-vscsi0
    \-scsibus2
lava$

So we have the following characters:
kernel
app (application)
pwd (physical webcam device)
psd (physical screen device)
root-mainbus0-pci0-inteldrm0-drm0
root-mainbus-pci0-xhci0-usb0-uhub0-uhub1-uvideo0-video0

Can you help me to build the right chain of communication, from the excitation of the webcam sensor to the enlighting of a pixel?
Reply With Quote
  #9   (View Single Post)  
Old 12th January 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,965
Default

If you want to trace only the system calls, you will need to use ktrace(8) with the -t c option to limit output to system calls only.

I've already pointed to the video(4) man page, which explains the application programming interface for userland programs. See the video(1) man page, which describes how to use /usr/X11R6/bin/video. In the man page, you will see the -f option, which uses the device special file /dev/video by default. The source code to this program is in /usr/xenocara/app/video/video.c -- see the OpenBSD FAQ for obtaining source code.
Reply With Quote
Old 12th January 2020
attilio attilio is offline
Port Guard
 
Join Date: Jun 2015
Posts: 40
Default

ok thanks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:01 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick