mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: improve debug
This commit is contained in:
		
							parent
							
								
									09d373f094
								
							
						
					
					
						commit
						4d085816ef
					
				
					 1 changed files with 12 additions and 5 deletions
				
			
		| 
						 | 
					@ -1335,11 +1335,13 @@ do_process_done(struct spa_loop *loop,
 | 
				
			||||||
		if (avail <= 0) {
 | 
							if (avail <= 0) {
 | 
				
			||||||
			/* underrun, can't really happen but if it does we
 | 
								/* underrun, can't really happen but if it does we
 | 
				
			||||||
			 * do nothing and wait for more data */
 | 
								 * do nothing and wait for more data */
 | 
				
			||||||
			pw_log_warn(NAME" %p: [%s] underrun", stream, client->name);
 | 
								pw_log_warn(NAME" %p: [%s] underrun read:%u avail:%d",
 | 
				
			||||||
 | 
										stream, client->name, index, avail);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			if (avail > (int32_t)stream->attr.maxlength) {
 | 
								if (avail > (int32_t)stream->attr.maxlength) {
 | 
				
			||||||
				/* overrun, catch up to latest fragment and send it */
 | 
									/* overrun, catch up to latest fragment and send it */
 | 
				
			||||||
				pw_log_warn(NAME" %p: [%s] overrun", stream, client->name);
 | 
									pw_log_warn(NAME" %p: [%s] overrun read:%u avail:%d max:%u",
 | 
				
			||||||
 | 
										stream, client->name, index, avail, stream->attr.maxlength);
 | 
				
			||||||
				avail = stream->attr.fragsize;
 | 
									avail = stream->attr.fragsize;
 | 
				
			||||||
				index = stream->write_index - avail;
 | 
									index = stream->write_index - avail;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -1404,7 +1406,9 @@ static void stream_process(void *data)
 | 
				
			||||||
			if (avail > (int32_t)stream->attr.maxlength) {
 | 
								if (avail > (int32_t)stream->attr.maxlength) {
 | 
				
			||||||
				/* overrun, reported by other side, here we skip
 | 
									/* overrun, reported by other side, here we skip
 | 
				
			||||||
				 * ahead to the oldest data. */
 | 
									 * ahead to the oldest data. */
 | 
				
			||||||
				pw_log_warn(NAME" %p: [%s] overrun", stream, client->name);
 | 
									pw_log_warn(NAME" %p: [%s] overrun read:%u avail:%d max:%u",
 | 
				
			||||||
 | 
											stream, client->name, pd.read_index, avail,
 | 
				
			||||||
 | 
											stream->attr.maxlength);
 | 
				
			||||||
				pd.read_index += avail - stream->attr.maxlength;
 | 
									pd.read_index += avail - stream->attr.maxlength;
 | 
				
			||||||
				avail = stream->attr.maxlength;
 | 
									avail = stream->attr.maxlength;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -1431,12 +1435,15 @@ static void stream_process(void *data)
 | 
				
			||||||
		if (filled < 0) {
 | 
							if (filled < 0) {
 | 
				
			||||||
			/* underrun, can't really happen because we never read more
 | 
								/* underrun, can't really happen because we never read more
 | 
				
			||||||
			 * than what's available on the other side  */
 | 
								 * than what's available on the other side  */
 | 
				
			||||||
			pw_log_warn(NAME" %p: [%s] underrun", stream, client->name);
 | 
								pw_log_warn(NAME" %p: [%s] underrun write:%u filled:%d",
 | 
				
			||||||
 | 
										stream, client->name, pd.write_index, filled);
 | 
				
			||||||
		} else if ((uint32_t)filled + size > stream->attr.maxlength) {
 | 
							} else if ((uint32_t)filled + size > stream->attr.maxlength) {
 | 
				
			||||||
			/* overrun, can happen when the other side is not
 | 
								/* overrun, can happen when the other side is not
 | 
				
			||||||
			 * reading fast enough. We still write our data into the
 | 
								 * reading fast enough. We still write our data into the
 | 
				
			||||||
			 * ringbuffer and expect the other side to catch up. */
 | 
								 * ringbuffer and expect the other side to catch up. */
 | 
				
			||||||
			pw_log_warn(NAME" %p: [%s] overrun", stream, client->name);
 | 
								pw_log_warn(NAME" %p: [%s] overrun write:%u filled:%d size:%u max:%u",
 | 
				
			||||||
 | 
										stream, client->name, pd.write_index, filled,
 | 
				
			||||||
 | 
										size, stream->attr.maxlength);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		spa_ringbuffer_write_data(&stream->ring,
 | 
							spa_ringbuffer_write_data(&stream->ring,
 | 
				
			||||||
				stream->buffer, stream->attr.maxlength,
 | 
									stream->buffer, stream->attr.maxlength,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue