Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Stransky <stransky@redhat.com>
To: Alsa-Devel <alsa-devel@lists.sourceforge.net>
Subject: alsa-lib patches
Date: Fri, 29 Apr 2005 15:57:52 +0200	[thread overview]
Message-ID: <42723D60.4030208@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 395 bytes --]

Hi,

there are some patches for alsa-lib (1.0.9rc2), we use them in Fedora 4. 
About mixer patch - some user had a problem with ICH6 and this patch helped.

Otherwise, we try to use dmix as the default pcm device in FC4, we have 
experimental ainit tool for run-time creation of ~/.asoundrc file with 
safely generated IPC keys for dmix/dsnoop/dshare plugins. Every feedback 
is welcome...

Ma.

[-- Attachment #2: alsa-lib-alpha.patch --]
[-- Type: text/x-patch, Size: 606 bytes --]

--- alsa-lib-1.0.6/include/alsa-symbols.h.orig	2004-11-30 17:40:41.543824072 +0300
+++ alsa-lib-1.0.6/include/alsa-symbols.h	2004-11-30 17:42:34.828002372 +0300
@@ -57,10 +57,16 @@
 	__asm__ (".set " #name "," #real);		\
 	__asm__ (".set ." #name ",." #real)
 #else
+#ifdef __alpha__
+#define use_default_symbol_version(real, name, version) \
+        __asm__ (".weak " #name); \
+        __asm__ (#name " = " #real)
+#else
 #define use_default_symbol_version(real, name, version) \
 	__asm__ (".weak " #name); \
 	__asm__ (".set " #name "," #real)
 #endif
 #endif
+#endif
 
 #endif /* __ALSA_SYMBOLS_H */

[-- Attachment #3: alsa-lib-gcc4.patch --]
[-- Type: text/x-patch, Size: 5014 bytes --]

--- alsa-lib-1.0.9rc2/src/control/control.c.gcc4	2005-01-03 12:52:40.000000000 +0100
+++ alsa-lib-1.0.9rc2/src/control/control.c	2005-04-22 14:33:49.000000000 +0200
@@ -560,7 +560,7 @@
 int snd_ctl_read(snd_ctl_t *ctl, snd_ctl_event_t *event)
 {
 	assert(ctl && event);
-	return ctl->ops->read(ctl, event);
+	return (ctl->ops->read)(ctl, event);
 }
 
 /**
--- alsa-lib-1.0.9rc2/src/timer/timer.c.gcc4	2004-05-24 16:57:48.000000000 +0200
+++ alsa-lib-1.0.9rc2/src/timer/timer.c	2005-04-22 14:33:49.000000000 +0200
@@ -876,7 +876,7 @@
 	assert(timer);
 	assert(((timer->mode & O_ACCMODE) == O_RDONLY) || ((timer->mode & O_ACCMODE) == O_RDWR));
 	assert(buffer || size == 0);
-	return timer->ops->read(timer, buffer, size);
+	return (timer->ops->read)(timer, buffer, size);
 }
 
 /**
--- alsa-lib-1.0.9rc2/src/conf.c.gcc4	2005-02-14 16:09:10.000000000 +0100
+++ alsa-lib-1.0.9rc2/src/conf.c	2005-04-22 14:33:49.000000000 +0200
@@ -2506,9 +2506,11 @@
  *               specified by \p result.
  * \return Zero if successful, otherwise a negative error code.
  */
+
+static int snd_config_hooks(snd_config_t *config, snd_config_t *private_data);
+
 int snd_config_search_hooks(snd_config_t *config, const char *key, snd_config_t **result)
 {
-	static int snd_config_hooks(snd_config_t *config, snd_config_t *private_data);
 	SND_CONFIG_SEARCH(config, key, result, \
 					err = snd_config_hooks(config, NULL); \
 					if (err < 0) \
@@ -2526,9 +2528,10 @@
  *               specified by \p result.
  * \return Zero if successful, otherwise a negative error code.
  */
+static int snd_config_hooks(snd_config_t *config, snd_config_t *private_data);
+
 int snd_config_searcha_hooks(snd_config_t *root, snd_config_t *config, const char *key, snd_config_t **result)
 {
-	static int snd_config_hooks(snd_config_t *config, snd_config_t *private_data);
 	SND_CONFIG_SEARCHA(root, config, key, result,
 					snd_config_searcha_hooks,
 					err = snd_config_hooks(config, NULL); \
--- alsa-lib-1.0.9rc2/src/pcm/pcm_dmix_generic.c.gcc4	2005-02-08 21:28:31.000000000 +0100
+++ alsa-lib-1.0.9rc2/src/pcm/pcm_dmix_generic.c	2005-04-22 14:49:57.000000000 +0200
@@ -72,9 +72,9 @@
 		} while (*sum != old_sample);
 		if (!--size)
 			return;
-		src += src_step;
-		dst += dst_step;
-		sum += sum_step;
+		src = (signed short *) ((char *)src + src_step);
+		dst = (signed short *) ((char *)dst + dst_step);
+		sum = (signed int *)   ((char *)sum + sum_step);
 	}
 }
 
@@ -106,9 +106,9 @@
 		} while (*sum != old_sample);
 		if (!--size)
 			return;
-		src += src_step;
-		dst += dst_step;
-		sum += sum_step;
+		src = (signed int *) ((char *)src + src_step);
+		dst = (signed int *) ((char *)dst + dst_step);
+		sum = (signed int *) ((char *)sum + sum_step);
 	}
 }
 
--- alsa-lib-1.0.9rc2/src/pcm/pcm_plugin.c.gcc4	2005-01-20 16:07:59.000000000 +0100
+++ alsa-lib-1.0.9rc2/src/pcm/pcm_plugin.c	2005-04-22 14:33:49.000000000 +0200
@@ -316,7 +316,7 @@
 		snd_pcm_mmap_begin(slave, &slave_areas, &slave_offset, &slave_frames);
 		if (slave_frames == 0)
 			break;
-		frames = plugin->read(pcm, areas, offset, frames,
+		frames = (plugin->read)(pcm, areas, offset, frames,
 				      slave_areas, slave_offset, &slave_frames);
 		if (CHECK_SANITY(slave_frames > snd_pcm_mmap_capture_avail(slave))) {
 			SNDMSG("read overflow %ld > %ld", slave_frames,
@@ -488,7 +488,7 @@
 				return xfer > 0 ? (snd_pcm_sframes_t)xfer : err;
 			if (frames > cont)
 				frames = cont;
-			frames = plugin->read(pcm, areas, hw_offset, frames,
+			frames = (plugin->read)(pcm, areas, hw_offset, frames,
 					      slave_areas, slave_offset, &slave_frames);
 			snd_atomic_write_begin(&plugin->watom);
 			snd_pcm_mmap_hw_forward(pcm, frames);
--- alsa-lib-1.0.9rc2/src/hwdep/hwdep.c.gcc4	2004-05-24 16:57:47.000000000 +0200
+++ alsa-lib-1.0.9rc2/src/hwdep/hwdep.c	2005-04-22 14:33:49.000000000 +0200
@@ -485,7 +485,7 @@
 	assert(hwdep);
 	assert(((hwdep->mode & O_ACCMODE) == O_RDONLY) || ((hwdep->mode & O_ACCMODE) == O_RDWR));
 	assert(buffer || size == 0);
-	return hwdep->ops->read(hwdep, buffer, size);
+	return (hwdep->ops->read)(hwdep, buffer, size);
 }
 
 /**
--- alsa-lib-1.0.9rc2/src/rawmidi/rawmidi.c.gcc4	2004-09-28 12:45:33.000000000 +0200
+++ alsa-lib-1.0.9rc2/src/rawmidi/rawmidi.c	2005-04-22 14:33:49.000000000 +0200
@@ -987,5 +987,5 @@
 	assert(rawmidi);
 	assert(rawmidi->stream == SND_RAWMIDI_STREAM_INPUT);
 	assert(buffer || size == 0);
-	return rawmidi->ops->read(rawmidi, buffer, size);
+	return (rawmidi->ops->read)(rawmidi, buffer, size);
 }
--- alsa-lib-1.0.9rc2/src/seq/seq.c.gcc4	2004-03-23 16:15:21.000000000 +0100
+++ alsa-lib-1.0.9rc2/src/seq/seq.c	2005-04-22 14:33:49.000000000 +0200
@@ -3914,7 +3914,7 @@
 static ssize_t snd_seq_event_read_buffer(snd_seq_t *seq)
 {
 	ssize_t len;
-	len = seq->ops->read(seq, seq->ibuf, seq->ibufsize * sizeof(snd_seq_event_t));
+	len = (seq->ops->read)(seq, seq->ibuf, seq->ibufsize * sizeof(snd_seq_event_t));
 	if (len < 0)
 		return len;
 	seq->ibuflen = len / sizeof(snd_seq_event_t);

[-- Attachment #4: alsa-lib-mixer.patch --]
[-- Type: text/x-patch, Size: 966 bytes --]

--- alsa-lib-1.0.9rc2/src/mixer/mixer.c.old	2005-04-22 14:15:33.000000000 +0200
+++ alsa-lib-1.0.9rc2/src/mixer/mixer.c	2005-04-22 14:27:40.000000000 +0200
@@ -520,14 +520,22 @@
 	return c1->class->compare(c1, c2);
 }
 
+static snd_mixer_t *qsort_mixer;
 typedef int (*qsort_func)(const void *, const void *);
+
+static int compar(const void *a, const void *b) {
+       return qsort_mixer->compare(*(const snd_mixer_elem_t * const *) a,
+                                   *(const snd_mixer_elem_t * const *) b);
+}
+
 static int snd_mixer_sort(snd_mixer_t *mixer)
 {
 	unsigned int k;
 	assert(mixer);
 	assert(mixer->compare);
 	INIT_LIST_HEAD(&mixer->elems);
-	qsort(mixer->pelems, mixer->count, sizeof(snd_mixer_elem_t*), (qsort_func)mixer->compare);
+        qsort_mixer = mixer;
+	qsort(mixer->pelems, mixer->count, sizeof(snd_mixer_elem_t*), compar);
 	for (k = 0; k < mixer->count; k++)
 		list_add_tail(&mixer->pelems[k]->list, &mixer->elems);
 	return 0;

             reply	other threads:[~2005-04-29 13:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-29 13:57 Martin Stransky [this message]
2005-04-29 17:46 ` alsa-lib patches Lee Revell
2005-05-02  7:43   ` Martin Stransky
2005-05-02  8:43 ` Clemens Ladisch
  -- strict thread matches above, loose matches on Subject: below --
2005-05-15 14:57 Kevin F.Quinn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42723D60.4030208@redhat.com \
    --to=stransky@redhat.com \
    --cc=alsa-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox