* xine with dmix
@ 2004-01-20 14:09 Michel Dänzer
2004-01-20 15:29 ` Jaroslav Kysela
0 siblings, 1 reply; 11+ messages in thread
From: Michel Dänzer @ 2004-01-20 14:09 UTC (permalink / raw)
To: alsa-devel
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.
--
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-20 14:09 xine with dmix Michel Dänzer
@ 2004-01-20 15:29 ` Jaroslav Kysela
2004-01-20 16:06 ` Michel Dänzer
0 siblings, 1 reply; 11+ messages in thread
From: Jaroslav Kysela @ 2004-01-20 15:29 UTC (permalink / raw)
To: Michel Dänzer; +Cc: alsa-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 756 bytes --]
On Tue, 20 Jan 2004, Michel Dänzer wrote:
>
> 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 <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
[-- Attachment #2: Type: TEXT/plain, Size: 8540 bytes --]
? 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
diff -u -r1.6 pcm_direct.h
--- pcm_direct.h 7 Dec 2003 09:30:47 -0000 1.6
+++ pcm_direct.h 20 Jan 2004 15:29:06 -0000
@@ -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
diff -u -r1.46 pcm_dmix.c
--- pcm_dmix.c 19 Jan 2004 19:48:27 -0000 1.46
+++ pcm_dmix.c 20 Jan 2004 15:29:07 -0000
@@ -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, ¶ms, bindings, root, sconf, stream, mode);
+ err = snd_pcm_dmix_open(pcmp, name, ipc_key, ipc_perm, ¶ms, 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
diff -u -r1.12 pcm_dshare.c
--- pcm_dshare.c 19 Jan 2004 19:48:28 -0000 1.12
+++ pcm_dshare.c 20 Jan 2004 15:29:07 -0000
@@ -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, ¶ms, bindings, root, sconf, stream, mode);
+ err = snd_pcm_dshare_open(pcmp, name, ipc_key, ipc_perm, ¶ms, 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
diff -u -r1.12 pcm_dsnoop.c
--- pcm_dsnoop.c 19 Jan 2004 19:48:28 -0000 1.12
+++ pcm_dsnoop.c 20 Jan 2004 15:29:07 -0000
@@ -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, ¶ms, bindings, root, sconf, stream, mode);
+ err = snd_pcm_dsnoop_open(pcmp, name, ipc_key, ipc_perm, ¶ms, bindings, slowptr, root, sconf, stream, mode);
if (err < 0)
snd_config_delete(sconf);
return err;
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-20 15:29 ` Jaroslav Kysela
@ 2004-01-20 16:06 ` Michel Dänzer
2004-01-20 16:07 ` Jaroslav Kysela
2004-01-20 17:39 ` Michel Dänzer
0 siblings, 2 replies; 11+ messages in thread
From: Michel Dänzer @ 2004-01-20 16:06 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: alsa-devel
On Tue, 2004-01-20 at 16:29, Jaroslav Kysela wrote:
> On Tue, 20 Jan 2004, Michel Dänzer wrote:
>
> > 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.
It seems to work perfectly, thank you very much!
--
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-20 16:06 ` Michel Dänzer
@ 2004-01-20 16:07 ` Jaroslav Kysela
2004-01-20 16:29 ` Takashi Iwai
2004-01-20 16:39 ` Florian Schmidt
2004-01-20 17:39 ` Michel Dänzer
1 sibling, 2 replies; 11+ messages in thread
From: Jaroslav Kysela @ 2004-01-20 16:07 UTC (permalink / raw)
To: Michel Dänzer; +Cc: alsa-devel
On Tue, 20 Jan 2004, Michel Dänzer wrote:
> On Tue, 2004-01-20 at 16:29, Jaroslav Kysela wrote:
> > On Tue, 20 Jan 2004, Michel Dänzer wrote:
> >
> > > 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.
>
> 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 <perex@suse.cz>
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-20 16:07 ` Jaroslav Kysela
@ 2004-01-20 16:29 ` Takashi Iwai
2004-01-20 16:39 ` Florian Schmidt
1 sibling, 0 replies; 11+ messages in thread
From: Takashi Iwai @ 2004-01-20 16:29 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: Michel Dänzer, alsa-devel
At Tue, 20 Jan 2004 17:07:02 +0100 (CET),
Jaroslav wrote:
>
> On Tue, 20 Jan 2004, Michel Dänzer wrote:
>
> > On Tue, 2004-01-20 at 16:29, Jaroslav Kysela wrote:
> > > On Tue, 20 Jan 2004, Michel Dänzer wrote:
> > >
> > > > 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.
> >
> > 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-20 16:07 ` Jaroslav Kysela
2004-01-20 16:29 ` Takashi Iwai
@ 2004-01-20 16:39 ` Florian Schmidt
1 sibling, 0 replies; 11+ messages in thread
From: Florian Schmidt @ 2004-01-20 16:39 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: michel, alsa-devel
On Tue, 20 Jan 2004 17:07:02 +0100 (CET)
Jaroslav Kysela <perex@suse.cz> wrote:
> > 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
--
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-20 16:06 ` Michel Dänzer
2004-01-20 16:07 ` Jaroslav Kysela
@ 2004-01-20 17:39 ` Michel Dänzer
2004-01-21 19:19 ` Jaroslav Kysela
1 sibling, 1 reply; 11+ messages in thread
From: Michel Dänzer @ 2004-01-20 17:39 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: alsa-devel
On Tue, 2004-01-20 at 17:06, Michel Dänzer wrote:
> On Tue, 2004-01-20 at 16:29, Jaroslav Kysela wrote:
> > 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?
--
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-20 17:39 ` Michel Dänzer
@ 2004-01-21 19:19 ` Jaroslav Kysela
2004-01-21 21:45 ` Michel Dänzer
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Jaroslav Kysela @ 2004-01-21 19:19 UTC (permalink / raw)
To: Michel Dänzer; +Cc: alsa-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1458 bytes --]
On Tue, 20 Jan 2004, Michel Dänzer wrote:
> On Tue, 2004-01-20 at 17:06, Michel Dänzer wrote:
> > On Tue, 2004-01-20 at 16:29, Jaroslav Kysela wrote:
> > > 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?
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 <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
[-- Attachment #2: Type: TEXT/plain, Size: 3270 bytes --]
? 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
diff -u -r1.11 pcm_direct.c
--- pcm_direct.c 9 Jan 2004 18:32:05 -0000 1.11
+++ pcm_direct.c 21 Jan 2004 19:18:06 -0000
@@ -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
diff -u -r1.47 pcm_dmix.c
--- pcm_dmix.c 20 Jan 2004 15:29:39 -0000 1.47
+++ pcm_dmix.c 21 Jan 2004 19:18:07 -0000
@@ -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
diff -u -r1.13 pcm_dshare.c
--- pcm_dshare.c 20 Jan 2004 15:29:39 -0000 1.13
+++ pcm_dshare.c 21 Jan 2004 19:18:07 -0000
@@ -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
diff -u -r1.13 pcm_dsnoop.c
--- pcm_dsnoop.c 20 Jan 2004 15:29:39 -0000 1.13
+++ pcm_dsnoop.c 21 Jan 2004 19:18:07 -0000
@@ -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;
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-21 19:19 ` Jaroslav Kysela
@ 2004-01-21 21:45 ` Michel Dänzer
2004-01-21 23:15 ` James Courtier-Dutton
2004-01-21 23:41 ` James Courtier-Dutton
2 siblings, 0 replies; 11+ messages in thread
From: Michel Dänzer @ 2004-01-21 21:45 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: alsa-devel
On Wed, 2004-01-21 at 20:19, Jaroslav Kysela wrote:
>
> [...] 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.
--
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-21 19:19 ` Jaroslav Kysela
2004-01-21 21:45 ` Michel Dänzer
@ 2004-01-21 23:15 ` James Courtier-Dutton
2004-01-21 23:41 ` James Courtier-Dutton
2 siblings, 0 replies; 11+ messages in thread
From: James Courtier-Dutton @ 2004-01-21 23:15 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: Michel Dänzer, alsa-devel
Jaroslav Kysela wrote:
> On Tue, 20 Jan 2004, Michel Dänzer wrote:
>
>
>>On Tue, 2004-01-20 at 17:06, Michel Dänzer wrote:
>>
>>>On Tue, 2004-01-20 at 16:29, Jaroslav Kysela wrote:
>>>
>>>>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?
>
>
> 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 <perex@suse.cz>
> 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: xine with dmix
2004-01-21 19:19 ` Jaroslav Kysela
2004-01-21 21:45 ` Michel Dänzer
2004-01-21 23:15 ` James Courtier-Dutton
@ 2004-01-21 23:41 ` James Courtier-Dutton
2 siblings, 0 replies; 11+ messages in thread
From: James Courtier-Dutton @ 2004-01-21 23:41 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: Michel Dänzer, alsa-devel
Jaroslav Kysela wrote:
> On Tue, 20 Jan 2004, Michel Dänzer wrote:
>
>
>>On Tue, 2004-01-20 at 17:06, Michel Dänzer wrote:
>>
>>>On Tue, 2004-01-20 at 16:29, Jaroslav Kysela wrote:
>>>
>>>>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?
>
>
> 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
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2004-01-21 23:41 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-20 14:09 xine with dmix Michel Dänzer
2004-01-20 15:29 ` Jaroslav Kysela
2004-01-20 16:06 ` Michel Dänzer
2004-01-20 16:07 ` Jaroslav Kysela
2004-01-20 16:29 ` Takashi Iwai
2004-01-20 16:39 ` Florian Schmidt
2004-01-20 17:39 ` Michel Dänzer
2004-01-21 19:19 ` Jaroslav Kysela
2004-01-21 21:45 ` Michel Dänzer
2004-01-21 23:15 ` James Courtier-Dutton
2004-01-21 23:41 ` James Courtier-Dutton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.