Author Topic: Use of webcam  (Read 78092 times)

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #90 on: July 04, 2020, 03:58:24 pm »
Hi Rémy,

In addition to your suggest, may I suggest to add:
If /xN nor /yN parameters are found, the list is scanned for 640x480 resolution.
Alright, done. In the meantime I tried to implement streaming raw audio from the builtin microphone to \PIPE\Webcam\Audio with mixed results.

WARNING: This is beta test software! May only be used at your own risk! This time BACKUP YOUR SYSTEM TWICE before even trying.

The problems (traps) are related to the USB driver set installed. Only after installing the Lars Erdmann 10.234 drivers I got rid of the traps.

Note that for now the audio part is hardcoded for the logitech c250/c270 to stream 16-bit, mono, 48000Hz. raw audio.

Your mileage may vary. I keep my fingers crossed.

Regards,
Wim.

David McKenna

  • Hero Member
  • *****
  • Posts: 742
  • Karma: +24/-0
    • View Profile
Re: Use of webcam
« Reply #91 on: July 04, 2020, 07:06:47 pm »
Hi Wim,

  I decided to give this a try with my Logitech C270, and it works! I ran:

webcam /u/x640/y360/a/h/n/s | ffplay -f mjpeg -framerate 50 -i -

 and got a window with live video. Then ran:

ffplay -f s16le -ar 48000 -ac 1 -showmode 1 -i \PIPE\Webcam\Audio

 and got another window with a live sound wave and could hear the echo of my voice... woohoo!

 When I went to shut it all down, I got a TrapE in USBEHCI when I closed the webcam console. I am using both of Lars' USBAudio drivers. The console showed a couple of errors, so I will upload a log of it in case it is interesting. Thanks for this great software!

Regards,
« Last Edit: July 05, 2020, 04:09:18 am by David McKenna »

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #92 on: July 04, 2020, 08:19:25 pm »
Hi Rémy,

In addition to your suggest, may I suggest to add:
If /xN nor /yN parameters are found, the list is scanned for 640x480 resolution.
Alright, done. In the meantime I tried to implement streaming raw audio from the builtin microphone to \PIPE\Webcam\Audio with mixed results.

WARNING: This is beta test software! May only be used at your own risk! This time BACKUP YOUR SYSTEM TWICE before even trying.

The problems (traps) are related to the USB driver set installed. Only after installing the Lars Erdmann 10.234 drivers I got rid of the traps.

Note that for now the audio part is hardcoded for the logitech c250/c270 to stream 16-bit, mono, 48000Hz. raw audio.

Your mileage may vary. I keep my fingers crossed.

Regards,
Wim.

Hi Wim

/x and /y works but as soon I enable /a, it hung and I have a trapE
I'm unable to get any audio stream.

Regards
Rémy

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Use of webcam
« Reply #93 on: July 05, 2020, 02:12:35 am »
Hi Wim,

  I decided to give this a try with my Logitech C270, and it works! I ran:

webcam /u/x640/y360/a/h/n/s | ffplay -f mjpeg -framerate 50 -i -

 and got a window with live video. Then ran:

ffplay -f s16le -ar 48000 -ac 1 -showmode 1 -i \PIPE\Webcam\Audio

 and got another window with a live sound wave and could hear the echo of my voice... woohoo!

 When I went to shut it all down, I got a TrapE in OS2EHCI when I closed the webcam console. I am using both of Lars' USBAudio drivers. The console showed a couple of errors, so I will upload a log of it in case it is interesting. Thanks for this great software!

Regards,
If you can post a screen shot of the trap screen, I have a chance to fix the error.

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #94 on: July 05, 2020, 03:08:47 am »
Hi Lars,

It looks to be same trap000e "not the same driver" I use
now: USB 12.6 ArcaOS drivers (only the USB3 driver is not used due it does not support isochronous transfer)

Updated comments:
I did more tests.
- Start webcam /a/n     (entering ctrl/c -> trap 000e)   
- Start webcam /a/n
   Start ffplay for audio in a prompt cmd window (could get audio)
   Start ffplay for video in an other prompt cmd window (could get video)
   note: audio is out of syncro with a big gap (nearly 2s after video)
   Close of ffplay audio window ok
   Close of fffplay video window ok
   ctrl/c under webcam window => trap 000e   

Note: for information, -framerate 50 will double the framerate by ffplay but not webcam which provides 25 fps for the specified cam.

Regards
Rémy
« Last Edit: July 05, 2020, 11:56:17 am by Remy »

David McKenna

  • Hero Member
  • *****
  • Posts: 742
  • Karma: +24/-0
    • View Profile
Re: Use of webcam
« Reply #95 on: July 05, 2020, 04:05:00 am »
Lars,

 Screen shot attached - similar to Remy's, but not exact. I am using the ArcaNoae 12.06 USB stack including the USBXHCD driver, but audio is your 2: USBAUDIO.SYS and USBAUD2.SYS, ver 10.234.

Regards,
« Last Edit: July 05, 2020, 04:12:20 am by David McKenna »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Use of webcam
« Reply #96 on: July 05, 2020, 10:23:47 am »
I am sorry but the trap happens in USBEHCD of the AN 12.x stack. Of course,that is very different from my driver (it's 32-bit driver to begin with).
Of course,I do not have access to the source code of that driver. You will need to raise a problem report with AN.
If you use my full driver set and if you also get a TRAP000E, I will be able to fix it.

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #97 on: July 05, 2020, 12:06:15 pm »
I opened a ticket at Arca Noae bugtracker

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Use of webcam
« Reply #98 on: July 05, 2020, 04:59:59 pm »
What I CAN say about the 2 trap screens:
they point to the very same error location.
The fact that the upper 16 bits of the 32-bit trap offset (EIP) differ is due to the address mapping. The lower 16 bits however are identical.

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #99 on: July 05, 2020, 06:23:41 pm »
Hi David and Rémy,

Thanks for the courage to test and reporting back. This is the trap screen I get when running eComStation 2.2 with AN 12.06 drivers:
Code: [Select]
dumptrapscreen v0.4 reading y:\dumpdata.001 07-05-20  11:30:30

Exception in module: USBEHCD
TRAP 000e       ERRCD=0002  ERACC=****  ERLIM=******** CPU=01
EAX=00000060  EBX=f9758910  ECX=00000001  EDX=00000000
ESI=00000060  EDI=00000060  EBP=fce78000  FLG=00010206
CS:EIP=0168:ffc3ee8a  CSACC=c09b  CSLIM=ffffffff
SS:ESP=1550:f8d73f04  SSACC=c093  SSLIM=ffffffff
DS=0160  DSACC=c093  DSLIM=ffffffff  CR0=8001003b
ES=0160  ESACC=c093  ESLIM=ffffffff  CR2=f9758910
FS=0000  FSACC=****  FSLIM=********
GS=0000  GSACC=****  GSLIM=********

Internal revision 14.106_SMP
Same location as to Lars' comment.

I suspect the trap occurs while running the following code:
Code: [Select]
; cancel isochronous audio transfers
  call UsbCancelTransfer c,[fhDevice],[aAddrEndpoint],[aAltInterface],[iAudioEvent]
; close isochronous audio transfer
  call UsbIsoClose c,[fhDevice],[aAddrEndpoint],[aAltInterface]
; reset alternative audio interface request
  call UsbCtrlMessage c,[fhDevice],001h,0Bh,0,[aNumInterface],0,0,0
And specifically during the UsbCancelTransfer function.

I opened a ticket at Arca Noae bugtracker
I could not find that bug report in mantis. Please check.

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #100 on: July 05, 2020, 07:27:19 pm »

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: Use of webcam
« Reply #101 on: July 05, 2020, 08:09:19 pm »
Why private?

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #102 on: July 05, 2020, 09:42:26 pm »
Why private?

It always goes private in case of new fixtest

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #103 on: July 06, 2020, 01:37:45 pm »
Hi Rémy,

In addition to your suggest, may I suggest to add:
If /xN nor /yN parameters are found, the list is scanned for 640x480 resolution.
Alright, done. In the meantime I tried to implement streaming raw audio from the builtin microphone to \PIPE\Webcam\Audio with mixed results.

WARNING: This is beta test software! May only be used at your own risk! This time BACKUP YOUR SYSTEM TWICE before even trying.

The problems (traps) are related to the USB driver set installed. Only after installing the Lars Erdmann 10.234 drivers I got rid of the traps.

Note that for now the audio part is hardcoded for the logitech c250/c270 to stream 16-bit, mono, 48000Hz. raw audio.

Your mileage may vary. I keep my fingers crossed.

Regards,
Wim.

Hi Wim,

Something is strange, using only the video (no /a), and specifying /x and /y, I have a big delay !
Previous build had a short delay (a few ms) while now, the delay is near 2s !  (time betwwen the real movement until it is shown in the video)
(with ot without /x /y parm, the result is the same)

Any idea about this ?
Is it going into the video size list for each mjpeg ?

Regards
Rémy

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #104 on: July 06, 2020, 04:27:24 pm »
Hi Wim,

Something is strange, using only the video (no /a), and specifying /x and /y, I have a big delay !
Previous build had a short delay (a few ms) while now, the delay is near 2s !  (time betwwen the real movement until it is shown in the video)
(with ot without /x /y parm, the result is the same)

Any idea about this ?
Is it going into the video size list for each mjpeg ?

Regards
Rémy

Hi Rémy,

The previous build and this one work the same. The delay occurs when ffplay decides to buffer the video stream before showing it.
When using "webcam /m/s | ffplay -i -" then there is that big delay (shows vq= 742KB which I guess is the buffer size used) .
When using "webcam /m/s | ffplay -framerate 50 -i -" there appears to be almost no delay.
When using "webcam /f5/m/s | ffplay -framerate 50 -i -" there is is almost no delay too.

And no, the video size list is only scanned once or twice at the start of the program.

Regards,
Wim