Skip to contentSkip to conversation

sparc dbri: info->offset is now zeroed

PATCH In review Krzysztof Helt 2 participants 2 messages Aug 24, 2006 – Aug 25, 2006 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc dbri: info->offset is now zeroed

From: Krzysztof Helt ([email protected])

This patch fixes two issues:
1. The info->offset is not zeroed when new stream is prepared to be played or recorded.
2. Incorrect modulo value used in pointer function (pointed out by Takashi Iwai).

---

----------------------------------------------------
Nic nie musisz zamawiać, nic nie musisz kupować!
Po prostu odszukaj obrazek i wygraj nagrody:
http://klik.wp.pl/?adr=www.pasaz.wp.pl%2Fkonkurs.html&sid=853

sound/sparc/dbri.c renamed from alsa-kernel/sparc/dbri.c +4 -3
@@ -628,7 +628,7 @@ to send them to the DBRI.
 
 */
 
-#define MAXLOOPS 10
+#define MAXLOOPS 20
 /*
  * Wait for the current command string to execute
  */
@@ -2110,12 +2118,13 @@ static int snd_dbri_prepare(struct snd_p
 	 */
 	ret = setup_descs(dbri, DBRI_STREAMNO(substream),
 			  snd_pcm_lib_period_bytes(substream));
+	info->offset = 0;
 
 	runtime->stop_threshold = DBRI_TD_MAXCNT / runtime->channels;
 
 	spin_unlock_irq(&dbri->lock);
 
-	dprintk(D_USR, "prepare audio output. %d bytes\n", info->size);
+	dprintk(D_USR, "prepare audio output. pipe %d, %d bytes\n", info->pipe, info->size);
 	return ret;
 }
 
@@ -2150,7 +2159,7 @@ static snd_pcm_uframes_t snd_dbri_pointe
 	snd_pcm_uframes_t ret;
 
 	ret = bytes_to_frames(substream->runtime, info->offset)
-		% (substream->runtime->buffer_size + 1);
+		% substream->runtime->buffer_size;
 	dprintk(D_USR, "I/O pointer: %ld frames of %ld.\n",
 		ret, substream->runtime->buffer_size);
 	return ret;

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#1 lore raw

At Thu, 24 Aug 2006 20:55:38 +0200,

Quoted 8 lines · Krzysztof Helt

From: Krzysztof Helt ([email protected])

This patch fixes two issues:
1. The info->offset is not zeroed when new stream is prepared to be played or recorded.
2. Incorrect modulo value used in pointer function (pointed out by Takashi Iwai).

I didn't apply patch11 and patch12 yet, so please recreate patches based on the latest ALSA HG version. (The fix for missing braces is also not necessary since I fixed it by myself.)

Thanks,

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642