Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2014 19:06:14 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 191781] [patch] multimedia/webcamd - much improved rc.d script
Message-ID:  <bug-191781-13-N62ulpo37Q@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-191781-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-191781-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191781

--- Comment #11 from dreamcat4@gmail.com ---
(In reply to Hans Petter Selasky from comment #10)
> Hi,
> 
> You can override the "unit" allocation which is used when creating the
> devices using the "-v" parameter. Maybe not that well documented, and then
> you don't need any delay between the invokations.

Hmm. Unfortunately I am not sure yet how rc.d script can be smart enough to
automatically know from just a "ugenN.n" device number if it is going to appear
as /dev/video{n} or /dev/dvb/adaptor{n} in devfs.

We could say reserve *both*. Which then lead to not-used device numbers. Or
some other switching around going on. For example if 2 identical devices are
swapped then ugen2.2 become ugen4.4 and visa-versa. Then /dev/dvb numbers will
become swapped over too. (since simple counter, and which appear first in the
grep list from usbconfig command).

Wheras if we instead use the USB serial number**, then that can correspond to
the rc.conf variable's unique index number e.g.:

webcamd_device_0_serial="XXXXX-XXXXXX"
webcamd_device_1_serial="YYYYY-YYYYYY"

Then '-v' flag can be set with index number for consistent device ordering (no
matter which is the ugenN.n number).

Unfortunately this situation is not very simple. When a SINGLE dual-Tuner
device (like mine) will create:

freenas // root^> webcamd -d 7.2
Attached to ugen7.2[0]
Creating /dev/dvb/adapter0/demux0
Creating /dev/dvb/adapter1/demux0
Creating /dev/dvb/adapter0/dvr0
Creating /dev/dvb/adapter1/dvr0
Creating /dev/dvb/adapter0/frontend0
Creating /dev/dvb/adapter1/frontend0
Creating /dev/input/event0

When all these doubled up devices cannot match up cleanly to a single index
number. From rc.conf variable {0,1,2,n} as suggested before.

Maybe we can still guarantee the general ordering. I am guessing a little bit
here because I don't have 2x identical 'dual tuner device' to try it with.
Sorry if it all sounds pretty complicated. Suggestions welcome!

A possible way to make simpler for user, is to automatically generate and keep
some local cache file. Which specify the list of all detected USB serial
numbers, just to know their relative positions. Then the /dev/ ordering is kept
consistent. But the user never to need to know or find out the USB device
serial numbers.

** The USB Serial number can be grepped for, individually 1 device, with the
following command:

usbconfig -u 7 -a 2 dump_device_desc


> --HPS

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-191781-13-N62ulpo37Q>