[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/arts/flow
From:       Allan Sandfeld Jensen <kde () carewolf ! com>
Date:       2005-06-07 15:49:05
Message-ID: 1118159345.227077.17312.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 423126 by carewolf:

Only start the channel when needed, removes the broken pipipe error


 M  +10 -7     audioioalsa9.cc  


--- trunk/KDE/arts/flow/audioioalsa9.cc #423125:423126
@@ -218,14 +218,11 @@
             return false;
 	}
 
-  	/* start recording */
+	/* start recording */
 	if (_direction & directionRead)
 		snd_pcm_start(m_pcm_capture);
-  	/* enable playing (needed for dmix) */
-	if (_direction & directionWrite)
-		snd_pcm_start(m_pcm_playback);
 
-  	return true;
+	return true;
 }
 
 void AudioIOALSA::close()
@@ -369,7 +366,8 @@
 	artsdebug("xrun!!\n");
 	if ((err = snd_pcm_prepare(pcm)) < 0)
 		return err;
-	snd_pcm_start(pcm); // ignore error here..
+	if (pcm == m_pcm_capture)
+		snd_pcm_start(pcm); // ignore error here..
 	return 0;
 }
 
@@ -383,7 +381,8 @@
 	if (err < 0) {
 		if ((err = snd_pcm_prepare(pcm)) < 0)
 			return err;
-		snd_pcm_start(pcm); // ignore error here..
+		if (pcm == m_pcm_capture)
+			snd_pcm_start(pcm); // ignore error here..
 	}
 	return 0;
 }
@@ -429,6 +428,10 @@
 		}
 	}
 
+	// Start the sink if it needs it
+	if (snd_pcm_state( m_pcm_playback ) == SND_PCM_STATE_PREPARED)
+		snd_pcm_start(m_pcm_playback);
+
 	if (length == frames) // Sometimes the fragments are "odd" in alsa
 		return size;
 	else
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic