2004-07-16 19:56:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* $Id$ */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/***
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  This  file  is  part  of  polypaudio . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  polypaudio  is  free  software ;  you  can  redistribute  it  and / or  modify 
							 
						 
					
						
							
								
									
										
										
										
											2004-11-14 14:58:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  it  under  the  terms  of  the  GNU  Lesser  General  Public  License  as  published 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 19:56:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  by  the  Free  Software  Foundation ;  either  version  2  of  the  License , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  or  ( at  your  option )  any  later  version . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  polypaudio  is  distributed  in  the  hope  that  it  will  be  useful ,  but 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  WITHOUT  ANY  WARRANTY ;  without  even  the  implied  warranty  of 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  MERCHANTABILITY  or  FITNESS  FOR  A  PARTICULAR  PURPOSE .  See  the  GNU 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  General  Public  License  for  more  details . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2004-11-14 14:58:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  You  should  have  received  a  copy  of  the  GNU  Lesser  General  Public  License 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 19:56:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  along  with  polypaudio ;  if  not ,  write  to  the  Free  Software 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  Foundation ,  Inc . ,  59  Temple  Place ,  Suite  330 ,  Boston ,  MA  02111 - 1307 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  USA . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* * */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 19:16:42 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# ifdef HAVE_CONFIG_H 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <config.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  <assert.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <stdio.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-10 17:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# ifdef HAVE_SYS_POLL_H 
 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  <sys/poll.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-10 17:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# else 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "poll.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <asoundlib.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-02-16 19:19:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <polypcore/core.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <polypcore/module.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <polypcore/memchunk.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <polypcore/sink.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <polypcore/modargs.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <polypcore/util.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <polypcore/sample-util.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <polypcore/xmalloc.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <polypcore/log.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-10-30 01:55:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "module-alsa-sink-symdef.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-16 22:08:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "alsa-util.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-11 23:17:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PA_MODULE_AUTHOR ( " Lennart Poettering " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								PA_MODULE_DESCRIPTION ( " ALSA Sink " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								PA_MODULE_VERSION ( PACKAGE_VERSION ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-20 17:19:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PA_MODULE_USAGE ( " sink_name=<name for the sink> device=<ALSA device> format=<sample format> channels=<number of channels> rate=<sample rate> fragments=<number of fragments> fragment_size=<fragment size> " ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-11 23:17:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								struct  userdata  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    snd_pcm_t  * pcm_handle ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-11 01:17:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    pa_sink  * sink ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    pa_io_event  * * io_events ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-08-05 19:53:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    unsigned  n_io_events ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    size_t  frame_size ,  fragment_size ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-11 01:17:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    pa_memchunk  memchunk ,  silence ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    pa_module  * module ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  const  char *  const  valid_modargs [ ]  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    " device " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    " sink_name " , 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 14:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    " format " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    " channels " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    " rate " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    " fragments " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    " fragment_size " , 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    NULL 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define DEFAULT_SINK_NAME "alsa_output" 
 
							 
						 
					
						
							
								
									
										
										
										
											2005-09-16 00:11:15 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# define DEFAULT_DEVICE "default" 
 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-08-04 16:39:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  update_usage ( struct  userdata  * u )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								   pa_module_set_used ( u - > module , 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-11 01:17:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                      ( u - > sink  ?  pa_idxset_size ( u - > sink - > inputs )  :  0 )  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                      ( u - > sink  ?  pa_idxset_size ( u - > sink - > monitor_source - > outputs )  :  0 ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-08-04 16:39:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								static  void  xrun_recovery ( struct  userdata  * u )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    assert ( u ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-05 00:03:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    pa_log ( __FILE__ " : *** ALSA-XRUN (playback) *** \n " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( snd_pcm_prepare ( u - > pcm_handle )  <  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-05 00:03:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        pa_log ( __FILE__ " : snd_pcm_prepare() failed \n " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  void  do_write ( struct  userdata  * u )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    assert ( u ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-08-04 16:39:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    update_usage ( u ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    for  ( ; ; )  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-11 01:17:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        pa_memchunk  * memchunk  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        snd_pcm_sframes_t  frames ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        if  ( u - > memchunk . memblock ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            memchunk  =  & u - > memchunk ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            if  ( pa_sink_render ( u - > sink ,  u - > fragment_size ,  & u - > memchunk )  <  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                memchunk  =  & u - > silence ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                memchunk  =  & u - > memchunk ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        assert ( memchunk - > memblock  & &  memchunk - > memblock - > data  & &  memchunk - > length  & &  memchunk - > memblock - > length  & &  ( memchunk - > length  %  u - > frame_size )  = =  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-01 00:23:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        if  ( ( frames  =  snd_pcm_writei ( u - > pcm_handle ,  ( uint8_t * )  memchunk - > memblock - > data  +  memchunk - > index ,  memchunk - > length  /  u - > frame_size ) )  <  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 17:03:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            if  ( frames  = =  - EAGAIN ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								            if  ( frames  = =  - EPIPE )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                xrun_recovery ( u ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                continue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-05 00:03:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            pa_log ( __FILE__ " : snd_pcm_writei() failed \n " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								            return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        if  ( memchunk  = =  & u - > memchunk )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 17:03:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            size_t  l  =  frames  *  u - > frame_size ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            memchunk - > index  + =  l ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            memchunk - > length  - =  l ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            if  ( memchunk - > length  = =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                pa_memblock_unref ( memchunk - > memblock ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                memchunk - > memblock  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                memchunk - > index  =  memchunk - > length  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-27 16:25:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  io_callback ( pa_mainloop_api * a ,  pa_io_event  * e ,  PA_GCC_UNUSED  int  fd ,  PA_GCC_UNUSED  pa_io_event_flags_t  f ,  void  * userdata )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    struct  userdata  * u  =  userdata ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-08-05 19:53:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    assert ( u  & &  a  & &  e ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( snd_pcm_state ( u - > pcm_handle )  = =  SND_PCM_STATE_XRUN ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        xrun_recovery ( u ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    do_write ( u ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-11 01:17:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  pa_usec_t  sink_get_latency_cb ( pa_sink  * s )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-13 13:26:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    pa_usec_t  r  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    struct  userdata  * u  =  s - > userdata ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    snd_pcm_sframes_t  frames ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    assert ( s  & &  u  & &  u - > sink ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( snd_pcm_delay ( u - > pcm_handle ,  & frames )  <  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-05 00:03:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        pa_log ( __FILE__ " : failed to get delay \n " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        s - > get_latency  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( frames  <  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        frames  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2004-09-13 13:26:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    r  + =  pa_bytes_to_usec ( frames  *  u - > frame_size ,  & s - > sample_spec ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( u - > memchunk . memblock ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        r  + =  pa_bytes_to_usec ( u - > memchunk . length ,  & s - > sample_spec ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  r ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-11 01:17:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  pa__init ( pa_core  * c ,  pa_module * m )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    pa_modargs  * ma  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    int  ret  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    struct  userdata  * u  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  char  * dev ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-11 01:17:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    pa_sample_spec  ss ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-11-20 22:17:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    uint32_t  periods ,  fragsize ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    snd_pcm_uframes_t  period_size ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 14:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    size_t  frame_size ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-16 01:15:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    int  err ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-20 01:07:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! ( ma  =  pa_modargs_new ( m - > argument ,  valid_modargs ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-05 00:03:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        pa_log ( __FILE__ " : failed to parse module arguments \n " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        goto  fail ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 14:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ss  =  c - > default_sample_spec ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( pa_modargs_get_sample_spec ( ma ,  & ss )  <  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-05 00:03:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        pa_log ( __FILE__ " : failed to parse sample specification \n " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 14:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        goto  fail ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2004-08-03 19:26:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    frame_size  =  pa_frame_size ( & ss ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 14:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2005-09-15 23:50:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    periods  =  8 ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 14:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    fragsize  =  1024 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( pa_modargs_get_value_u32 ( ma ,  " fragments " ,  & periods )  <  0  | |  pa_modargs_get_value_u32 ( ma ,  " fragment_size " ,  & fragsize )  <  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-05 00:03:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        pa_log ( __FILE__ " : failed to parse buffer metrics \n " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 14:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        goto  fail ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2004-11-20 22:17:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    period_size  =  fragsize ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2004-08-04 16:39:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    u  =  pa_xmalloc0 ( sizeof ( struct  userdata ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    m - > userdata  =  u ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-08-04 16:39:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    u - > module  =  m ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2005-09-16 00:11:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    snd_config_update_free_global ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-16 01:15:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ( err  =  snd_pcm_open ( & u - > pcm_handle ,  dev  =  pa_modargs_get_value ( ma ,  " device " ,  DEFAULT_DEVICE ) ,  SND_PCM_STREAM_PLAYBACK ,  SND_PCM_NONBLOCK ) )  <  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        pa_log ( __FILE__ " : Error opening PCM device %s: %s \n " ,  dev ,  snd_strerror ( err ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        goto  fail ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-02-16 01:15:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ( err  =  pa_alsa_set_hw_params ( u - > pcm_handle ,  & ss ,  & periods ,  & period_size ) )  <  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        pa_log ( __FILE__ " : Failed to set hardware parameters: %s \n " ,  snd_strerror ( err ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        goto  fail ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-27 16:25:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    u - > sink  =  pa_sink_new ( c ,  __FILE__ ,  pa_modargs_get_value ( ma ,  " sink_name " ,  DEFAULT_SINK_NAME ) ,  0 ,  & ss ,  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    assert ( u - > sink ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    u - > sink - > get_latency  =  sink_get_latency_cb ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    u - > sink - > userdata  =  u ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    pa_sink_set_owner ( u - > sink ,  m ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    u - > sink - > description  =  pa_sprintf_malloc ( " Advanced Linux Sound Architecture PCM on '%s' " ,  dev ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-08-05 19:53:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( pa_create_io_events ( u - > pcm_handle ,  c - > mainloop ,  & u - > io_events ,  & u - > n_io_events ,  io_callback ,  u )  <  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-05 00:03:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        pa_log ( __FILE__ " : failed to obtain file descriptors \n " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        goto  fail ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 14:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    u - > frame_size  =  frame_size ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-11-20 22:17:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    u - > fragment_size  =  period_size ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-27 16:25:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    pa_log_info ( __FILE__ " : using %u fragments of size %u bytes. \n " ,  periods ,  u - > fragment_size ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-08-17 19:37:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    u - > silence . memblock  =  pa_memblock_new ( u - > silence . length  =  u - > fragment_size ,  c - > memblock_stat ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    assert ( u - > silence . memblock ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    pa_silence_memblock ( u - > silence . memblock ,  & ss ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    u - > silence . index  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    u - > memchunk . memblock  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    u - > memchunk . index  =  u - > memchunk . length  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ret  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								finish : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     if  ( ma ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								         pa_modargs_free ( ma ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  ret ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								fail : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( u ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-11 23:17:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        pa__done ( c ,  m ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    goto  finish ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-11 01:17:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  pa__done ( pa_core  * c ,  pa_module * m )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    struct  userdata  * u ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    assert ( c  & &  m ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-08-04 16:39:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! ( u  =  m - > userdata ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2004-09-14 20:53:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( u - > sink )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        pa_sink_disconnect ( u - > sink ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        pa_sink_unref ( u - > sink ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2004-08-04 16:39:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2004-08-05 19:53:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( u - > io_events ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        pa_free_io_events ( c - > mainloop ,  u - > io_events ,  u - > n_io_events ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-08-04 16:39:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( u - > pcm_handle )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        snd_pcm_drop ( u - > pcm_handle ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        snd_pcm_close ( u - > pcm_handle ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2004-08-04 16:39:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( u - > memchunk . memblock ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        pa_memblock_unref ( u - > memchunk . memblock ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( u - > silence . memblock ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        pa_memblock_unref ( u - > silence . memblock ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    pa_xfree ( u ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-16 00:27:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								}