mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	jack: improve jack-sink and jack-source
Add more properties to sink/source to make them always process and have the right priorities. Make sure the sink has higher priority than the source so that we can pull in samples through the graph. Only trigger the graph cycle when driving the graph. Make sure to return something from process to signal that the graph can continue processing.
This commit is contained in:
		
							parent
							
								
									b9381a9da6
								
							
						
					
					
						commit
						815501cc1f
					
				
					 4 changed files with 42 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -18,6 +18,8 @@ static int jack_process(jack_nframes_t nframes, void *arg)
 | 
			
		|||
 | 
			
		||||
	client->buffer_size = nframes;
 | 
			
		||||
 | 
			
		||||
	spa_log_trace_fp(client->log, "frames %u", nframes);
 | 
			
		||||
 | 
			
		||||
	spa_jack_client_emit_process(client);
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -27,6 +29,8 @@ static void jack_shutdown(void* arg)
 | 
			
		|||
{
 | 
			
		||||
	struct spa_jack_client *client = arg;
 | 
			
		||||
 | 
			
		||||
	spa_log_warn(client->log, "%p", client);
 | 
			
		||||
 | 
			
		||||
	spa_jack_client_emit_shutdown(client);
 | 
			
		||||
 | 
			
		||||
	spa_hook_list_init(&client->listener_list);
 | 
			
		||||
| 
						 | 
				
			
			@ -67,6 +71,8 @@ int spa_jack_client_open(struct spa_jack_client *client,
 | 
			
		|||
 | 
			
		||||
	spa_hook_list_init(&client->listener_list);
 | 
			
		||||
 | 
			
		||||
	spa_log_info(client->log, "%p: %s", client, client_name);
 | 
			
		||||
 | 
			
		||||
	jack_set_process_callback(client->client, jack_process, client);
 | 
			
		||||
	jack_on_shutdown(client->client, jack_shutdown, client);
 | 
			
		||||
	client->frame_rate = jack_get_sample_rate(client->client);
 | 
			
		||||
| 
						 | 
				
			
			@ -81,6 +87,8 @@ int spa_jack_client_close(struct spa_jack_client *client)
 | 
			
		|||
	if (client->client == NULL)
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	spa_log_info(client->log, "%p:", client);
 | 
			
		||||
 | 
			
		||||
	spa_jack_client_emit_destroy(client);
 | 
			
		||||
 | 
			
		||||
	if (jack_client_close(client->client) != 0)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue