INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Capture card performance tuning  (Read 4006 times)

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Capture card performance tuning
« on: September 04, 2021, 03:04:18 pm »

I was unsure if this was TV or MC, I settled on the latter because it's not really a TV problem to my mind, more a problem with the MC video engine when fed via the TV feature.

I have a magewell capture card (https://www.magewell.com/products/usb-capture-hdmi-plus) which works well in MPC-BE but was unusable in MC (video lagged a long way and video was glitchy also). I recently happened to try it again in MC and it's almost functional now so I'm wondering if there is a way to make it actually useable (so I can then drop MPC-BE)

almost I mean the lag has gone (I feed a cable box into it so I'm measuring lag by "is the remote control usable?") but video playback is not smooth using madvr and does not work at all using RO standard/EVR when using no timeshifting at all.

Looking at the madvr stats I can see the present queue is v small (see attached) so I guess it would work smoothly *if* I could get MC to buffer consistently however this is completely broken for me, if i use the "start analogue device in timeshifting" mode then the behaviour is that it plays short bursts of video at high speed and then pauses, i.e. it looks like

read some frames from device
send them all to the renderer
renderer renders them all
repeat

If I change the madvr config to trim a few more ms from rendering time then playback is smooth.

Obviously I can change the madvr config as a short term measure (until faster GPUs are available at reasonable prices) but it's clear that current hardware would be perfectly useable *if* I could get MC to push more frames at madvr.

i.e. what I need is live mode with some buffer in front of it, something in the 250-500ms (10-30 frames at 50Hz?) sounds about right. There is no such configuration that I can find though. Is it possible? Is MC meant to be doing this internally already but isn't for some reason on this device? Any other options to try?

To preempt any windows defender etc comments, all that is sorted for both MC and MPC-BE and mpc-be + the same USB interface + madvr just works (on the same computer, switching back and forth between the two) so there is no evidence (that I can see) to point at Windows or the setup/hardware.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
How to choose the audio input for a capture card?
« Reply #1 on: September 06, 2021, 05:03:53 pm »

this is related to the same setup as https://yabb.jriver.com/interact/index.php/topic,130584.0.html but is a distinct problem so starting a new thread

MC is choosing the wrong audio input when building the filter graph


Code: [Select]
Filter Graph Info (TV graph):

    Filter 'JRiver Audio Renderer'
        CLSID: {A4002F8E-510F-442C-8AD3-F9C7B23FB394}
        Host:
        Input Pin 'In'
            Connected to pin 'Capture' of filter 'Mic (USB Capture HDMI+ Mic)'
            Major type MEDIATYPE_Audio  Sub type MEDIASUBTYPE_PCM, Format type FORMAT_WaveFormatEx

    Filter 'madVR'
        CLSID: {E1A8B82A-32CE-4B0D-BE0D-AA68C772E423}
        Host: C:\Users\mattk\AppData\Roaming\J River\Media Center 28\Plugins\madvr\madVR64.ax
        Input Pin 'Input'
            Connected to pin 'Capture' of filter 'USB Capture HDMI+ 09D9925ECDB03E8D'
            Major type MEDIATYPE_Video  Sub type MEDIASUBTYPE_YUY2, Format type FORMAT_VideoInfo

    Filter 'Mic (USB Capture HDMI+ Mic)'
        CLSID: {E30629D2-27E5-11CE-875D-00608CB78066}
        Host: c:\windows\system32\qcap.dll
        Output Pin 'Capture'
            Connected to pin 'In' of filter 'JRiver Audio Renderer'
            Major type MEDIATYPE_Audio  Sub type MEDIASUBTYPE_PCM, Format type FORMAT_WaveFormatEx
        Input Pin 'Master Volume'

    Filter 'USB Capture HDMI+ 09D9925ECDB03E8D'
        CLSID: {17CCA71B-ECD7-11D0-B908-00A0C9223196}
        Host: c:\windows\system32\ksproxy.ax
        Output Pin 'Capture'
            Connected to pin 'Input' of filter 'madVR'
            Major type MEDIATYPE_Video  Sub type MEDIASUBTYPE_YUY2, Format type FORMAT_VideoInfo
        Input Pin 'Video Camera Terminal'

it has selected this device "Mic (USB Capture HDMI+ Mic)" but the corret device is shown below

Code: [Select]
MPC-BE 1.5.6.6000
Filters currently loaded:
  - MPC Audio Renderer
  - madVR Renderer
  - Audio Switcher
  - Smart Tee (video)
  - Smart Tee (audio)
  - USB Capture HDMI+
  - HDMI (USB Capture HDMI+)

i.e. "HDMI (USB Capture HDMI+)"

If we look at the device config then MC does appear to know it should be using the correct device but the filter graph says otherwise (see attached pic)

if I check that box then and attempt to select a device then MC insists I also select an audio line however this dropdown is empty for every single audio device on my system (covers the 3 inputs for the magewell usb card, all motu 1248 audio devices as well as all RME Fireface 800 audio devices so that's a lot of devices).

As far as I can see, this is a bug, would be nice to fix it and make this configuration (of a capture card) more straightforward (just pick a device, it uses it)



Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #2 on: September 08, 2021, 12:13:52 pm »

When not in time-shifting mode, MC does not buffer.  Whatever data is presented by the source is passed down to the decoders, and then to renderers.

Someone did request making buffering part of non-time-shifting playback.  I just have not figured out an effective way of doing it yet.

In time-shifting mode, everything is first written to disk and then read back for playback.  Obviously that is playing it with aggressive buffering.  The behavior you described seems to suggest a audio or video format issue (maybe MC misread the format and thus the decoder and renderer are not handling it correctly).
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: How to choose the audio input for a capture card?
« Reply #3 on: September 08, 2021, 12:25:08 pm »

"This device requires a cable to route sound..." check box is only for some very old capture devices that really requires a physical cable between the capture card and the sound card.

Does "HDMI (USB Capture HDMI+)" capture filter have an audio output pin (find out by TV Options > Advanced > Copy television related filter info to clipboard)

You can either email me the info or post it here (if you don't mind).
Logged
Yaobing Deng, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: How to choose the audio input for a capture card?
« Reply #4 on: September 10, 2021, 02:29:05 am »

see below

I can see there are 2 with the same name and hence windows is adding (1) to one of them to disambiguate, one for video and one for audio. Is that likely to be the problem for MC?

Code: [Select]
KSCATEGORY_BDA_NETWORK_TUNER filters


KSCATEGORY_BDA_RECEIVER_COMPONENT filters


AM_KSCATEGORY_CAPTURE filters

    USB Capture HDMI+
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_00#7&2ea6dcb1&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Video Camera Terminal'

    Fireface ADAT 2 (3+4)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwavec_48
        Input Pin 'Render'
        Output Pin 'ADAT 2 (3+4)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 2 (3+4)'

    Fireface ADAT 1 (3+4)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave8_48
        Input Pin 'Render'
        Output Pin 'ADAT 1 (3+4)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 1 (3+4)'

    Fireface Analog (5+6)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave3_48
        Input Pin 'Render'
        Output Pin 'Analog (5+6)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (5+6)'

    Fireface ADAT 2 (5+6)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwaved_48
        Input Pin 'Render'
        Output Pin 'ADAT 2 (5+6)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 2 (5+6)'

    Fireface ADAT 1 (5+6)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave9_48
        Input Pin 'Render'
        Output Pin 'ADAT 1 (5+6)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 1 (5+6)'

    Fireface Analog (7+8)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave4_48
        Input Pin 'Render'
        Output Pin 'Analog (7+8)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (7+8)'

    Fireface ADAT 2 (7+8)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwavee_48
        Input Pin 'Render'
        Output Pin 'ADAT 2 (7+8)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 2 (7+8)'

    Fireface Analog (9+10)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave5_48
        Input Pin 'Render'
        Output Pin 'Analog (9+10)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (9+10)'

    Fireface ADAT 1 (7+8)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwavea_48
        Input Pin 'Render'
        Output Pin 'ADAT 1 (7+8)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 1 (7+8)'

    Fireface SPDIF
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave6_48
        Input Pin 'Render'
        Output Pin 'SPDIF'
        Output Pin 'Recording Control'
        Input Pin 'SPDIF'

    Fireface Analog (1+2)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave1_48
        Input Pin 'Render'
        Output Pin 'Analog (1+2)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (1+2)'

    Fireface ADAT 2 (1+2)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwaveb_48
        Input Pin 'Render'
        Output Pin 'ADAT 2 (1+2)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 2 (1+2)'

    Fireface ADAT 1 (1+2)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave7_48
        Input Pin 'Render'
        Output Pin 'ADAT 1 (1+2)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 1 (1+2)'

    Fireface Analog (3+4)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave2_48
        Input Pin 'Render'
        Output Pin 'Analog (3+4)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (3+4)'

    In 1-2
    @device:pnp:\\?\usb#vid_07fd&pid_0005#0001f2fffe007f93#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\motuproaudiowaveinstereosrc1
        Output Pin 'Capture'
        Input Pin 'In 1-2'

    In 1-24
    @device:pnp:\\?\usb#vid_07fd&pid_0005#0001f2fffe007f93#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\motuproaudiowaveinmulti48000
        Output Pin 'Capture'
        Input Pin 'In 1-24'

    MOTU Pro Audio LTC Sync In
    @device:pnp:\\?\usb#vid_07fd&pid_0005#0001f2fffe007f93#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\motuproaudiosyncmidiin
        Input Pin 'Synthesizer'
        Output Pin 'MIDI'

    Realtek HD Audio Mic input
    @device:pnp:\\?\hdaudio#func_01&ven_10ec&dev_1220&subsys_1458a0d2&rev_1001#5&ba4152b&0&0001#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\rtmicinwave
        Output Pin 'Recording Control'
        Input Pin 'Input1'

    Realtek HD Audio Stereo input
    @device:pnp:\\?\hdaudio#func_01&ven_10ec&dev_1220&subsys_1458a0d2&rev_1001#5&ba4152b&0&0001#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\rtstereomixwave
        Output Pin 'Recording Control'
        Input Pin 'Input1'

    Realtek HD Audio Line input
    @device:pnp:\\?\hdaudio#func_01&ven_10ec&dev_1220&subsys_1458a0d2&rev_1001#5&ba4152b&0&0001#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\rtlineinwave
        Output Pin 'Recording Control'
        Input Pin 'Input1'

    USB Capture HDMI+ (1)
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_02#7&2ea6dcb1&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Computer'
        Input Pin 'HDMI'
        Output Pin 'Headphones'

    USB Capture HDMI+ Mic
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_05#7&2ea6dcb1&0&0005#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Mic'

    USB Capture HDMI+ Computer
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_07#7&2ea6dcb1&0&0007#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Computer'


KSCATEGORY_ENCODER filters


KSCATEGORY_MULTIPLEXER filters


AM_KSCATEGORY_CROSSBAR filters


AM_KSCATEGORY_TVTUNER filters


AM_KSCATEGORY_TVAUDIO filters


AM_KSCATEGORY_VBICODEC filters


MPEG2 Multiplexer filters
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Capture card performance tuning
« Reply #5 on: September 10, 2021, 02:29:42 am »

When not in time-shifting mode, MC does not buffer.  Whatever data is presented by the source is passed down to the decoders, and then to renderers.

Someone did request making buffering part of non-time-shifting playback.  I just have not figured out an effective way of doing it yet.

In time-shifting mode, everything is first written to disk and then read back for playback.  Obviously that is playing it with aggressive buffering.  The behavior you described seems to suggest a audio or video format issue (maybe MC misread the format and thus the decoder and renderer are not handling it correctly).
doesn't the jriver playback engine already do this though? i.e. it is capable of delaying video according to the delay incurred in the audio pipeline so as to keep them in sync, this must mean a buffer exists already. Why would you need another buffer on top of that?
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #6 on: September 10, 2021, 09:03:39 pm »

doesn't the jriver playback engine already do this though? i.e. it is capable of delaying video according to the delay incurred in the audio pipeline so as to keep them in sync, this must mean a buffer exists already. Why would you need another buffer on top of that?

I think that works best when we play a video file from the hard disk.  For video capture you can not delay video because the hardware will keep pushing data.
Logged
Yaobing Deng, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Capture card performance tuning
« Reply #7 on: September 11, 2021, 03:44:19 am »

Regardless of where the data comes from, the jriver audio engine has a variable delay depending on the configuration applied. Video should be automatically delayed by whatever this value is. As long as this is supported by live TV then you already have a buffer (as far as I can see) that could be used to help out here.

Are you saying this is not supported so audio sync will depend on using a low latency audio DSP configuration? Or it is supported and there is some other reason why you can't make use of this to help out? I realise I am making some assumptions on how MC is implemented internally, based on visible behaviour, which might be completely wrong btw :)

I should note that I do not have audio in sync atm for this device (yet mpc-be playing audio looped back via wdm through MC is ok despite appearing to be a much longer pipeline)
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #8 on: September 13, 2021, 08:49:53 am »

Maybe I was wrong in my previous remarks.  There are two places where you can try.  One is Video Clock, which is in Video Options.  The other is Lip Sync control using keyboard combination Ctrl+Shift+PERIOD and Ctrl+Shift+COMMA (i.e. Ctrl+>, and Ctrl+<).  You can try either or even both.
Logged
Yaobing Deng, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Capture card performance tuning
« Reply #9 on: September 19, 2021, 11:53:37 am »

As far as I can tell, those options make no difference. Audio remains substantially delayed.
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #10 on: September 20, 2021, 08:55:44 am »

As far as I can tell, those options make no difference. Audio remains substantially delayed.

I believe Video Clock will not help when audio comes later than video, and that was what I meant on Sept 10.  We can manipulate data in our audio renderer, by delaying audio, but if audio is already delayed, we can not ask the device to send more audio data quicker.  We would need to delay video in this case, but we do not have any control over the video renderer.

Having said that, I will say that I am not 100% sure that is how it works though.
Logged
Yaobing Deng, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Capture card performance tuning
« Reply #11 on: September 20, 2021, 12:41:27 pm »

I believe Video Clock will not help when audio comes later than video, and that was what I meant on Sept 10.  We can manipulate data in our audio renderer, by delaying audio, but if audio is already delayed, we can not ask the device to send more audio data quicker.  We would need to delay video in this case, but we do not have any control over the video renderer.

Having said that, I will say that I am not 100% sure that is how it works though.
It might make sense to merge these threads as I think I/we are combining them in our responses.

https://yabb.jriver.com/interact/index.php/topic,130601.msg905568.html#msg905568

FWIW there is no evidence that audio is actually delayed. Out of the box (i.e. with no delays set anywhere) mpc-be plays this device with audio and video on sync,, MC renders audio at least 0.5s behind. It means that fundamentally something is wrong in how MC handles this device, my guess is it Is to do with the default audio device problem but that is just a guess.

For the delay video issue, from my point of view MC does this today.

Use the example of a convolution filter with a large delay on all channels. MC delays video by the amount required to maintain sync without a problem. Logically it is exactly the same problem, video needs to be delayed by X ms. Technically I am sure it is not the same but I have no visibility on that so can't comment.
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: How to choose the audio input for a capture card?
« Reply #12 on: September 20, 2021, 05:24:22 pm »

see below

I can see there are 2 with the same name and hence windows is adding (1) to one of them to disambiguate, one for video and one for audio. Is that likely to be the problem for MC?

Code: [Select]
KSCATEGORY_BDA_NETWORK_TUNER filters


KSCATEGORY_BDA_RECEIVER_COMPONENT filters


AM_KSCATEGORY_CAPTURE filters

    USB Capture HDMI+
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_00#7&2ea6dcb1&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Video Camera Terminal'

    Fireface ADAT 2 (3+4)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwavec_48
        Input Pin 'Render'
        Output Pin 'ADAT 2 (3+4)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 2 (3+4)'

    Fireface ADAT 1 (3+4)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave8_48
        Input Pin 'Render'
        Output Pin 'ADAT 1 (3+4)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 1 (3+4)'

    Fireface Analog (5+6)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave3_48
        Input Pin 'Render'
        Output Pin 'Analog (5+6)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (5+6)'

    Fireface ADAT 2 (5+6)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwaved_48
        Input Pin 'Render'
        Output Pin 'ADAT 2 (5+6)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 2 (5+6)'

    Fireface ADAT 1 (5+6)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave9_48
        Input Pin 'Render'
        Output Pin 'ADAT 1 (5+6)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 1 (5+6)'

    Fireface Analog (7+8)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave4_48
        Input Pin 'Render'
        Output Pin 'Analog (7+8)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (7+8)'

    Fireface ADAT 2 (7+8)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwavee_48
        Input Pin 'Render'
        Output Pin 'ADAT 2 (7+8)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 2 (7+8)'

    Fireface Analog (9+10)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave5_48
        Input Pin 'Render'
        Output Pin 'Analog (9+10)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (9+10)'

    Fireface ADAT 1 (7+8)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwavea_48
        Input Pin 'Render'
        Output Pin 'ADAT 1 (7+8)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 1 (7+8)'

    Fireface SPDIF
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave6_48
        Input Pin 'Render'
        Output Pin 'SPDIF'
        Output Pin 'Recording Control'
        Input Pin 'SPDIF'

    Fireface Analog (1+2)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave1_48
        Input Pin 'Render'
        Output Pin 'Analog (1+2)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (1+2)'

    Fireface ADAT 2 (1+2)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwaveb_48
        Input Pin 'Render'
        Output Pin 'ADAT 2 (1+2)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 2 (1+2)'

    Fireface ADAT 1 (1+2)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave7_48
        Input Pin 'Render'
        Output Pin 'ADAT 1 (1+2)'
        Output Pin 'Recording Control'
        Input Pin 'ADAT 1 (1+2)'

    Fireface Analog (3+4)
    @device:pnp:\\?\1394#a35&1#000a3500cc6953bf#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\ffwave2_48
        Input Pin 'Render'
        Output Pin 'Analog (3+4)'
        Output Pin 'Recording Control'
        Input Pin 'Analog (3+4)'

    In 1-2
    @device:pnp:\\?\usb#vid_07fd&pid_0005#0001f2fffe007f93#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\motuproaudiowaveinstereosrc1
        Output Pin 'Capture'
        Input Pin 'In 1-2'

    In 1-24
    @device:pnp:\\?\usb#vid_07fd&pid_0005#0001f2fffe007f93#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\motuproaudiowaveinmulti48000
        Output Pin 'Capture'
        Input Pin 'In 1-24'

    MOTU Pro Audio LTC Sync In
    @device:pnp:\\?\usb#vid_07fd&pid_0005#0001f2fffe007f93#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\motuproaudiosyncmidiin
        Input Pin 'Synthesizer'
        Output Pin 'MIDI'

    Realtek HD Audio Mic input
    @device:pnp:\\?\hdaudio#func_01&ven_10ec&dev_1220&subsys_1458a0d2&rev_1001#5&ba4152b&0&0001#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\rtmicinwave
        Output Pin 'Recording Control'
        Input Pin 'Input1'

    Realtek HD Audio Stereo input
    @device:pnp:\\?\hdaudio#func_01&ven_10ec&dev_1220&subsys_1458a0d2&rev_1001#5&ba4152b&0&0001#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\rtstereomixwave
        Output Pin 'Recording Control'
        Input Pin 'Input1'

    Realtek HD Audio Line input
    @device:pnp:\\?\hdaudio#func_01&ven_10ec&dev_1220&subsys_1458a0d2&rev_1001#5&ba4152b&0&0001#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\rtlineinwave
        Output Pin 'Recording Control'
        Input Pin 'Input1'

    USB Capture HDMI+ (1)
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_02#7&2ea6dcb1&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Computer'
        Input Pin 'HDMI'
        Output Pin 'Headphones'

    USB Capture HDMI+ Mic
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_05#7&2ea6dcb1&0&0005#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Mic'

    USB Capture HDMI+ Computer
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_07#7&2ea6dcb1&0&0007#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Computer'


KSCATEGORY_ENCODER filters


KSCATEGORY_MULTIPLEXER filters


AM_KSCATEGORY_CROSSBAR filters


AM_KSCATEGORY_TVTUNER filters


AM_KSCATEGORY_TVAUDIO filters


AM_KSCATEGORY_VBICODEC filters


MPEG2 Multiplexer filters

Normally for most capture devices, audio and video inputs appear on the same capture filter.  In your case, you chose

    USB Capture HDMI+
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_00#7&2ea6dcb1&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Video Camera Terminal'

for video capture and it has no audio on it.  In MC we simply do not have a logical way of picking an audio capture filter to match it, and as a result, the wrong one is chosen.

Perhaps you should have chosen this one:

    USB Capture HDMI+ (1)
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_02#7&2ea6dcb1&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Computer'
        Input Pin 'HDMI'
        Output Pin 'Headphones'

which seems to have "Computer" as its video input, and "HDMI" as its audio input.  Or is this one audio only (as it is listed among audio devices)?
Logged
Yaobing Deng, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Capture card performance tuning
« Reply #13 on: September 22, 2021, 05:39:05 pm »

Normally for most capture devices, audio and video inputs appear on the same capture filter.  In your case, you chose

    USB Capture HDMI+
    @device:pnp:\\?\usb#vid_2935&pid_0004&mi_00#7&2ea6dcb1&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
        Output Pin 'Capture'
        Input Pin 'Video Camera Terminal'

for video capture and it has no audio on it. 
I don't have the option to choose a device, MC presents me with one and only one device via its configuration dialog and it is the one I showed above. How does MC form that list of devices?

Bear in mind this shows in windows (and MC) as a camera type device so I can see separate audio devices and camera devices in the windows device manager.

In MC we simply do not have a logical way of picking an audio capture filter to match it, and as a result, the wrong one is chosen.
It's part of the problem to my mind, having logic in MC is great if it works but if it's doesn't then user needs a way to override the device selection otherwise it's just unuseable.

In this case, you certainly do have the facility to let the user choose an audio device, it's just that that option appears to be broken in that it only supports "mixer devices" that have an "audio line" and no "mixer device" in my system has any such things.

On the surface, the simple fix is to just let the user choose the mixer device alone and then it should just work.

What actually is an "audio line"? something to do with windows mme perhaps? (https://docs.microsoft.com/en-us/windows/win32/api/mmeapi/ns-mmeapi-mixerline)
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #14 on: September 23, 2021, 08:57:40 am »

I don't have the option to choose a device, MC presents me with one and only one device via its configuration dialog and it is the one I showed above. How does MC form that list of devices?

MC enumerates all video capture devices and let the user choose one.  In your case I think we found only one.  The other filter that I mentioned must be an audio device.

Quote
Bear in mind this shows in windows (and MC) as a camera type device so I can see separate audio devices and camera devices in the windows device manager.
It's part of the problem to my mind, having logic in MC is great if it works but if it's doesn't then user needs a way to override the device selection otherwise it's just unuseable.

In this case, you certainly do have the facility to let the user choose an audio device, it's just that that option appears to be broken in that it only supports "mixer devices" that have an "audio line" and no "mixer device" in my system has any such things.

Those are old stuff and may not apply at all.

Quote
On the surface, the simple fix is to just let the user choose the mixer device alone and then it should just work.

What actually is an "audio line"? something to do with windows mme perhaps? (https://docs.microsoft.com/en-us/windows/win32/api/mmeapi/ns-mmeapi-mixerline)

I will need to add the option for the user to pick which audio filter to use, when the video filter does not have an audio output.
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #15 on: November 10, 2021, 04:17:41 pm »


I will need to add the option for the user to pick which audio filter to use, when the video filter does not have an audio output.

Done in build 81:
5. NEW: "This device uses a separate audio capture filter" option in TV tuner configuration dialog window, for analog TV tuners or video capture devices.
Logged
Yaobing Deng, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Capture card performance tuning
« Reply #16 on: November 14, 2021, 05:27:41 am »

Done in build 81:
5. NEW: "This device uses a separate audio capture filter" option in TV tuner configuration dialog window, for analog TV tuners or video capture devices.
thanks for adding this option

I tried to use it but currently, whether that option is checked or not, attempting to play the device in MC leads to a black screen and MC is stuck on "starting TV...." (which I can stop so it's not hung). Device is working normally in another app. Rebooting doesn't help.

Nothing obvious in logs either (attached just in case)

Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #17 on: November 15, 2021, 11:32:22 am »

thanks for adding this option

I tried to use it but currently, whether that option is checked or not, attempting to play the device in MC leads to a black screen and MC is stuck on "starting TV...." (which I can stop so it's not hung). Device is working normally in another app. Rebooting doesn't help.

Nothing obvious in logs either (attached just in case)

Quote
0003510: 7636: TV: CAnalogTVDevice::InitCaptureFilters: Passed crossbar stuff. not success.
0003510: 7636: TV: CAnalogTVDevice::InitCaptureFilters: Closed Captioning not available.

Between these two log line, there should have been something else, but there is not.  The code in between would initialize the audio capture device that you selected during configuration (i.e. after you check the checkbox "This device uses a separate audio capture filter", you would have selected an audio capture filter from the list below the checkbox line, and that filter would be initialized).  Successful initialization of the audio capture filter should produce a log line "Bound audio cap device. Adding it to graph." and a few other lines between the above two lines.
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #18 on: November 15, 2021, 11:42:58 am »

However, later in the log, the DumpGraph function shows that an audio capture filter IS in the graph:

Quote
0003656: 9032: TV: 0x2348 DumpGraph: Start
0003656: 9032: TV: 0x2348 DumpGraph: Log_DumpGraph [253f3b73890]
0003656: 9032: TV: 0x2348 DumpGraph:     Filter [253f38c31b8]  'JRiver Audio Renderer'
0003656: 9032: TV: 0x2348 DumpGraph:         CLSID: {A4002F8E-510F-442C-8AD3-F9C7B23FB394}
0003656: 9032: TV: 0x2348 DumpGraph:         Host:
0003656: 9032: TV: 0x2348 DumpGraph:           Pin [2538e427478]  'In' [Input]  Connected to pin [253f3ba7308]
0003656: 9032: TV: 0x2348 DumpGraph:     Filter [253f3ba6668]  'Enhanced Video Renderer'
0003656: 9032: TV: 0x2348 DumpGraph:         CLSID: {FA10746C-9B63-4B6C-BC49-FC300EA5F256}
0003656: 9032: TV: 0x2348 DumpGraph:         Host: c:\windows\system32\evr.dll
0003656: 9032: TV: 0x2348 DumpGraph:           Pin [253f3b858e8]  'EVR Input0' [Input]  Connected to pin [253f3b885d8]
0003656: 9032: TV: 0x2348 DumpGraph:           Pin [253f3b9e898]  'EVR Input1' [Input]
0003656: 9032: TV: 0x2348 DumpGraph:     Filter [253f3ba3e78]  'HDMI (USB Capture HDMI+)'
0003656: 9032: TV: 0x2348 DumpGraph:         CLSID: {E30629D2-27E5-11CE-875D-00608CB78066}
0003656: 9032: TV: 0x2348 DumpGraph:         Host: c:\windows\system32\qcap.dll
0003656: 9032: TV: 0x2348 DumpGraph:           Pin [253f3ba7308]  'Capture' [Output]  Connected to pin [2538e427478]
0003656: 9032: TV: Log_DisplayType: Connection type  M type MEDIATYPE_Audio  S type MEDIASUBTYPE_PCM
0003656: 9032: TV: Log_DisplayType: Subtype description UNKNOWN
0003656: 9032: TV: Log_DisplayType: Not temporally compressed
0003656: 9032: TV: Log_DisplayType: Sample size 4
0003656: 9032: TV: Log_DisplayType:      Format type FORMAT_WaveFormatEx
0003656: 9032: TV: Log_DisplayType:      Subtype MEDIASUBTYPE_PCM
0003656: 9032: TV: Log_DisplayType: wFormatTag 1
0003656: 9032: TV: Log_DisplayType: nChannels 2
0003657: 9032: TV: Log_DisplayType: nSamplesPerSec 44100
0003657: 9032: TV: Log_DisplayType: nAvgBytesPerSec 176400
0003657: 9032: TV: Log_DisplayType: nBlockAlign 4
0003657: 9032: TV: Log_DisplayType: wBitsPerSample 16
0003657: 9032: TV: Log_DisplayType: cbSize 0
0003657: 9032: TV: 0x2348 DumpGraph:           Pin [253f3ba4498]  'Master Volume' [Input]
0003657: 9032: TV: 0x2348 DumpGraph:     Filter [253f3b72dd8]  'USB Capture HDMI+ 09D9925ECDB03E8D'
0003657: 9032: TV: 0x2348 DumpGraph:         CLSID: {17CCA71B-ECD7-11D0-B908-00A0C9223196}
0003657: 9032: TV: 0x2348 DumpGraph:         Host: c:\windows\system32\ksproxy.ax
0003657: 9032: TV: 0x2348 DumpGraph:           Pin [253f3b885d8]  'Capture' [Output]  Connected to pin [253f3b858e8]
0003657: 9032: TV: Log_DisplayType: Connection type  M type MEDIATYPE_Video  S type MEDIASUBTYPE_YUY2
0003657: 9032: TV: Log_DisplayType: Subtype description UNKNOWN
0003657: 9032: TV: Log_DisplayType: Not temporally compressed
0003657: 9032: TV: Log_DisplayType: Sample size 4147200
0003657: 9032: TV: Log_DisplayType: Source rectangle (Left 0 Top 0 Right 0 Bottom 0)
0003657: 9032: TV: Log_DisplayType: Target rectangle (Left 0 Top 0 Right 0 Bottom 0)
0003657: 9032: TV: Log_DisplayType: Size of BITMAPINFO structure 40
0003657: 9032: TV: Log_DisplayType: 1920x1080x16 bit '0x32595559'
0003657: 9032: TV: Log_DisplayType: Image size 4147200
0003657: 9032: TV: Log_DisplayType: Planes 1
0003657: 9032: TV: Log_DisplayType: X Pels per metre 0
0003657: 9032: TV: Log_DisplayType: Y Pels per metre 0
0003657: 9032: TV: Log_DisplayType: Colours used 0
0003657: 9032: TV: 0x2348 DumpGraph:           Pin [253f3b85648]  'Video Camera Terminal' [Input]
0003657: 9032: TV: 0x2348 DumpGraph: Finish (0 ms)

The video device is 'USB Capture HDMI+ 09D9925ECDB03E8D' and it outputs YUY2 video to EVR.  The audio capture filter is 'HDMI (USB Capture HDMI+)' and it outputs PCM audio to JRiver Audio Renderer.

So this part seems to be correct?
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #19 on: November 15, 2021, 12:40:06 pm »

So, after initial failure to load audio capture device (this part is a bit strange), we did manage to build a DirectShow graph that did include the correct audio capture filter.  But that graph could not be started:

Quote
0003737: 7636: TV: CAnalogTVDevice::StartPreview: Start
0003738: 5512: Playback: CVideoRefreshRateThread::Thread: Start
0003767: 7636: TV: CMainTVManager::PropagateErrorMessage: Start
0003767: 7636: TV: CMainTVManager::PropagateErrorMessage: Cannot run graph.  hr=0x8004022a
0003767: 7636: TV: CMainTVManager::PropagateErrorMessage: Finish (0 ms)
0003767: 7636: TV: CAnalogTVDevice::StartPreview: RunGraph failed.  hr=0x8004022a
0003767: 7636: TV: CAnalogTVDevice::StartPreview: Finish (29 ms)

Failure code 0x8004022a means "This pin cannot use the supplied media type".  EVR does not like YUY2 video type?

I tried my Hauppauge TV device.  It connects with an AVI Decompressor, which converts YUY2 to RGB32.  Maybe that is what I should look into.
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #20 on: November 15, 2021, 01:11:29 pm »

When building the graph, the same code is used to render video output, on my machine as on yours.  But on mine an AVI Decompressor was inserted automatically by DirectShow, on yours it did not happen.  It might be related to the fact your device output HD video, while mine (during test) was doing SD.

I noticed that you are trying to use JRVR, but in TV code we have not hooked JRVR yet.  So we ended up falling back to EVR.  Maybe you can try setting the video renderer to madVR for a test (Red October HQ).
Logged
Yaobing Deng, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Capture card performance tuning
« Reply #21 on: November 15, 2021, 04:43:22 pm »

When building the graph, the same code is used to render video output, on my machine as on yours.  But on mine an AVI Decompressor was inserted automatically by DirectShow, on yours it did not happen.  It might be related to the fact your device output HD video, while mine (during test) was doing SD.

I noticed that you are trying to use JRVR, but in TV code we have not hooked JRVR yet.  So we ended up falling back to EVR.  Maybe you can try setting the video renderer to madVR for a test (Red October HQ).
well spotted, it does work with madvr and audio plays as expected. Just the lag problem to deal with now :)
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #22 on: November 17, 2021, 06:05:32 pm »

Build 84 is out.  It has this change:

Fixed: Analog TV tuner and video capture devices were not using JRVR as selected by users.

So you can try Red October JRVR again.  While you are at it, also try Red October Standard, which uses Enhanced Video Renderer.  Let me know how they work.
Logged
Yaobing Deng, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Capture card performance tuning
« Reply #23 on: November 21, 2021, 04:46:43 pm »

EVR still gets stuck on opening, jrvr works though (with the same lag as madvr)
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Capture card performance tuning
« Reply #24 on: November 21, 2021, 08:00:49 pm »

As expected.  Thanks.  Next build will have my attempt to fix the EVR issue.
Logged
Yaobing Deng, JRiver Media Center
Pages: [1]   Go Up