tumagonx / pygi-mingw-patches

patches of pygi aio for windows
15 stars 4 forks source link

Problem with Gstreamer message interval #1

Open RanzQ opened 9 years ago

RanzQ commented 9 years ago

Hi,

First of all, thanks for porting PyGI to Windows. I'm using it in a project but for some reason there are some performance issues. I was hoping if you'd have a clue what might cause this:

https://github.com/RanzQ/hyperion-audio-effects/issues/8#issuecomment-70675636

tumagonx commented 9 years ago

Sorry for the late reply,

As a packager, at the moment I can only suggest to reduce the number of installed plugins (those dlls inside site-packages\gnome\lib\gstreamer-1.0 directory). Sometime a bad plugin may interfere or even crash a running gst pipe that supposedly doesn't even need them.

in the latest installer rev8 I have try to package it in similar way to gstreamer official release (the number of plugins installed) unfortunately for win32 it's mandatory to install plugins extra (gst-plugins-bad and ugly) as the only working audio/video sink is there.

If you could provide benchmark code (preferably in C), I would help to test it.

thanks,

RanzQ commented 9 years ago

I've installed only Base packages, Gst-plugins, Gst-plugins-extra, Gstreamer, I will try with the latest release asap. Would it be possible to separate plugins-bad and plugins-ugly? Or is it necessary to install both for a working sink? And actually for me the source is important, I use fakesink for sink. For debian I installed plugins-good only.

I'm not sure if I can write better benchmark, now I'm just using python to calculate the interval of the messages sent by gstreamer.

tumagonx commented 9 years ago

Oh then you could just install gst-plugins in my installer. The working audio/video sink is directx sink which available in gst-plugins-bad so it need gst-plugins-ugly that's why they're grouped in my installer.

I suggest C because if it's performance issue, would cleaner if we test it at lower level, to make sure no python related issue involved.

RanzQ commented 9 years ago

Tried with rev 8 and left plugins-extra out. The performance issues seems to be gone! Thanks for the tip, maybe it was some plugin in bad or ugly that was causing the issue. Now I receive messages with 10ms interval with no problem, when earlier 100ms was too much.

EDIT: But now it seems that autoaudiosrc as source doesn't work anymore. :( Maybe I need to setup alsa or something if it was using DirectAudio automatically? And if that source was provided in plugins-ugly, maybe that's the problem?

EDIT2: Nevermind, I meant ASIO, not ALSA, but I guess that's not supported in gstreamer either.

EDIT3: Ok, after reading though the plugins list, supported sources are alsa, pulse, jack, oss, osxaudio and directaudio. And the last one is in plugins-bad. Trying once more with it, but I'm quite sure that the issue is within the directsound plugin.

EDIT4: Yep, stuttering again. But actually according to doc the directsound plugin has sink only and it's 'good'. I just don't have a clue what to set as the pipeline src on windows, other than 'autoaudiosrc'. And with plugins extra it works but stutters, without extra I get no sound (level plugins sends zero).

tumagonx commented 9 years ago

you're right it is dsound src thats in 'bad'.

You could try gst-inpect to see available source/sink without extra package installed. My guess is jack (source/sink) and dsound (sink) 'extra' have more such openal, wasapi, dsound

but I didn't try them out yet

EDIT: i think i just moved jack into gst-plugins-more in my installer rev8, sorry

RanzQ commented 9 years ago

I'll check the inspect and try with jack. Forgot that's available for windows too.

tumagonx commented 9 years ago

another tip, which gstreamer's dev should do this internally is raise the cpu priority to anywhere above 'normal'. This actually common practice used by many windows multimedia player.

RanzQ commented 9 years ago

Ok, thanks. Easier to debug now after I found the gst-launch and gst-inspect binaries. :) It's weird, with wasapisrc I get no messages. With autoaudiosrc it seems to select dsound (autoaudiosrc0-actual-src-directsoun), even if gst-inspect reports there's only sink available.

EDIT: It works with directsoundsrc too, so that's what is selected automatically when extra is installed. I tried without extra and autoaudiosrc selects fakesrc. I'll try with jack next.

EDIT2: Tried with jack, gst-launch crashes...