Skip to contentSkip to conversation

alsa-lib: SND_PCM_TSTAMP_MMAP -> SND_PCM_TSTAMP_ENABLE change

alsa-cvslog Clemens Ladisch 3 participants 3 messages Jan 11, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · Jaroslav Kysela

description:
SND_PCM_TSTAMP_MMAP -> SND_PCM_TSTAMP_ENABLE change

diff -r 3c87e22e70d8 -r 2519fcd54901 include/pcm.h

include/pcm.h line 287

Quoted 10 lines
include/pcm.h +3 -3
@@ -281,9 +281,9 @@
 typedef enum _snd_pcm_tstamp {
 	/** No timestamp */
 	SND_PCM_TSTAMP_NONE = 0,
-	/** Update mmap'ed timestamp */
-	SND_PCM_TSTAMP_MMAP,
-	SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_MMAP
+	/** Update timestamp at every hardware position update */
+	SND_PCM_TSTAMP_ENABLE,
+	SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
 } snd_pcm_tstamp_t;

This change breaks backward compatibility.
The v19-devel branch of PortAudio uses SND_PCM_TSTAMP_MMAP.

Regards,
Clemens

#2 lore raw
Quoted 13 lines · Clemens Ladisch
Quoted 12 lines · Jaroslav Kysela

description:
SND_PCM_TSTAMP_MMAP -> SND_PCM_TSTAMP_ENABLE change

diff -r 3c87e22e70d8 -r 2519fcd54901 include/pcm.h

include/pcm.h +0 -2
@@ -281,9 +281,9 @@
 typedef enum _snd_pcm_tstamp {
 	/** No timestamp */
 	SND_PCM_TSTAMP_NONE = 0,
-	/** Update mmap'ed timestamp */
-	SND_PCM_TSTAMP_MMAP,
Quoted 8 lines

include/pcm.h line 287

Quoted 5 lines
include/pcm.h +3 -1
-	SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_MMAP
+	/** Update timestamp at every hardware position update */
+	SND_PCM_TSTAMP_ENABLE,
+	SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
 } snd_pcm_tstamp_t;

This change breaks backward compatibility.
The v19-devel branch of PortAudio uses SND_PCM_TSTAMP_MMAP.

It's no problem to add SND_PCM_TSTAMP_MMAP as alias to SND_PCM_TSTAMP_ENABLE back. But I think that it would be better to let developers using SND_PCM_TSTAMP_MMAP realize that something was changed.

Binary compatibility is kept.

Note that SND_PCM_TSTAMP_MMAP is also quite unusable without new snd_pcm_htimestamp() function and support for monotonic timestamps in the latest driver/library code.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

#3 lore raw

At Fri, 11 Jan 2008 09:35:08 +0100 (CET),

Quoted 25 lines · Jaroslav Kysela
Quoted 13 lines · Clemens Ladisch
Quoted 12 lines · Jaroslav Kysela

description:
SND_PCM_TSTAMP_MMAP -> SND_PCM_TSTAMP_ENABLE change

diff -r 3c87e22e70d8 -r 2519fcd54901 include/pcm.h

include/pcm.h +0 -2
@@ -281,9 +281,9 @@
 typedef enum _snd_pcm_tstamp {
 	/** No timestamp */
 	SND_PCM_TSTAMP_NONE = 0,
-	/** Update mmap'ed timestamp */
-	SND_PCM_TSTAMP_MMAP,
Quoted 8 lines

include/pcm.h line 287

Quoted 5 lines
include/pcm.h +3 -1
-	SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_MMAP
+	/** Update timestamp at every hardware position update */
+	SND_PCM_TSTAMP_ENABLE,
+	SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
 } snd_pcm_tstamp_t;

This change breaks backward compatibility.
The v19-devel branch of PortAudio uses SND_PCM_TSTAMP_MMAP.

Quoted 3 lines

It's no problem to add SND_PCM_TSTAMP_MMAP as alias to SND_PCM_TSTAMP_ENABLE back. But I think that it would be better to let developers using SND_PCM_TSTAMP_MMAP realize that something was changed.

I think we shouldn't break the API, at least.
Let's add alias.

Quoted 5 lines

Binary compatibility is kept.

Note that SND_PCM_TSTAMP_MMAP is also quite unusable without new snd_pcm_htimestamp() function and support for monotonic timestamps in the latest driver/library code.

Right. It's meaningless without the fast timestamp read. The result is as same as TSTAMP_NONE.
Maybe they took it blindly (because of the name 'TSTAMP_NONE').

Regarding this change, one idea that came to my mind is to rename this API function.
For example, snd_pcm_sw_params_get/set_fast_tstamp(sw, bool), and deprecate snd_pcm_sw_params_get/set_tstamp_mode(). The bool function seems more intuitive in this case. The mode enum might be good if we'll have more complicated timestamp modes, but I don't think this will ever happen...

Takashi