Skip to contentSkip to conversation

xine with dmix

DISCUSSION Michel Dänzer 5 participants 11 messages Jan 20, 2004 – Jan 21, 2004

lore
Share & tools
lore
#0 lore raw

I'm basically very happy with http://penguinppc.org/~daenzer/asound.conf
and alsa-oss, kudos to all ALSA developers who made this possible.

The only problem I'm having is that xine doesn't work well. Do you agree with the analysis in
http://sourceforge.net/mailarchive/message.php?msg_id=6793623 ? Can snd_pcm_delay() be changed to behave as expected by xine? If so, I can look into it, but I'd need some pointers.

Signature · 10 lines
Earthling Michel Dänzer      |     Debian (powerpc), X and DRI developer
Libre software enthusiast    |   http://svcs.affero.net/rm.php?r=daenzer



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
#1 lore raw
Quoted 9 lines · Michel Dänzer

I'm basically very happy with http://penguinppc.org/~daenzer/asound.conf
and alsa-oss, kudos to all ALSA developers who made this possible.

The only problem I'm having is that xine doesn't work well. Do you agree with the analysis in
http://sourceforge.net/mailarchive/message.php?msg_id=6793623 ? Can snd_pcm_delay() be changed to behave as expected by xine? If so, I can look into it, but I'd need some pointers.

Could you try the attached patch? If you add a line 'slowptr yes' to your dmix pcm definition, the snd_pcm_delay() function should be more precise.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

? a
? out.txt
? pcm.c.engine
Index: pcm_direct.h
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_direct.h,v retrieving revision 1.6

pcm_direct.h +1 -0
diff -u -r1.6 pcm_direct.h
@@ -99,6 +99,7 @@
 	pid_t server_pid;
 	snd_timer_t *timer; 		/* timer used as poll_fd */
 	int interleaved;	 	/* we have interleaved buffer */
+	int slowptr;			/* use slow but more precise ptr updates */
 	unsigned int channels;		/* client's channels */
 	unsigned int *bindings;
 	union {

Index: pcm_dmix.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_dmix.c,v retrieving revision 1.46

pcm_dmix.c +24 -2
diff -u -r1.46 pcm_dmix.c
@@ -394,6 +394,8 @@
 	default:
 		break;
 	}
+	if (dmix->slowptr)
+		snd_pcm_hwsync(dmix->spcm);
 	old_slave_hw_ptr = dmix->slave_hw_ptr;
 	slave_hw_ptr = dmix->slave_hw_ptr = *dmix->spcm->hw.ptr;
 	diff = slave_hw_ptr - old_slave_hw_ptr;
@@ -759,6 +761,8 @@
  * \param ipc_key IPC key for semaphore and shared memory
  * \param ipc_perm IPC permissions for semaphore and shared memory
  * \param params Parameters for slave
+ * \param bindings Channel bindings
+ * \param slowptr Slow but more precise pointer updates
  * \param root Configuration root
  * \param sconf Slave configuration
  * \param stream PCM Direction (stream)
@@ -772,6 +776,7 @@
 		      key_t ipc_key, mode_t ipc_perm,
 		      struct slave_params *params,
 		      snd_config_t *bindings,
+		      int slowptr,
 		      snd_config_t *root, snd_config_t *sconf,
 		      snd_pcm_stream_t stream, int mode)
 {
@@ -833,6 +838,7 @@
 	pcm->fast_ops = &snd_pcm_dmix_fast_ops;
 	pcm->private_data = dmix;
 	dmix->state = SND_PCM_STATE_OPEN;
+	dmix->slowptr = slowptr;
 
 	if (first_instance) {
 		ret = snd_pcm_open_slave(&spcm, root, sconf, stream, mode);
@@ -1082,7 +1088,7 @@
 	snd_config_iterator_t i, next;
 	snd_config_t *slave = NULL, *bindings = NULL, *sconf;
 	struct slave_params params;
-	int bsize, psize, ipc_key_add_uid = 0;
+	int bsize, psize, ipc_key_add_uid = 0, slowptr = 0;
 	key_t ipc_key = 0;
 	mode_t ipc_perm = 0600;
 	int err;
@@ -1142,6 +1148,22 @@
 			bindings = n;
 			continue;
 		}
+		if (strcmp(id, "slowptr") == 0) {
+			char *tmp;
+			err = snd_config_get_ascii(n, &tmp);
+			if (err < 0) {
+				SNDERR("The field slowptr must be a boolean type");
+				return err;
+			}
+			err = snd_config_get_bool_ascii(tmp);
+			free(tmp);
+			if (err < 0) {
+				SNDERR("The field slowptr must be a boolean type");
+				return err;
+			}
+			slowptr = err;
+			continue;
+		}
 		SNDERR("Unknown field %s", id);
 		return -EINVAL;
 	}
@@ -1179,7 +1201,7 @@
 	params.period_size = psize;
 	params.buffer_size = bsize;
 
-	err = snd_pcm_dmix_open(pcmp, name, ipc_key, ipc_perm, &params, bindings, root, sconf, stream, mode);
+	err = snd_pcm_dmix_open(pcmp, name, ipc_key, ipc_perm, &params, bindings, slowptr, root, sconf, stream, mode);
 	if (err < 0)
 		snd_config_delete(sconf);
 	return err;

Index: pcm_dshare.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_dshare.c,v retrieving revision 1.12

pcm_dshare.c +24 -2
diff -u -r1.12 pcm_dshare.c
@@ -141,6 +141,8 @@
 	default:
 		break;
 	}
+	if (dshare->slowptr)
+		snd_pcm_hwsync(dshare->spcm);
 	old_slave_hw_ptr = dshare->slave_hw_ptr;
 	slave_hw_ptr = dshare->slave_hw_ptr = *dshare->spcm->hw.ptr;
 	diff = slave_hw_ptr - old_slave_hw_ptr;
@@ -509,6 +511,8 @@
  * \param ipc_key IPC key for semaphore and shared memory
  * \param ipc_mode IPC permissions for semaphore and shared memory
  * \param params Parameters for slave
+ * \param bindings Channel bindings
+ * \param slowptr Slow but more precise pointer updates
  * \param root Configuration root
  * \param sconf Slave configuration
  * \param stream PCM Direction (stream)
@@ -522,6 +526,7 @@
 			key_t ipc_key, mode_t ipc_perm,
 			struct slave_params *params,
 			snd_config_t *bindings,
+			int slowptr,
 			snd_config_t *root, snd_config_t *sconf,
 			snd_pcm_stream_t stream, int mode)
 {
@@ -590,6 +595,7 @@
 	pcm->fast_ops = &snd_pcm_dshare_fast_ops;
 	pcm->private_data = dshare;
 	dshare->state = SND_PCM_STATE_OPEN;
+	dshare->slowptr = slowptr;
 
 	if (first_instance) {
 		ret = snd_pcm_open_slave(&spcm, root, sconf, stream, mode);
@@ -771,7 +777,7 @@
 	snd_config_iterator_t i, next;
 	snd_config_t *slave = NULL, *bindings = NULL, *sconf;
 	struct slave_params params;
-	int bsize, psize, ipc_key_add_uid = 0;
+	int bsize, psize, ipc_key_add_uid = 0, slowptr = 0;
 	key_t ipc_key = 0;
 	mode_t ipc_perm = 0600;
 	
@@ -832,6 +838,22 @@
 			bindings = n;
 			continue;
 		}
+		if (strcmp(id, "slowptr") == 0) {
+			char *tmp;
+			err = snd_config_get_ascii(n, &tmp);
+			if (err < 0) {
+				SNDERR("The field slowptr must be a boolean type");
+				return err;
+			}
+			err = snd_config_get_bool_ascii(tmp);
+			free(tmp);
+			if (err < 0) {
+				SNDERR("The field slowptr must be a boolean type");
+				return err;
+			}
+			slowptr = err;
+			continue;
+		}
 		SNDERR("Unknown field %s", id);
 		return -EINVAL;
 	}
@@ -867,7 +889,7 @@
 
 	params.period_size = psize;
 	params.buffer_size = bsize;
-	err = snd_pcm_dshare_open(pcmp, name, ipc_key, ipc_perm, &params, bindings, root, sconf, stream, mode);
+	err = snd_pcm_dshare_open(pcmp, name, ipc_key, ipc_perm, &params, bindings, slowptr, root, sconf, stream, mode);
 	if (err < 0)
 		snd_config_delete(sconf);
 	return err;

Index: pcm_dsnoop.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_dsnoop.c,v retrieving revision 1.12

pcm_dsnoop.c +24 -2
diff -u -r1.12 pcm_dsnoop.c
@@ -123,6 +123,8 @@
 	default:
 		break;
 	}
+	if (dsnoop->slowptr)
+		snd_pcm_hwsync(dsnoop->spcm);
 	old_slave_hw_ptr = dsnoop->slave_hw_ptr;
 	slave_hw_ptr = dsnoop->slave_hw_ptr = *dsnoop->spcm->hw.ptr;
 	diff = slave_hw_ptr - old_slave_hw_ptr;
@@ -477,6 +479,8 @@
  * \param ipc_key IPC key for semaphore and shared memory
  * \param ipc_perm IPC permissions for semaphore and shared memory
  * \param params Parameters for slave
+ * \param bindings Channel bindings
+ * \param slowptr Slow but more precise pointer updates
  * \param root Configuration root
  * \param sconf Slave configuration
  * \param stream PCM Direction (stream)
@@ -490,6 +494,7 @@
 			key_t ipc_key, mode_t ipc_perm,
 			struct slave_params *params,
 			snd_config_t *bindings,
+			int slowptr,
 			snd_config_t *root, snd_config_t *sconf,
 			snd_pcm_stream_t stream, int mode)
 {
@@ -550,6 +555,7 @@
 	pcm->fast_ops = &snd_pcm_dsnoop_fast_ops;
 	pcm->private_data = dsnoop;
 	dsnoop->state = SND_PCM_STATE_OPEN;
+	dsnoop->slowptr = slowptr;
 
 	if (first_instance) {
 		ret = snd_pcm_open_slave(&spcm, root, sconf, stream, mode);
@@ -721,7 +727,7 @@
 	snd_config_iterator_t i, next;
 	snd_config_t *slave = NULL, *bindings = NULL, *sconf;
 	struct slave_params params;
-	int bsize, psize, ipc_key_add_uid = 0;
+	int bsize, psize, ipc_key_add_uid = 0, slowptr = 0;
 	key_t ipc_key = 0;
 	mode_t ipc_perm = 0600;
 	int err;
@@ -782,6 +788,22 @@
 			bindings = n;
 			continue;
 		}
+		if (strcmp(id, "slowptr") == 0) {
+			char *tmp;
+			err = snd_config_get_ascii(n, &tmp);
+			if (err < 0) {
+				SNDERR("The field slowptr must be a boolean type");
+				return err;
+			}
+			err = snd_config_get_bool_ascii(tmp);
+			free(tmp);
+			if (err < 0) {
+				SNDERR("The field slowptr must be a boolean type");
+				return err;
+			}
+			slowptr = err;
+			continue;
+		}
 		SNDERR("Unknown field %s", id);
 		return -EINVAL;
 	}
@@ -825,7 +847,7 @@
 
 	params.period_size = psize;
 	params.buffer_size = bsize;
-	err = snd_pcm_dsnoop_open(pcmp, name, ipc_key, ipc_perm, &params, bindings, root, sconf, stream, mode);
+	err = snd_pcm_dsnoop_open(pcmp, name, ipc_key, ipc_perm, &params, bindings, slowptr, root, sconf, stream, mode);
 	if (err < 0)
 		snd_config_delete(sconf);
 	return err;
#2 lore raw
Quoted 5 lines · Jaroslav Kysela
Quoted 3 lines · Michel Dänzer

I'm basically very happy with http://penguinppc.org/~daenzer/asound.conf
and alsa-oss, kudos to all ALSA developers who made this possible.

Quoted 8 lines
Quoted 5 lines

The only problem I'm having is that xine doesn't work well. Do you agree with the analysis in
http://sourceforge.net/mailarchive/message.php?msg_id=6793623 ? Can snd_pcm_delay() be changed to behave as expected by xine? If so, I can look into it, but I'd need some pointers.

Could you try the attached patch? If you add a line 'slowptr yes' to your dmix pcm definition, the snd_pcm_delay() function should be more precise.

It seems to work perfectly, thank you very much!

Signature · 10 lines
Earthling Michel Dänzer      |     Debian (powerpc), X and DRI developer
Libre software enthusiast    |   http://svcs.affero.net/rm.php?r=daenzer



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
#3 lore raw
Quoted 12 lines · Michel Dänzer
Quoted 11 lines · Jaroslav Kysela
Quoted 8 lines · Michel Dänzer

I'm basically very happy with http://penguinppc.org/~daenzer/asound.conf
and alsa-oss, kudos to all ALSA developers who made this possible.

The only problem I'm having is that xine doesn't work well. Do you agree with the analysis in
http://sourceforge.net/mailarchive/message.php?msg_id=6793623 ? Can snd_pcm_delay() be changed to behave as expected by xine? If so, I can look into it, but I'd need some pointers.

Quoted 4 lines
Quoted 2 lines

Could you try the attached patch? If you add a line 'slowptr yes' to your dmix pcm definition, the snd_pcm_delay() function should be more precise.

It seems to work perfectly, thank you very much!

Nice. The code is already in CVS, so it will be in 1.0.2.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

#4 lore raw

At Tue, 20 Jan 2004 17:07:02 +0100 (CET),

Quoted 15 lines · Jaroslav
Quoted 12 lines · Michel Dänzer
Quoted 11 lines · Jaroslav Kysela
Quoted 8 lines · Michel Dänzer

I'm basically very happy with http://penguinppc.org/~daenzer/asound.conf
and alsa-oss, kudos to all ALSA developers who made this possible.

The only problem I'm having is that xine doesn't work well. Do you agree with the analysis in
http://sourceforge.net/mailarchive/message.php?msg_id=6793623 ? Can snd_pcm_delay() be changed to behave as expected by xine? If so, I can look into it, but I'd need some pointers.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Could you try the attached patch? If you add a line 'slowptr yes' to your dmix pcm definition, the snd_pcm_delay() function should be more precise.

It seems to work perfectly, thank you very much!

Nice. The code is already in CVS, so it will be in 1.0.2.

isn't it better to be turned on as default?
i don't think the perfomance impact is so big.

Takashi

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

#5 lore raw
In reply to Jaroslav Kysela
Quoted 3 lines · On Tue, 20 Jan 2004 17:07:02 +0100 (CET) Jaroslav Kysela <[email protected]> wrote:
Quoted 1 line

It seems to work perfectly, thank you very much!

Nice. The code is already in CVS, so it will be in 1.0.2.

Great! Thanks, Jaroslav. It's great to see these recent changes around dmix/dsnoop/asym :)

Flo

Signature · 9 lines
http://www.soundclick.com/bands/9/florianschmidt.htm
http://www.arted.biz/mista.tapas


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
#6 lore raw
In reply to Michel Dänzer
Quoted 7 lines · Michel Dänzer
Quoted 4 lines · Jaroslav Kysela

On Tue, 20 Jan 2004, Michel Dänzer wrote:

Could you try the attached patch? If you add a line 'slowptr yes' to your dmix pcm definition, the snd_pcm_delay() function should be more precise.

It seems to work perfectly, thank you very much!

I have to take that back. :(

I had put the slowptr in the wrong place (in the dmixer slave pcm block), and xine silently fell back to using /dev/dsp (alsa-oss doesn't seem to work with it). With the slowptr in the right place, I have now verified that xine uses ALSA with it enabled, but it doesn't seem to enhance sound quality much if at all.

Sorry for the false confirmation. Any other ideas?

Signature · 10 lines
Earthling Michel Dänzer      |     Debian (powerpc), X and DRI developer
Libre software enthusiast    |   http://svcs.affero.net/rm.php?r=daenzer



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
#7 lore raw
Quoted 11 lines · Michel Dänzer
Quoted 7 lines · Michel Dänzer
Quoted 4 lines · Jaroslav Kysela

On Tue, 20 Jan 2004, Michel Dänzer wrote:

Could you try the attached patch? If you add a line 'slowptr yes' to your dmix pcm definition, the snd_pcm_delay() function should be more precise.

It seems to work perfectly, thank you very much!

I have to take that back. :(

Quoted 7 lines

I had put the slowptr in the wrong place (in the dmixer slave pcm block), and xine silently fell back to using /dev/dsp (alsa-oss doesn't seem to work with it). With the slowptr in the right place, I have now verified that xine uses ALSA with it enabled, but it doesn't seem to enhance sound quality much if at all.

Sorry for the false confirmation. Any other ideas?

Yes, I've tested xine with dmix today and I figured after several hours of looking for totaly another problem, that it was 'snd_pcm_wait()' function which causes trouble in conjunction with the xine ALSA code algorithm.

The result patch (attached to this mail and available also in CVS) is that xine works with dmix even without the slowptr option! So there is no reason to make this option as default.

I'm happy that the next direct plugin related bug is solved.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

? a
? out.txt
? pcm.c.engine
Index: pcm_direct.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_direct.c,v retrieving revision 1.11

pcm_direct.c +12 -4
diff -u -r1.11 pcm_direct.c
@@ -410,15 +410,23 @@
 {
 	snd_pcm_direct_t *dmix = pcm->private_data;
 	unsigned short events;
-	static snd_timer_read_t rbuf[5];	/* can be overwriten by multiple plugins, we don't need the value */
+	/* rbuf might be overwriten by multiple plugins */
+	/* we don't need the value */
+	static snd_timer_read_t rbuf[5];
 
 	assert(pfds && nfds == 1 && revents);
 	events = pfds[0].revents;
 	if (events & POLLIN) {
-		events |= POLLOUT;
-		events &= ~POLLIN;
+		int empty = 0;
+		if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
+			events |= POLLOUT;
+			events &= ~POLLIN;
+			empty = snd_pcm_mmap_playback_avail(pcm) < pcm->avail_min;
+		} else {
+			empty = snd_pcm_mmap_capture_avail(pcm) < pcm->avail_min;
+		}
 		/* empty the timer read queue */
-		while (snd_timer_read(dmix->timer, &rbuf, sizeof(rbuf)) == sizeof(rbuf)) ;
+		while (empty && snd_timer_read(dmix->timer, &rbuf, sizeof(rbuf)) == sizeof(rbuf)) ;
 	}
 	*revents = events;
 	return 0;

Index: pcm_dmix.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_dmix.c,v retrieving revision 1.47

pcm_dmix.c +1 -1
diff -u -r1.47 pcm_dmix.c
@@ -407,7 +407,6 @@
 	}
 	dmix->hw_ptr += diff;
 	dmix->hw_ptr %= pcm->boundary;
-	// printf("sync ptr diff = %li\n", diff);
 	if (pcm->stop_threshold >= pcm->boundary)	/* don't care */
 		return 0;
 	if ((avail = snd_pcm_mmap_playback_avail(pcm)) >= pcm->stop_threshold) {
@@ -545,6 +544,7 @@
 	if (err < 0)
 		return err;
 	dmix->state = SND_PCM_STATE_RUNNING;
+	snd_pcm_hwsync(dmix->spcm);
 	dmix->slave_appl_ptr = dmix->slave_hw_ptr = *dmix->spcm->hw.ptr;
 	avail = snd_pcm_mmap_playback_hw_avail(pcm);
 	if (avail < 0)

Index: pcm_dshare.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_dshare.c,v retrieving revision 1.13

pcm_dshare.c +1 -0
diff -u -r1.13 pcm_dshare.c
@@ -292,6 +292,7 @@
 	if (err < 0)
 		return err;
 	dshare->state = SND_PCM_STATE_RUNNING;
+	snd_pcm_hwsync(dshare->spcm);
 	dshare->slave_appl_ptr = dshare->slave_hw_ptr = *dshare->spcm->hw.ptr;
 	avail = snd_pcm_mmap_playback_hw_avail(pcm);
 	if (avail < 0)

Index: pcm_dsnoop.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_dsnoop.c,v retrieving revision 1.13

pcm_dsnoop.c +1 -0
diff -u -r1.13 pcm_dsnoop.c
@@ -274,6 +274,7 @@
 	if (err < 0)
 		return err;
 	dsnoop->state = SND_PCM_STATE_RUNNING;
+	snd_pcm_hwsync(dsnoop->spcm);
 	dsnoop->slave_appl_ptr = dsnoop->slave_hw_ptr = *dsnoop->spcm->hw.ptr;
 	gettimeofday(&tv, 0);
 	dsnoop->trigger_tstamp.tv_sec = tv.tv_sec;
#8 lore raw
Quoted 7 lines · Jaroslav Kysela

[...] I've tested xine with dmix today and I figured after several hours of looking for totaly another problem, that it was 'snd_pcm_wait()' function which causes trouble in conjunction with the xine ALSA code algorithm.

The result patch (attached to this mail and available also in CVS) is that xine works with dmix even without the slowptr option!

Indeed, great work! Thanks again, you rock.

Signature · 10 lines
Earthling Michel Dänzer      |     Debian (powerpc), X and DRI developer
Libre software enthusiast    |   http://svcs.affero.net/rm.php?r=daenzer



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
#9 lore raw
In reply to Jaroslav Kysela
Quoted 29 lines · Jaroslav Kysela
Quoted 12 lines · Michel Dänzer
Quoted 7 lines · Michel Dänzer
Quoted 3 lines · Jaroslav Kysela

On Tue, 20 Jan 2004, Michel Dänzer wrote:

Could you try the attached patch? If you add a line 'slowptr yes' to your dmix pcm definition, the snd_pcm_delay() function should be more precise.

It seems to work perfectly, thank you very much!

I have to take that back. :(

Quoted 7 lines

I had put the slowptr in the wrong place (in the dmixer slave pcm block), and xine silently fell back to using /dev/dsp (alsa-oss doesn't seem to work with it). With the slowptr in the right place, I have now verified that xine uses ALSA with it enabled, but it doesn't seem to enhance sound quality much if at all.

Sorry for the false confirmation. Any other ideas?

Yes, I've tested xine with dmix today and I figured after several hours of looking for totaly another problem, that it was 'snd_pcm_wait()' function which causes trouble in conjunction with the xine ALSA code algorithm.

The result patch (attached to this mail and available also in CVS) is that
xine works with dmix even without the slowptr option! So there is no reason to make this option as default.

Quoted 10 lines

I'm happy that the next direct plugin related bug is solved.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

Thank you very much for your efforts to help xine work with alsa.

So, the problem was a bug in alsa?
As you have obviously looked very hard now at the xine code, would you have any recommendations for any changes?

Cheers
James

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

#10 lore raw
In reply to Jaroslav Kysela
Quoted 24 lines · Jaroslav Kysela
Quoted 12 lines · Michel Dänzer
Quoted 7 lines · Michel Dänzer
Quoted 3 lines · Jaroslav Kysela

On Tue, 20 Jan 2004, Michel Dänzer wrote:

Could you try the attached patch? If you add a line 'slowptr yes' to your dmix pcm definition, the snd_pcm_delay() function should be more precise.

It seems to work perfectly, thank you very much!

I have to take that back. :(

Quoted 7 lines

I had put the slowptr in the wrong place (in the dmixer slave pcm block), and xine silently fell back to using /dev/dsp (alsa-oss doesn't seem to work with it). With the slowptr in the right place, I have now verified that xine uses ALSA with it enabled, but it doesn't seem to enhance sound quality much if at all.

Sorry for the false confirmation. Any other ideas?

Quoted 9 lines

Yes, I've tested xine with dmix today and I figured after several hours of looking for totaly another problem, that it was 'snd_pcm_wait()' function which causes trouble in conjunction with the xine ALSA code algorithm.

The result patch (attached to this mail and available also in CVS) is that
xine works with dmix even without the slowptr option! So there is no reason to make this option as default.

I'm happy that the next direct plugin related bug is solved.

Jaroslav

I have tried both your patches, but neither of them fix the problem or jerky output. Sound for a short burst, short pause, sound for a short burst, short pause etc.

Cheers
James

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn