Gevent, ZMQ, GObject, GLIb, Gstreamer

273 views
Skip to first unread message

Pedro Algarvio, aka, s0undt3ch

unread,
Dec 24, 2010, 5:24:21 AM12/24/10
to gev...@googlegroups.com
Hello all.

I'm evaluating gevent to use on a project of mine.
The project is suposed to use gstreamer to get some audio streams on the internet, analyze the audio and report problems on the streams.
It should be implemented as a daemon/client system, ie, the daemon will be responsible for "listening" to the streams and should report problems using preferably zmq to clients.
Clients should also be able to interact with the daemon, ie to configure the streams, etc, through rpc, but this part should be the easiest one.

I've never used gevent besides making it run my wsgi apps behind nginx, or better, so far, regarding network libraries the only one I've used is Twisted and by this you might know why I'm trying to stay away from it :)

After some digging around, I haven't seen anyone using gevent with gobject/glib which has it's own mainloop, nor zmq for that matter.

Are there any suggestions on which path I should follow?
Any public code I can have a look?

Regards,
Pedro Algarvio.

Matt Billenstein

unread,
Dec 24, 2010, 2:14:46 PM12/24/10
to gev...@googlegroups.com
How will you be communicating with gstreamer? subprocess.Popen? This
might work fine since the audio stream will be analyized in another
process altogether and you can communicate with it in a non-blocking
fashion.

How many clients are you talking about here? You could probably write
one program that manages a set of Popen objects which are doing whatever
you want with the audio streams and implements a simple http server that
the clients connect to via websockets or longpolling to listen for
events...

m

--
Matt Billenstein
ma...@vazor.com
http://www.vazor.com/

Pedro Algarvio

unread,
Dec 26, 2010, 8:29:48 AM12/26/10
to gev...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nope, ideally, no Popen, gstreamer's python bindings, I will most likely
need to tweak the streams while their running, etc...

Regarding clients, I think at most 100 clients, this is an internal
company project, at least for now.

Regarding the events communication with clients, well, within the main
daemon, I was thinking zmq, either for same process communication or
inter-process/inter-thread communication, regarding front-end clients, I
was thinking websockets yes...

Regards,
- --
Pedro Algarvio
__ ___ ___ _______ ___ __
| Y .' _| _ .-----.' _| |_ .-----.----.-----.
|. | | _| 1___| _ | _| _|__| _ | _| _ |
|. | |__| |____ |_____|__| |____|__|_____|__| |___ |
|: 1 | |: 1 | |_____|
|::.. . | |::.. . | ufs [AT] ufsoft [DOT] org
`-------' `-------' ufs [AT] sapo [DOT] pt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk0XQ0oACgkQcOJJ0dKIu0f2nwCfStj8XOo2uyen9gsxXvj6tJ45
jfwAn1A1ykER4aGznDS85MWUjn6hwfFk
=rNC3
-----END PGP SIGNATURE-----

0xD288BB47.asc

Matt Billenstein

unread,
Dec 26, 2010, 4:10:19 PM12/26/10
to gev...@googlegroups.com
On Sun, Dec 26, 2010 at 01:29:48PM +0000, Pedro Algarvio wrote:
> Nope, ideally, no Popen, gstreamer's python bindings, I will most likely
> need to tweak the streams while their running, etc...

Hmmm, I'm not familiar with gstreamer, but I think you're going to
possibly have issues there if gstreamer calls block or go down into
c-modules which won't cooperate with the gevent event loop.

gevent for serving the client-side seems perfect, but it you may need
additional processes (or threads, although these are frought with
problems in Python due to the GIL) to handle the processing/gstreamer
side of it.

m

Reply all
Reply to author
Forward
0 new messages