mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	media-session: add alsa.reserve property to alsa-monitor
This commit is contained in:
		
							parent
							
								
									640f34d8e2
								
							
						
					
					
						commit
						d624ed26f4
					
				
					 2 changed files with 12 additions and 6 deletions
				
			
		| 
						 | 
					@ -6,6 +6,9 @@ properties = {
 | 
				
			||||||
    # not used by the session manager, in order to be able to
 | 
					    # not used by the session manager, in order to be able to
 | 
				
			||||||
    # connect to the real JACK server.
 | 
					    # connect to the real JACK server.
 | 
				
			||||||
    #alsa.jack-device = false
 | 
					    #alsa.jack-device = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Reserve devices.
 | 
				
			||||||
 | 
					    #alsa.reserve = true
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rules = [
 | 
					rules = [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1026,12 +1026,15 @@ int sm_alsa_monitor_start(struct sm_media_session *session)
 | 
				
			||||||
	if ((str = pw_properties_get(impl->conf, "properties")) != NULL)
 | 
						if ((str = pw_properties_get(impl->conf, "properties")) != NULL)
 | 
				
			||||||
		pw_properties_update_string(impl->props, str, strlen(str));
 | 
							pw_properties_update_string(impl->props, str, strlen(str));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (session->dbus_connection)
 | 
						if ((str = pw_properties_get(impl->props, "alsa.reserve")) == NULL ||
 | 
				
			||||||
		impl->conn = spa_dbus_connection_get(session->dbus_connection);
 | 
						    pw_properties_parse_bool(str)) {
 | 
				
			||||||
	if (impl->conn == NULL)
 | 
							if (session->dbus_connection)
 | 
				
			||||||
		pw_log_warn("no dbus connection, device reservation disabled");
 | 
								impl->conn = spa_dbus_connection_get(session->dbus_connection);
 | 
				
			||||||
	else
 | 
							if (impl->conn == NULL)
 | 
				
			||||||
		pw_log_debug("got dbus connection %p", impl->conn);
 | 
								pw_log_warn("no dbus connection, device reservation disabled");
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								pw_log_debug("got dbus connection %p", impl->conn);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	impl->handle = pw_context_load_spa_handle(context, SPA_NAME_API_ALSA_ENUM_UDEV, NULL);
 | 
						impl->handle = pw_context_load_spa_handle(context, SPA_NAME_API_ALSA_ENUM_UDEV, NULL);
 | 
				
			||||||
	if (impl->handle == NULL) {
 | 
						if (impl->handle == NULL) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue