mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	jack: add option to disable process lock
Some applications might expect the process function to run concurrently with the callbacks. PipeWire tries to avoid this by using a lock for the duration of the process callback. Make an option to disable this. See #1576
This commit is contained in:
		
							parent
							
								
									2071a14c82
								
							
						
					
					
						commit
						e4b030fafa
					
				
					 2 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -387,6 +387,7 @@ struct client {
 | 
			
		|||
	unsigned int short_name:1;
 | 
			
		||||
	unsigned int filter_name:1;
 | 
			
		||||
	unsigned int freewheeling:1;
 | 
			
		||||
	unsigned int locked_process:1;
 | 
			
		||||
	int self_connect_mode;
 | 
			
		||||
	int rt_max;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -739,8 +740,10 @@ void jack_get_version(int *major_ptr, int *minor_ptr, int *micro_ptr, int *proto
 | 
			
		|||
({								\
 | 
			
		||||
	if (c->callback && c->active) {				\
 | 
			
		||||
		pw_thread_loop_unlock(c->context.loop);		\
 | 
			
		||||
		if (c->locked_process)				\
 | 
			
		||||
			pthread_mutex_lock(&c->rt_lock);	\
 | 
			
		||||
		c->callback(__VA_ARGS__);			\
 | 
			
		||||
		if (c->locked_process)				\
 | 
			
		||||
			pthread_mutex_unlock(&c->rt_lock);	\
 | 
			
		||||
		pw_thread_loop_lock(c->context.loop);		\
 | 
			
		||||
	}							\
 | 
			
		||||
| 
						 | 
				
			
			@ -2972,6 +2975,9 @@ jack_client_t * jack_client_open (const char *client_name,
 | 
			
		|||
	if ((str = pw_properties_get(client->props, "jack.filter-name")) != NULL)
 | 
			
		||||
		client->filter_name = pw_properties_parse_bool(str);
 | 
			
		||||
 | 
			
		||||
	str = pw_properties_get(client->props, "jack.locked-process");
 | 
			
		||||
	client->locked_process = str ? pw_properties_parse_bool(str) : true;
 | 
			
		||||
 | 
			
		||||
	client->self_connect_mode = SELF_CONNECT_ALLOW;
 | 
			
		||||
	if ((str = pw_properties_get(client->props, "jack.self-connect-mode")) != NULL) {
 | 
			
		||||
		if (spa_streq(str, "fail-external"))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,6 +59,7 @@ context.modules = [
 | 
			
		|||
# global properties for all jack clients
 | 
			
		||||
jack.properties = {
 | 
			
		||||
     #node.latency = 1024/48000
 | 
			
		||||
     #node.lock-quantum   = false
 | 
			
		||||
     #jack.merge-monitor  = false
 | 
			
		||||
     #jack.short-name     = false
 | 
			
		||||
     #jack.filter-name    = false
 | 
			
		||||
| 
						 | 
				
			
			@ -69,6 +70,7 @@ jack.properties = {
 | 
			
		|||
     # fail-all:        Fail all self connect requests
 | 
			
		||||
     # ignore-all:      Ignore all self connect requests
 | 
			
		||||
     #jack.self-connect-mode  = allow
 | 
			
		||||
     #jack.locked-process = true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# client specific properties
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue