Hello,

Romain Beauxis, le Thu 15 Jul 2010 00:16:15 -0500, a écrit :
> The latest oss4 release is 4.2-build2003. The version of 
> libsalsa provided there seems to have improved, in particular
> it now has a symbol that was missing when building ocaml-alsa
> on kfreebsd using libsalsa..
> 
> (symbol: snd_pcm_hw_params_get_buffer_size_min)

Ah, good.

> I also take this opportunity to reiterate my proposition
> to merge oss4 and libsalsa packaging effort into one.

Right. The only barrier I can see is that in oss-libsalsa, we include
some alsa headers to be able to provide them in liboss-salsa-dev, and
we apply some dirty fixes for hurd-i386, see the attached diff. If
that's fine with oss4 packaging, then it's all good, I'll have a look at
integrating liboss-salsa in oss4.

Samuel
--- oss-libsalsa-4.1-build1052b.orig/include/soundcard.h
+++ oss-libsalsa-4.1-build1052b/include/soundcard.h
@@ -15,6 +15,10 @@
 #ifndef SOUNDCARD_H
 #define SOUNDCARD_H
 
+/* Note: GNU/Hurd: the _IOT__IOTBASE_* definitions will not work, that's ok
+ * since we do not support sound yet anyway, and we do not export this to other
+ * packages.  */
+
 /*
  * This file is part of Open Sound System
  *
@@ -106,6 +110,7 @@
 #define OSS_ID_SIZE            16
 #define OSS_HANDLE_SIZE                32
 typedef char oss_longname_t[OSS_LONGNAME_SIZE];
+#define _IOT__IOTBASE_oss_longname_t _IOT (0, 0, 0, 0, 0, 0)
 typedef char oss_label_t[OSS_LABEL_SIZE];
 typedef char oss_devnode_t[OSS_DEVNODE_SIZE];
 typedef char oss_devname_t[OSS_DEVNAME_SIZE];
@@ -1085,6 +1090,7 @@
   int bytes;                   /* Available space in bytes (includes partially 
used fragments) */
   /* Note! 'bytes' could be more than fragments*fragsize */
 } audio_buf_info;
+#define _IOT__IOTBASE_audio_buf_info _IOT (0, 0, 0, 0, 0, 0)
 
 #define SNDCTL_DSP_GETOSPACE           __SIOR ('P',12, audio_buf_info)
 #define SNDCTL_DSP_GETISPACE           __SIOR ('P',13, audio_buf_info)
@@ -1759,6 +1765,7 @@
   char revision_info[256];     /* For internal use */
   int filler[172];             /* For future expansion */
 } oss_sysinfo;
+#define _IOT__IOTBASE_oss_sysinfo _IOT (0, 0, 0, 0, 0, 0)
 
 typedef struct oss_mixext
 {
@@ -1846,6 +1853,7 @@
   int rgbcolor;                /* 0 means default color (not black) . 
Otherwise 24 bit RGB color */
   int filler[6];
 } oss_mixext;
+#define _IOT__IOTBASE_oss_mixext _IOT (0, 0, 0, 0, 0, 0)
 
 /*
  * Recommended colors to be used in the rgbcolor field. These match the
@@ -1877,6 +1885,7 @@
   int timestamp;               /* Must be set to oss_mixext.timestamp */
   int filler[8];               /* Reserved for future use. Initialize to 0 */
 } oss_mixer_value;
+#define _IOT__IOTBASE_oss_mixer_value _IOT (0, 0, 0, 0, 0, 0)
 
 #define OSS_ENUM_MAXVALUE      255
 #define OSS_ENUM_STRINGSIZE    3000
@@ -1925,6 +1934,7 @@
   int next_rec_engine;         /* Read the documentation for more info */
   int filler[184];
 } oss_audioinfo;
+#define _IOT__IOTBASE_oss_audioinfo _IOT (0, 0, 0, 0, 0, 0)
 
 typedef struct oss_mixerinfo
 {
@@ -1954,6 +1964,7 @@
   int legacy_device;
   int filler[245];             /* Reserved */
 } oss_mixerinfo;
+#define _IOT__IOTBASE_oss_mixerinfo _IOT (0, 0, 0, 0, 0, 0)
 
 typedef struct oss_midi_info
 {
@@ -1999,6 +2010,7 @@
   int intr_count, ack_count;
   int filler[154];
 } oss_card_info;
+#define _IOT__IOTBASE_oss_card_info _IOT (0, 0, 0, 0, 0, 0)
 
 #define SNDCTL_SYSINFO         __SIOR ('X', 1, oss_sysinfo)
 #define OSS_SYSINFO            SNDCTL_SYSINFO  /* Old name */
--- oss-libsalsa-4.1-build1052b.orig/lib/libsalsa/seqmid.c
+++ oss-libsalsa-4.1-build1052b/lib/libsalsa/seqmid.c
@@ -38,7 +38,7 @@
   int result;
 
   dbg_printf
-    ("snd_seq_create_simple_port(seq=%x, name='%s', caps=%x, type=%x)\n", seq,
+    ("snd_seq_create_simple_port(seq=%p, name='%s', caps=%x, type=%x)\n", seq,
      name, caps, type);
 
   memset (&pinfo, 0, sizeof (pinfo));
--- oss-libsalsa-4.1-build1052b.orig/lib/libsalsa/Makefile
+++ oss-libsalsa-4.1-build1052b/lib/libsalsa/Makefile
@@ -2,7 +2,7 @@
 
 OSSLIBDIR=/usr/lib/oss
 
-CFLAGS=-O -I../../include -I../libOSSlib
+CFLAGS+=-I../../include -I../libOSSlib
 LIBTOOL=libtool --tag=CC
 
 all: libsalsa.la
@@ -46,7 +46,7 @@
                $(LIBTOOL) --mode=compile gcc $(CFLAGS) -c rawmidi.c 
 
 libsalsa.la:   $(LOBJECTS)
-               $(LIBTOOL) --mode=link gcc -rpath /usr/lib 
-Wl,--version-script=Versions -version-info 2:0:0 -o libsalsa.la $(LOBJECTS) 
-L../libOSSlib -lOSSlib
+               $(LIBTOOL) --mode=link gcc -rpath /usr/lib -R 
/usr/lib/oss-libsalsa -Wl,--version-script=Versions -version-info 2:0:0 -o 
liboss-salsa.la $(LOBJECTS) -L../libOSSlib -lOSSlib
 
 install:       libsalsa.la
                $(LIBTOOL) cp libsalsa.la /usr/lib
--- oss-libsalsa-4.1-build1052b.orig/lib/libsalsa/seq.c
+++ oss-libsalsa-4.1-build1052b/lib/libsalsa/seq.c
@@ -111,7 +111,7 @@
   if ((seq = malloc (sizeof (*seq))) == NULL)
     return -ENOMEM;
 
-  dbg_printf ("Created sequencer seq=%x\n", seq);
+  dbg_printf ("Created sequencer seq=%p\n", seq);
 
   memset (seq, 0, sizeof (*seq));
 
--- oss-libsalsa-4.1-build1052b.orig/lib/libsalsa/seq_output.c
+++ oss-libsalsa-4.1-build1052b/lib/libsalsa/seq_output.c
@@ -40,7 +40,13 @@
       if (l == -1)
        return -errno;
 
+#ifdef EBADE
       return -EBADE;           /* Randomly selected error */
+#elif defined(EGRATUITOUS)
+      return -EGRATUITOUS;     /* Randomly selected error */
+#else
+      return -EIO;             /* Randomly selected error */
+#endif
     }
 
   return 0;
@@ -65,7 +71,13 @@
       if (l == -1)
        return -errno;
 
+#ifdef EBADE
       return -EBADE;           /* Randomly selected error */
+#elif defined(EGRATUITOUS)
+      return -EGRATUITOUS;     /* Randomly selected error */
+#else
+      return -EIO;             /* Randomly selected error */
+#endif
     }
 
   return 0;
@@ -78,7 +90,7 @@
 
   dbg_printf3
     ("Event %2d: flags=%08x tag=%08x, q=%2d, time=%d, src=%x, dst=%x\n",
-     ev->type, ev->flags, ev->tag, ev->queue, ev->time, ev->source, ev->dest);
+     ev->type, ev->flags, ev->tag, ev->queue, ev->time.tick, ev->source, 
ev->dest);
 
   switch (ev->type)
     {
--- oss-libsalsa-4.1-build1052b.orig/lib/libsalsa/local.h
+++ oss-libsalsa-4.1-build1052b/lib/libsalsa/local.h
@@ -9,6 +9,7 @@
 #include "../../include/soundcard.h"
 #include "alsakernel.h"
 #include <sys/poll.h>
+#include <sys/ioctl.h>
 #include "../../kernel/framework/include/midiparser.h"
 
 extern int alib_verbose;
--- oss-libsalsa-4.1-build1052b.orig/lib/libsalsa/timer.c
+++ oss-libsalsa-4.1-build1052b/lib/libsalsa/timer.c
@@ -57,7 +57,7 @@
 
   timer = malloc (sizeof (*timer));
 
-  dbg_printf ("snd_timer_open(name='%s', mode=%x)=%x\n", name, mode, timer);
+  dbg_printf ("snd_timer_open(name='%s', mode=%x)=%p\n", name, mode, timer);
 
   if (timer == NULL)
     return -ENOMEM;
--- oss-libsalsa-4.1-build1052b.orig/lib/libsalsa/misc.c
+++ oss-libsalsa-4.1-build1052b/lib/libsalsa/misc.c
@@ -105,3 +105,13 @@
   dbg_printf ("snd_lib_error_set_handler()\n");
   return 0;
 }
+
+
+/**
+ * \brief Returns the ALSA sound library version in ASCII format
+ * \return The ASCII description of the used ALSA sound library.
+ */
+const char *snd_asoundlib_version(void)
+{
+       return SND_LIB_VERSION_STR;
+}
--- oss-libsalsa-4.1-build1052b.orig/lib/libOSSlib/libmain.c
+++ oss-libsalsa-4.1-build1052b/lib/libOSSlib/libmain.c
@@ -3,6 +3,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <fcntl.h>
+#include <sys/ioctl.h>
 
 #define OSSLIB
 #include "../../include/soundcard.h"
--- oss-libsalsa-4.1-build1052b.orig/lib/libOSSlib/Makefile
+++ oss-libsalsa-4.1-build1052b/lib/libOSSlib/Makefile
@@ -1,7 +1,7 @@
 OBJS=guslib.o opl3lib.o libmain.o midiparser.o play_event.o
 INSTALLLIB=/lib
 LDFLAGS=-shared -fPIC
-CFLAGS=-O -fPIC
+CFLAGS+=-fPIC
 #LDFLAGS=-Bdynamic
 AROPTS=rc
 AR=ar
--- oss-libsalsa-4.1-build1052b.orig/lib/libOSSlib/guslib.c
+++ oss-libsalsa-4.1-build1052b/lib/libOSSlib/guslib.c
@@ -122,7 +122,7 @@
   unsigned char buf[256];
   char name[256];
   long offset;
-  struct patch_info *patch;
+  struct patch_info *patch = NULL;
 
   if (!initialized)
     gusinit (seqfd, dev);
@@ -249,7 +249,7 @@
       patch = (struct patch_info *) malloc (sizeof (*patch) + sample.len);
       if (patch == NULL)
        {
-         fprintf (stderr, "Failed to allocate %d bytes of memory\n",
+         fprintf (stderr, "Failed to allocate %ld bytes of memory\n",
                   sizeof (*patch) + sample.len);
          exit (0);
        }

Reply via email to