Skip to contentSkip to conversation

Update Polypaudio plug-in to the 0.9.0 API

PATCH Applied Pierre Ossman 2 participants 3 messages May 29, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update Polypaudio plug-in to the 0.9.0 API

The new version of Polypaudio includes a threading abstraction that allows application of a more synchronous nature to use the API more easily. Using this, the complexity of the Polypaudio plug-in is greatly reduced and also removes the risk of stalling the communications layer.

? polyp-09.patch
? polyp-update.patch
? mix/pcm_upmix.loT
Index: configure.in
===================================================================
RCS file: /cvsroot/alsa/alsa-plugins/configure.in,v retrieving revision 1.21

configure.in +1 -1
diff -u -r1.21 configure.in
@@ -16,7 +16,7 @@
 PKG_CHECK_MODULES(JACK, jack >= 0.98, [HAVE_JACK=yes], [HAVE_JACK=no])
 AM_CONDITIONAL(HAVE_JACK, test x$HAVE_JACK = xyes)
 
-PKG_CHECK_MODULES(polypaudio, [polyplib], [HAVE_POLYP=yes], [HAVE_POLYP=no])
+PKG_CHECK_MODULES(polypaudio, [polyplib >= 0.9.0], [HAVE_POLYP=yes], [HAVE_POLYP=no])
 AM_CONDITIONAL(HAVE_POLYP, test x$HAVE_POLYP = xyes)
 
 PKG_CHECK_MODULES(samplerate, [samplerate], [HAVE_SAMPLERATE=yes], [HAVE_SAMPLERATE=no])

Index: polyp/ctl_polyp.c
===================================================================
RCS file: /cvsroot/alsa/alsa-plugins/polyp/ctl_polyp.c,v retrieving revision 1.4

ctl_polyp.c +69 -72

378 lines not on this page · raw message

Index: polyp/pcm_polyp.c
===================================================================
RCS file: /cvsroot/alsa/alsa-plugins/polyp/pcm_polyp.c,v retrieving revision 1.5

pcm_polyp.c +128 -107

494 lines not on this page · raw message

Index: polyp/polyp.c
===================================================================
RCS file: /cvsroot/alsa/alsa-plugins/polyp/polyp.c,v retrieving revision 1.4

polyp.c +103 -221

448 lines not on this page · raw message

Index: polyp/polyp.h
===================================================================
RCS file: /cvsroot/alsa/alsa-plugins/polyp/polyp.h,v retrieving revision 1.2

polyp.h +7 -11
diff -u -r1.2 polyp.h
@@ -21,32 +21,27 @@
 #include <alsa/asoundlib.h>
 
 #include <polyp/polypaudio.h>
-#include <polyp/mainloop.h>
 
 #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
 
 typedef struct snd_polyp {
-    pa_mainloop *mainloop;
+    pa_threaded_mainloop *mainloop;
     pa_context *context;
 
     int thread_fd, main_fd;
 
-    pthread_t thread;
-    int thread_running;
-
     enum {
         POLYP_STATE_INIT,
-        POLYP_STATE_CONNECTED,
         POLYP_STATE_READY,
-        POLYP_STATE_POLLING,
     } state;
 } snd_polyp_t;
 
-int polyp_start_poll(snd_polyp_t *p);
-int polyp_finish_poll(snd_polyp_t *p);
-
 int polyp_check_connection(snd_polyp_t *p);
 
+void polyp_stream_state_cb(pa_stream *s, void * userdata);
+void polyp_stream_success_cb(pa_stream *s, int success, void *userdata);
+void polyp_context_success_cb(pa_context *c, int success, void *userdata);
+
 int polyp_wait_operation(snd_polyp_t *p, pa_operation *o);
 int polyp_wait_stream_state(snd_polyp_t *p, pa_stream *stream, pa_stream_state_t target);
 
@@ -54,8 +49,9 @@
 void polyp_free(snd_polyp_t *p);
 
 int polyp_connect(snd_polyp_t *p, const char *server);
-int polyp_start_thread(snd_polyp_t *p);
 
+void polyp_poll_activate(snd_polyp_t *p);
+void polyp_poll_deactivate(snd_polyp_t *p);
 int polyp_poll_descriptors_count(snd_polyp_t *p);
 int polyp_poll_descriptors(snd_polyp_t *p, struct pollfd *pfd, unsigned int space);
 int polyp_poll_revents(snd_polyp_t *p, struct pollfd *pfd, unsigned int nfds, unsigned short *revents);

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Applied
#1 lore raw

At Mon, 29 May 2006 09:37:40 +0200,

Quoted 7 lines · Pierre Ossman

The new version of Polypaudio includes a threading abstraction that allows application of a more synchronous nature to use the API more easily. Using this, the complexity of the Polypaudio plug-in is greatly reduced and also removes the risk of stalling the communications layer.

Applied to HG repo. Thanks.

(BTW, are you still using CVS? Please don't use ALSA CVS repo any more since it contains only obsoleted codes.)

Takashi

#2 lore raw
Quoted 4 lines · Takashi Iwai

(BTW, are you still using CVS? Please don't use ALSA CVS repo any more since it contains only obsoleted codes.)

That I am. I thought it still got mirrored out.

Signature · 2 lines
Pierre Ossman                Telephone: +46-13-21 46 00
Cendio AB                    Web: http://www.cendio.com

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel