Commits

Anonymous committed 60af2c5

Misc changes here and there

A) ossxmix - add '-g' switch to set initial size.
B) osstest - allow using SIGQUIT to skip a test.
C) vmixctl - emit to stdout and not stderr.
D) soundon - more reliable test.
E) hdaudio - add VAIO id.
F) remove_drv - don't bother with /dev/snd anymore.
G) other misc. changes.

  • Participants
  • Parent commits bb2e49f

Comments (0)

Files changed (12)

File cmd/osstest/osstest.c

 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <signal.h>
 #include <fcntl.h>
 #include <string.h>
 #include <errno.h>
 #define TF_QUICK	0x00000008	/* Shortened test */
 #define TF_LOOP		0x00000010	/* Loop until interrupted */
 
-static int mixerfd;
-static int cardno = -1;
-static int num_devices_tested = 0;
-int play_gain = 100;
+int cardno = -1, mixerfd, num_devices_tested = 0, play_gain = 100, skip = 0;
 
 static short *sample_buf;
 
   else
     test_data = sample_buf;
 
+  if (skip) goto tend;
+
   printf ("\n");
 
   /* TF_SNDCONF is used when longer messages should be printed. */
   else
     printf ("OK ");
 
+  if (skip) goto tend;
+
   if (flags & TF_SNDCONF)
     printf ("   Performing right channel test on %s\n", devnode);
   else
   else
     printf ("OK ");
 
+  if (skip) goto tend;
+
   if (flags & TF_SNDCONF)
     printf ("   Performing stereo test on %s\n", devnode);
   else
   else
     printf ("OK <measured srate %8.2f Hz (%4.2f%%)> ",
 	    (float) sample_rate * ratio / 100.0, ratio - 100.0);
+tend:
+  skip = 0;
   printf ("\n");
   num_devices_tested++;
 
   return code == 1;
 }
 
+static void
+skip_handler (int c)
+{
+  skip = 1;
+}
+
 int
 main (int argc, char *argv[])
 {
       exit (-1);
     }
 
+#ifdef SIGQUIT
+  signal (SIGQUIT, skip_handler);
+#endif
+
   do {
     if (dev > -1)
       {

File cmd/ossxmix/ossxmix.c

 #ifndef GTK1_ONLY
 static gint manage_timeouts (GtkWidget *, GdkEventWindowState *, gpointer);
 #endif /* !GTK1_ONLY */
+static void parse_dimarg (const char *, GtkRequisition *);
 static gint poll_all (gpointer);
 static gint poll_peaks (gpointer);
 static gint poll_values (gpointer);
   return best;
 }
 
+static void
+parse_dimarg (const char * dimarg, GtkRequisition * Dimensions)
+{
+  long height = 0, width = 0;
+  char * p;
+
+  errno = 0;
+  width = strtol (dimarg, &p, 10);
+  if (errno || (width <= 0)) return;
+  if (width > Dimensions->width) width = Dimensions->width;
+  height = width;
+  if (*p != '\0')
+    {
+      errno = 0;
+      height = strtol (p+1, NULL, 10);
+      if (errno || (height <= 0)) height = width;
+    }
+
+  Dimensions->width = width;
+  if (height < Dimensions->height) Dimensions->height = height;
+  return;
+}
+
 int
 main (int argc, char **argv)
 {
   extern char * optarg;
+  char * dimarg = NULL;
   int i, v, c;
   GtkRequisition Dimensions;
 #ifndef GTK1_ONLY
   /* Get Gtk to process the startup arguments */
   gtk_init (&argc, &argv);
 
-  while ((c = getopt (argc, argv, "Sbd:w:n:xh")) != EOF)
+  while ((c = getopt (argc, argv, "Sbd:g:hn:w:x")) != EOF)
       switch (c)
 	{
 	case 'd':
 	  break;
 
 	case 'w':
+	  v = 0;
 	  v = atoi (optarg);
 	  if (v <= 0)
 	    v = 1;
 	  break;
 
 	case 'n':
+	  v = 0;
 	  v = atoi (optarg);
 	  if (v <= 0)
 	    v = 1;
 	  show_status_icon = 0;
 	  break;
 
+	case 'g':
+	  dimarg = optarg;
+	  break;
+
 	case 'h':
 	  printf ("Usage: %s [options...]\n", argv[0]);
 	  printf ("       -h          Prints help (this screen)\n");
 	  printf ("       -w[val]     Make mixer bit wider on screen\n");
 	  printf ("       -n[val]     Make mixer bit narrower on screen\n");
 	  printf ("       -b          Start mixer in background\n");
+	  printf ("       -g[w:h]     Start mixer window with w:h size\n");
 #ifdef STATUSICON
 	  printf ("       -S          Don't place an icon in system tray\n");
 #endif /* STATUSICON */
   /* Create the app's main window */
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   Dimensions = create_widgets ();
+  if (dimarg != NULL) parse_dimarg (dimarg, &Dimensions);
   gtk_window_set_default_size (GTK_WINDOW (window),
                                Dimensions.width, Dimensions.height);
 

File cmd/ossxmix/ossxmix.man

 -n[value]   Make the mixer slightly narrower than normally. This may be
             necessary if the mixer is wider than the screen. The value can be
             1 (default) or 2.
+-g[w:h]     Start ossxmix window with dimnesions w:h.
 -b          Start in background.
 -S          Do not try to place an icon in the system tray.
 

File cmd/vmixctl/vmixctl.c

 static void
 usage(void)
 {
-	fprintf (stderr, "Usage:\n");
-	fprintf (stderr, "%s attach [attach_options...] devname\n", cmdname);
-	fprintf (stderr, "%s attach [attach_options...] devname inputdev\n", cmdname);
-	fprintf (stderr, "%s detach devname\n", cmdname);
-	fprintf (stderr, "%s rate devname samplerate\n", cmdname);
-	fprintf (stderr, "\n");
-	fprintf (stderr, "Use ossinfo -a to find out the devname and inputdev parameters\n");
-	fprintf (stderr, "Use ossinfo -a -v2 to find out a suitable sample rate.\n");
-	fprintf (stderr, "\n");
-	fprintf (stderr, "attach_options:\n");
-	fprintf (stderr, "\n");
-	fprintf (stderr, "\t-r\tDisable recording\n");
-	fprintf (stderr, "\t-p\tDo not preallocate client engines\n");
-	fprintf (stderr, "\t-M\tUse more fragments\n");
-	fprintf (stderr, "\t-V\tMake clients visible by creating device files for them.\n");
-	fprintf (stderr, "\t-c<N>\tPrecreate <N> client engines (see -p).\n");
+	fprintf (stdout, "Usage:\n");
+	fprintf (stdout, "%s attach [attach_options...] devname\n", cmdname);
+	fprintf (stdout, "%s attach [attach_options...] devname inputdev\n", cmdname);
+	fprintf (stdout, "%s detach devname\n", cmdname);
+	fprintf (stdout, "%s rate devname samplerate\n", cmdname);
+	fprintf (stdout, "\n");
+	fprintf (stdout, "Use ossinfo -a to find out the devname and inputdev parameters\n");
+	fprintf (stdout, "Use ossinfo -a -v2 to find out a suitable sample rate.\n");
+	fprintf (stdout, "\n");
+	fprintf (stdout, "attach_options:\n");
+	fprintf (stdout, "\n");
+	fprintf (stdout, "\t-r\tDisable recording\n");
+	fprintf (stdout, "\t-p\tDo not preallocate client engines\n");
+	fprintf (stdout, "\t-M\tUse more fragments\n");
+	fprintf (stdout, "\t-V\tMake clients visible by creating device files for them.\n");
+	fprintf (stdout, "\t-c<N>\tPrecreate <N> client engines (see -p).\n");
 
 	exit(-1);
 }
 		exit(-1);
 	}
 
-	fprintf (stderr, "Virtual mixer attached to device.\n");
+	fprintf (stdout, "Virtual mixer attached to device.\n");
 
 	if (relink_devices)
 	{
 		exit(-1);
 	}
 
-	fprintf (stderr, "Virtual mixer detached from device.\n");
+	fprintf (stdout, "Virtual mixer detached from device.\n");
 
 	return 0;
 }
 		exit(-1);
 	}
 
-	fprintf (stderr, "Virtual mixer rate change requested.\n");
+	fprintf (stdout, "Virtual mixer rate change requested.\n");
 
 	return 0;
 }

File kernel/drv/oss_hdaudio/hdaudio_codecids.h

    * Assume the audio codec is identical with Vaio AGN (above).
    */
   {0x104d1e00, "Vaio/STAC9872AK", VF_VAIO_HACK, (char**) &vaio_remap, 0x76540213, hdaudio_vaio_vgn_mixer_init, 0x83847662, 0x104d9008},
+  /* Vaio VGC-LA1 */
+  {0x104d1200, "Vaio/STAC9872AK", VF_VAIO_HACK, (char**) &vaio_remap, 0x76540213, hdaudio_vaio_vgn_mixer_init, 0x83847662, 0x104d8205},
 
 /*
  * Thinkpad R61

File kernel/drv/oss_hdaudio/hdaudio_vaio_vgn.c

 
   HDA_OUTAMP_F (0x05, top_group, "speaker", 90, MIXF_MAINVOL);
   /* We sync the volume of the headphone DAC to the speaker DAC */
-#if 0
+#if 1
   HDA_OUTAMP_F (0x02, top_group, "headphone", 90, MIXF_MAINVOL);
 #endif
 

File kernel/framework/audio/oss_audio_core.c

   adev = audio_engines[dev];
   dmap = adev->dmap_out;
 
+  MUTEX_ENTER_IRQDISABLE (dmap->mutex, flags);
+
   if (dmap->dmabuf == NULL)
     {
+      MUTEX_EXIT_IRQRESTORE (dmap->mutex, flags);
       cmn_err (CE_WARN, "Output interrupt when no buffer is allocated\n");
       return;
     }
 
-  MUTEX_ENTER_IRQDISABLE (dmap->mutex, flags);
-
   if (!(intr_flags & AINTR_NO_POINTER_UPDATES))
     {
       dmap->byte_counter += dmap->fragment_size;

File kernel/framework/vmix_core/vmix_output.c

   if (!mixer->multich_enable)
     mixer->play_engine.channels = 2;
 
-
-  /* Force the device to stereo before trying with (possibly) imultiple channels */
+  /* Force the device to stereo before trying with (possibly) multiple channels */
   adev->d->adrv_set_channels (mixer->masterdev, 2);
 
   mixer->play_engine.channels =

File lib/libOSSlib/libmain.c

 #include <stdlib.h>
 #include <string.h>
 #include <fcntl.h>
+#include <sys/ioctl.h>
 
 #define OSSLIB
 #include "../../include/soundcard.h"

File setup/Linux/oss/scripts/remove_drv.sh

 echo killing
   rm -f /dev/mixer.old
   mv /dev/mixer /dev/mixer.old 2>/dev/null
-  if test -d /dev/snd
-  then
-	(cd /;tar cfj $OSSLIBDIR/save/alsadevs.tar.bz2 dev/snd)
-  fi
+  #if test -d /dev/snd
+  #then
+	#(cd /;tar cfj $OSSLIBDIR/save/alsadevs.tar.bz2 dev/snd)
+  #fi
 
-  mv /dev/snd /dev/snd.osssave
+  #mv /dev/snd /dev/snd.osssave
   #fuser -k -s /dev/mixer.old /dev/snd.osssave/*
 fi
 

File setup/Linux/sbin/soundon

    /usr/sbin/ossdetect -l >> $LOG
 fi
 
-if grep -q '^ *14 ' < /proc/devices
+if test -d /proc/asound || grep -q '^ *14 ' < /proc/devices
 then
 	if ! sh $OSSLIBDIR/scripts/remove_drv.sh>> $LOG
 	then

File setup/dirsetup.c

   if ((dir = opendir (fromdir)) == NULL)
     {
       fprintf (stderr, "Bad source directory %s\n", fromdir);
+      return;
     }
 
   while ((de = readdir (dir)) != NULL)
 	}
     }
 
+  f = fopen (".nocopy", "w");
+  fclose (f);
   copy_tree (srcdir, NULL, 0);
 
 #if 0