Re: [Opalvoip-user] Restrict devices before opening OPAL?
Brought to you by:
csoutheren,
rjongbloed
|
From: jeremy a. <jer...@gm...> - 2015-02-20 00:43:28
|
I am unable to replicate exactly the behaviour I experienced earlier.
Previously the code attempted to open the V4L device and aborted when it
was not found.
The difference now is I have installed a bunch of V4L dev packages on my
Wheezy system and plugged in and then removed a video device.
Now it searches for the v4L device but does not abort when it doesn't
find one. I also rebooted to clear any remnant device information.
This is the present log. You can see the code is hard wired to find a
v4L device early on in the piece. It doesn't mention searching for or
opening other plug-in devices including ALSA. It mentions the other
devices including ALSA later on after I start the shutdown.
My program opens OPAL using SIP transport only, prints "hello world",
and then shuts the system down and exits (I'm actually looking at the
feasibility of converting a much larger application from a different
TAPI to OPAL - this is just an experiment to get used to OPAL.)
Starting: /home/jeremy/Projects/pirad/build/pirad
0:00.545 Version 1.0.1 by on Unix
Linux (3.2.0-4-amd64-x86_64) with PTLib (v2.10.4 (svn:26606)) at
2015/2/20 8:26:18.957
0:00.545 OpalC Start Up, OPAL version
3.10.4 (svn:26616)
0:00.545 Detecting V4L2 devices
0:00.545 Unable to detect v4l2 directory
0:00.548 PWLib File handle high water
mark set: 7 Thread unblock pipe
0:00.548 PTLib Thread high water mark
set: 2
0:00.548 OpalMan Created manager.
0:00.549 OpalMan Attached endpoint
with prefix sip
0:00.549 OpalEP Created endpoint: sip
0:00.549 PWLib File handle high water
mark set: 8 PUDPSocket
0:00.549 IfaceMon Initial interface list:
127.0.0.1 <00-00-00-00-00-00> (lo)
203.31.40.68 <C8-60-00-9D-73-1D> (eth0)
192.168.100.67 <C8-60-00-9D-73-1D> (eth0:0)
192.168.0.9 <C8-60-00-9D-73-1D> (eth0:1)
fe80::ca60:ff:fe9d:731d <C8-60-00-9D-73-1D> (eth0)
::1 <00-00-00-00-00-00> (lo)
0:00.549 PTLIB Opened NetLink socket
0:00.549 PWLib File handle high water
mark set: 18 Thread unblock pipe
0:00.549 PTLib Thread high water mark
set: 3
0:00.549 PWLib File handle high water
mark set: 20 Thread unblock pipe
0:00.549 PTLib No permission to set
priority level 4
0:00.549 PTLib Thread high water mark
set: 4
0:00.549 Network In...0xa93a0700 IfaceMon Started interface
monitor thread.
0:00.550 OpalMan Attached endpoint
with prefix sips
0:00.550 SIP Created endpoint.
0:00.550 OpalMan Added route "sip:.*="
Hello, world!
0:00.550 OpalMan Shutting down endpoints.
0:00.550 OpalMan Clearing all calls
and waiting, primary thread.
0:02.549 OpalMan All calls cleared.
0:02.549 SIP Shutting down.
0:02.649 OpalEP sip endpoint shutting
down.
0:02.649 IfaceMon Awaiting thread
termination
0:02.649 Network In...0xa93a0700 IfaceMon Finished interface
monitor thread.
0:02.649 Network In...0xa93a0700 PWLib File handle high water
mark set: 21 PTextFile
0:02.650 Network In...0xa93a0700 PTLib Thread ended:
name="Network Interface Monitor:0xa93a0700", real=2.100, kernel=0.000
(0%), user=0.000 (0%), both=0.000 (0%)
0:02.680 OpalEP sip endpoint destroyed.
0:02.680 OpalMan Shutting down endpoints.
0:02.680 OpalMan Clearing all calls
and waiting, primary thread.
0:03.549 OpalMan All calls cleared.
0:03.549 Opal Garbage:0xa93e1700 PWLib File handle low water
mark set: 8 PTextFile
0:03.549 Opal Garbage:0xa93e1700 PTLib Thread ended:
name="Opal Garbage:0xa93e1700", real=3.001, kernel=0.000 (0%),
user=0.000 (0%), both=0.000 (0%)
0:03.559 OpalMan Deleted manager.
0:03.560 OpalC Shut Down.
0:03.560 OpalPlugin Using default
handler for plugin codec lpc10_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec g726_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec silk_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec gsmamrcodec_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec g7222_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec g722_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec ima_adpcm_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec g7221_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec gsm0610_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec speex_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec mpeg4_ffmpeg_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec theora_ptplugin
0:03.560 OpalPlugin Using default
handler for plugin codec h261_vic_ptplugin
0:03.561 OpalPlugin Using default
handler for plugin codec h263_ffmpeg_ptplugin
0:03.561 OpalPlugin Using default
handler for plugin codec spandsp_ptplugin
0:03.561 UDLL Closing
/usr/lib/opal-3.10.4/fax/spandsp_ptplugin.so
0:03.561 UDLL Closing
/usr/lib/opal-3.10.4/codecs/video/h263_ffmpeg_ptplugin.so
0:03.561 UDLL Closing
/usr/lib/opal-3.10.4/codecs/video/h261_vic_ptplugin.so
0:03.561 UDLL Closing
/usr/lib/opal-3.10.4/codecs/video/theora_ptplugin.so
0:03.561 UDLL Closing
/usr/lib/opal-3.10.4/codecs/video/mpeg4_ffmpeg_ptplugin.so
0:03.562 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/speex_ptplugin.so
0:03.562 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/gsm0610_ptplugin.so
0:03.562 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/g7221_ptplugin.so
0:03.562 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/ima_adpcm_ptplugin.so
0:03.562 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/g722_ptplugin.so
0:03.563 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/g7222_ptplugin.so
0:03.563 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/gsmamrcodec_ptplugin.so
0:03.563 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/silk_ptplugin.so
0:03.563 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/g726_ptplugin.so
0:03.563 UDLL Closing
/usr/lib/opal-3.10.4/codecs/audio/lpc10_ptplugin.so
0:03.563 UDLL Closing
/usr/lib/ptlib-2.10.4/devices/sound/pulse_pwplugin.so
0:03.563 UDLL Closing
/usr/lib/ptlib-2.10.4/devices/sound/alsa_pwplugin.so
0:03.563 UDLL Closing
/usr/lib/ptlib-2.10.4/devices/sound/oss_pwplugin.so
0:03.563 UDLL Closing
/usr/lib/ptlib-2.10.4/devices/videoinput/v4l2_pwplugin.so
0:13.560 Housekeeper:0xa935f700 PWLib File handle low water
mark set: 6 PTextFile
0:13.560 Housekeeper:0xa935f700 PTLib Thread ended:
name="Housekeeper:0xa935f700", real=13.011, kernel=0.000 (0%),
user=0.000 (0%), both=0.000 (0%)
*** Exited normally ***
On 20/02/15 07:37, Robert Jongbloed wrote:
> I am bit confused by your requirement, as V4L is video and ALSA is
> audio, they are not interchangeable!
>
> There is nothing to be called before OpalInitialise() it is the first
> function you call.
>
> I do not understand why not having a V4L device causes OpalInitialise
> to return NULL. It should not care. Can you provide the trace log?
>
>
>
> Robert Jongbloed
> /OPAL/OpenH323/PTLib Architect and Co-founder/.
>
>
> On 19 February 2015 at 16:01, jeremy ardley <jer...@gm...
> <mailto:jer...@gm...>> wrote:
>
> I use a small snippet of code to open the OPAL device in a SIP voice
> application
>
> OpalHandle hOPAL;
>
> unsigned version;
>
> version = OPAL_C_API_VERSION;
>
> if ((hOPAL = OpalInitialise(&version, OPAL_PREFIX_SIP "
> TraceLevel=4")) == NULL)
>
> {
>
> fputs("Could not initialise OPAL\n", stderr);
>
> return false;
>
> }
>
> However the OPAL instance wants to open a V4L2 device and fails
> since I
> don't have one.
>
> Can I prevent the OPAL instance from trying to open a V4L device and
> instead open an ALSA device?
>
> What calls prior to the OplaInitialise are required? Or is using the
> wrapper functions not suitable for this and I should use low level
> calls? Or does it require compile time switches? In all cases is
> there a
> link or tutorial I can use?
>
> I did searches on the error message phrase and not found much of use
> other than similar messages from apps using OPAL. I also looked
> through
> the doxygen documentation but it's a bit obscure about this. I also
> installed a 4VL device and got it to work O.K. but my target
> application
> won't have V4L.
>
> Any advice appreciated.
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and
> Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration
> & more
> Get technology previously reserved for billion-dollar
> corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> _______________________________________________
> Opalvoip-user mailing list
> Opa...@li...
> <mailto:Opa...@li...>
> https://lists.sourceforge.net/lists/listinfo/opalvoip-user
>
>
|