[patch] SqueakVM doesn't build on OSS systems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch] SqueakVM doesn't build on OSS systems

Aleksej Saushev-2
 
  Hello!

First, you can't build SqueakVM on NetBSD because it links to
non-existing library (OSS isn't ALSA).

Second, audio devices are /dev/audio* and /dev/sound* rather than /dev/dsp*.

Third, sometimes default devices are /dev/audio1 and /dev/sound1.
E.g. on my rather modern (2008) laptop.

Here're patches I use, usage example:
squeak -vm-sound-OSS -playback /dev/audio1 Squeak4.0-basic.image


Use proper OSS library.
Use proper audio device.

--- unix/vm-sound-OSS/config.cmake.orig 2009-08-26 22:44:21.000000000 +0400
+++ unix/vm-sound-OSS/config.cmake 2010-01-24 06:10:44.000000000 +0300
@@ -1,2 +1,2 @@
-PLUGIN_REQUIRE_INCLUDE (ALSA_SOUNDLIB alsa/asoundlib.h)
-PLUGIN_REQUIRE_LIBRARY (ASOUND asound)
+PLUGIN_REQUIRE_LIBRARY (ASOUND ossaudio)
+PLUGIN_DEFINITIONS (-DDEVOSSAUDIO=\"${DEVOSSAUDIO}\")

Allow customization of audio devices.

--- unix/vm-sound-OSS/sqUnixSoundOSS.c.orig 2008-09-02 22:49:45.000000000 +0400
+++ unix/vm-sound-OSS/sqUnixSoundOSS.c 2010-02-10 23:13:27.000000000 +0300
@@ -1172,6 +1172,10 @@
 static int   sound_parseArgument(int argc, char **argv)
 {
   if (!strcmp(argv[0], "-nomixer")) return noSoundMixer= 1;
+  else if (argv[1]) {
+ if (!strcmp(argv[0], "-playback")) {dev_dsp.path = argv[1]; return 2;}
+ if (!strcmp(argv[0], "-capture")) {dev_dsp1.path = argv[1]; return 2;}
+  }
   return 0;
 }
 
@@ -1179,6 +1183,8 @@
 {
   printf("\nOSS <option>s:\n");
   printf("  -nomixer              disable mixer (volume) adjustment\n");
+  printf("  -playback <name>      play to the named sound device (default: %s)\n", dev_dsp.path);
+  printf("  -capture <name>       record from the named sound device (default: %s)\n", dev_dsp1.path);
 }
 
 static void  sound_printUsageNotes(void)




--
HE CE3OH...
Reply | Threaded
Open this post in threaded view
|

Re: [patch] SqueakVM doesn't build on OSS systems

Igor Stasenko

What kills me that why every application should care about knowing
what is the default sound device exists in system...
Why there is not API in system or OSS library, which could enumerate
available sound devices ,
or even take the one, preferred by user?


On 25 January 2011 03:45, Aleksej Saushev <[hidden email]> wrote:

>
>  Hello!
>
> First, you can't build SqueakVM on NetBSD because it links to
> non-existing library (OSS isn't ALSA).
>
> Second, audio devices are /dev/audio* and /dev/sound* rather than /dev/dsp*.
>
> Third, sometimes default devices are /dev/audio1 and /dev/sound1.
> E.g. on my rather modern (2008) laptop.
>
> Here're patches I use, usage example:
> squeak -vm-sound-OSS -playback /dev/audio1 Squeak4.0-basic.image
>
>
> Use proper OSS library.
> Use proper audio device.
>
> --- unix/vm-sound-OSS/config.cmake.orig 2009-08-26 22:44:21.000000000 +0400
> +++ unix/vm-sound-OSS/config.cmake      2010-01-24 06:10:44.000000000 +0300
> @@ -1,2 +1,2 @@
> -PLUGIN_REQUIRE_INCLUDE (ALSA_SOUNDLIB alsa/asoundlib.h)
> -PLUGIN_REQUIRE_LIBRARY (ASOUND asound)
> +PLUGIN_REQUIRE_LIBRARY (ASOUND ossaudio)
> +PLUGIN_DEFINITIONS (-DDEVOSSAUDIO=\"${DEVOSSAUDIO}\")
>
> Allow customization of audio devices.
>
> --- unix/vm-sound-OSS/sqUnixSoundOSS.c.orig     2008-09-02 22:49:45.000000000 +0400
> +++ unix/vm-sound-OSS/sqUnixSoundOSS.c  2010-02-10 23:13:27.000000000 +0300
> @@ -1172,6 +1172,10 @@
>  static int   sound_parseArgument(int argc, char **argv)
>  {
>   if (!strcmp(argv[0], "-nomixer")) return noSoundMixer= 1;
> +  else if (argv[1]) {
> +       if (!strcmp(argv[0], "-playback")) {dev_dsp.path = argv[1]; return 2;}
> +       if (!strcmp(argv[0], "-capture")) {dev_dsp1.path = argv[1]; return 2;}
> +  }
>   return 0;
>  }
>
> @@ -1179,6 +1183,8 @@
>  {
>   printf("\nOSS <option>s:\n");
>   printf("  -nomixer              disable mixer (volume) adjustment\n");
> +  printf("  -playback <name>      play to the named sound device (default: %s)\n", dev_dsp.path);
> +  printf("  -capture <name>       record from the named sound device (default: %s)\n", dev_dsp1.path);
>  }
>
>  static void  sound_printUsageNotes(void)
>
>
>
>
> --
> HE CE3OH...
>



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: [patch] SqueakVM doesn't build on OSS systems

Tapple Gao
 
On Tue, Jan 25, 2011 at 03:56:33PM +0100, Igor Stasenko wrote:
> What kills me that why every application should care about knowing
> what is the default sound device exists in system...
> Why there is not API in system or OSS library, which could enumerate
> available sound devices ,
> or even take the one, preferred by user?

That would just make too much sense for unix :)

--
Matthew Fulmer (a.k.a. Tapple)