liboss-commit Mailing List for Apple OS X libOSS (Page 2)
Brought to you by:
thesin
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(55) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(57) |
Nov
(52) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(16) |
Feb
(9) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Alexander S. <mrv...@us...> - 2002-12-12 01:38:23
|
Update of /cvsroot/liboss/liboss In directory sc8-pr-cvs1:/tmp/cvs-serv13630 Modified Files: configure.in liboss.kdevprj liboss.kdevses Log Message: Reverting dsp_init() back because the 'new method' was a no-op, and fixed up configure.in based on advice from 'autoscan' Index: configure.in =================================================================== RCS file: /cvsroot/liboss/liboss/configure.in,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- configure.in 6 Nov 2002 19:10:21 -0000 1.31 +++ configure.in 12 Dec 2002 01:19:34 -0000 1.32 @@ -127,9 +127,12 @@ AC_CHECK_HEADERS(errno.h string.h stdlib.h\ sys/types.h sys/stat.h sys/param.h \ machine/endian.h fcntl.h \ - sys/ioctl.h sys/socket.h) -AC_CHECK_FUNCS([realpath]) + sys/ioctl.h sys/socket.h ) +AC_CHECK_FUNCS([realpath memset]) +AC_FUNC_MALLOC +AC_HEADER_DIRENT +AC_CHECK_HEADERS(sys/syscall.h,[USE_DLOPEN="-DUSE_DLOPEN"],[USE_DLOPEN=""]) dnl dnl CoreAudio dnl @@ -196,7 +199,7 @@ fi AC_SUBST(LIBESD) AC_SUBST(ESD_LDFLAGS) - +AC_SUBST(USE_DLOPEN) AM_CONDITIONAL(ESD, test "x$esd" = "xtrue" ) AC_CONFIG_FILES([ Index: liboss.kdevprj =================================================================== RCS file: /cvsroot/liboss/liboss/liboss.kdevprj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- liboss.kdevprj 30 Oct 2002 22:42:00 -0000 1.2 +++ liboss.kdevprj 12 Dec 2002 01:19:34 -0000 1.3 @@ -23,7 +23,7 @@ type=DATA [./Makefile.am] -files=./acinclude.m4,./aclocal.m4,./AUTHORS,./autogen.sh,./ChangeLog,./config.guess,./config.h.in,./config.sub,./configure,./configure.in,./COPYING,./depcomp,./INSTALL,./install-sh,./liboss.info.in,./liboss.kdevprj,./liboss.pc.in,./ltmain.sh,./missing,./mkinstalldirs,./NEWS,./README,./TODO, +files=./acinclude.m4,./aclocal.m4,./AUTHORS,./autogen.sh,./ChangeLog,./config.guess,./config.h,./config.h.in,./config.log,./config.status,./config.sub,./configure,./configure.in,./COPYING,./depcomp,./INSTALL,./install-sh,./liboss.info,./liboss.info.in,./liboss.kdevprj,./liboss.kdevses,./liboss.pc,./liboss.pc.in,./libtool,./ltmain.sh,./missing,./mkinstalldirs,./NEWS,./README,./stamp-h1,./TODO, sub_dirs=autom4te.cache,doc,include,lib,src, type=normal @@ -69,12 +69,30 @@ install_location= type=DATA +[./config.h] +dist=true +install=false +install_location= +type=HEADER + [./config.h.in] dist=true install=false install_location= type=DATA +[./config.log] +dist=true +install=false +install_location= +type=DATA + +[./config.status] +dist=true +install=false +install_location= +type=DATA + [./config.sub] dist=true install=false @@ -105,6 +123,12 @@ install_location= type=DATA +[./liboss.info] +dist=true +install=false +install_location= +type=DATA + [./liboss.info.in] dist=true install=false @@ -117,12 +141,30 @@ install_location= type=DATA +[./liboss.kdevses] +dist=true +install=false +install_location= +type=DATA + +[./liboss.pc] +dist=true +install=false +install_location= +type=DATA + [./liboss.pc.in] dist=true install=false install_location= type=DATA +[./libtool] +dist=true +install=false +install_location= +type=DATA + [./ltmain.sh] dist=true install=false @@ -141,32 +183,29 @@ install_location= type=DATA +[./stamp-h1] +dist=true +install=false +install_location= +type=DATA + [Config for BinMakefileAm] addcxxflags= -bin_program=liboss.dylib -cflags= -cppflags= -cxxflags=\s-O0 +bin_program=liboss +cxxflags= ldadd= -ldflags=\s\s -libtool_dir= -path_to_bin_program=./lib/.libs +ldflags= [General] -author=The libOSS team -configure_args=\s--build=powerpc-darwin --host=powerpc-darwin --target=powerpc-darwin\s -dir_where_make_will_be_called=./ -email=lib...@li... +author=astrange +email=astrange@emac.local. kdevprj_version=1.3 lfv_open_groups= -make_options=\s-t -j1 makefiles=./Makefile.am,src/Makefile.am,lib/Makefile.am,include/Makefile.am,doc/Makefile.am,autom4te.cache/Makefile.am, -modifyMakefiles=true -project_name=libOSS +project_name=liboss project_type=normal_empty -short_info=A library for emulation of /dev/dsp on OSX sub_dir= -version=0.1 +version= version_control=CVS workspace=1 @@ -225,7 +264,7 @@ type=HEADER [lib/Makefile.am] -files=lib/esddsp.c,lib/liboss.c,lib/ossinsert.c, +files=lib/esddsp.c,lib/liboss.c, sub_dirs= type=normal @@ -241,16 +280,16 @@ install_location= type=SOURCE -[lib/ossinsert.c] -dist=true -install=false -install_location= -type=SOURCE - [src/Makefile.am] -files=src/osscat.c, +files=src/osscat,src/osscat.c, sub_dirs= type=normal + +[src/osscat] +dist=true +install=false +install_location= +type=DATA [src/osscat.c] dist=true Index: liboss.kdevses =================================================================== RCS file: /cvsroot/liboss/liboss/liboss.kdevses,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- liboss.kdevses 30 Oct 2002 22:42:00 -0000 1.2 +++ liboss.kdevses 12 Dec 2002 01:19:34 -0000 1.3 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE KDevPrjSession> <KDevPrjSession> -<LastCompileConfig>(Default)</LastCompileConfig> +<LastCompileConfig>Compile Configuration</LastCompileConfig> <Mainframe MaximizeMode="1" /> <DocsAndViews NumberOfDocuments="0" /></KDevPrjSession> |
From: Alexander S. <mrv...@us...> - 2002-12-12 01:38:19
|
Update of /cvsroot/liboss/liboss/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13630/lib Modified Files: esddsp.c Log Message: Reverting dsp_init() back because the 'new method' was a no-op, and fixed up configure.in based on advice from 'autoscan' Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- esddsp.c 14 Nov 2002 22:38:44 -0000 1.20 +++ esddsp.c 12 Dec 2002 01:19:35 -0000 1.21 @@ -37,6 +37,9 @@ #include <sys/stat.h> #include <stdio.h> #include <sys/errno.h> +#ifdef HAVE_SYS_SYSCALL_H +#include <sys/syscall.h> +#endif #include "liboss/soundcard.h" #include "liboss/audioio.h" @@ -95,41 +98,19 @@ { if (!ident) { - /* FIXME - the value of getenv is AFAIK guranteed to stay - * current during the whole program run time. So in theory the - * next three lines could be replaced by something like this: - * - Max horn - * - * char *str = getenv ("ESDDSP_NAME"); - * if (!str) - * str = "esddsp"; - * - * If anybody can test it... - */ - - char *str = getenv ("ESDDSP_NAME"); - if (!str) - str = "esddsp"; - -/* OLD METHOD - - char *str = getenv ("ESDDSP_NAME"); + char *str = getenv ("ESDDSP_NAME"); ident = malloc (ESD_NAME_MAX); strncpy (ident, (str ? str : "esddsp"), ESD_NAME_MAX); + + str = getenv ("HOME"); use_mixer = 1; - - str = getenv ("HOME"); - FIXME - if $HOME is not set, mixer will stay NULL, but is passed later - on to open, leading to a potential crash. - if (str) { mixer = malloc (strlen (str) + strlen (ident) + 10); sprintf (mixer, "%s/.esddsp_%s", str, ident); } -*/ } } @@ -182,7 +163,8 @@ mode = va_arg (args, int); - if (!strcmp (pathname, "/dev/dsp")) + if (!strcmp (pathname, "/dev/dsp") || !strcmp(pathname,"/dev/dspW") || +!strcmp(pathname,"/dev/sound/dsp")) { if (!getenv ("ESPEAKER")) { |
From: Justin <th...@us...> - 2002-11-14 22:38:47
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv18657 Modified Files: esddsp.c Log Message: This gets me further in xmms thanks max, now to figure out a better implementation of OSpace and Fragment Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- esddsp.c 7 Nov 2002 23:09:57 -0000 1.19 +++ esddsp.c 14 Nov 2002 22:38:44 -0000 1.20 @@ -95,32 +95,41 @@ { if (!ident) { - /* FIXME - the value of getenv is AFAIK guranteed to stay current during the - whole program run time. So in theory the next three lines could be replaced - by something like this: - - char *str = getenv ("ESDDSP_NAME"); - if (!str) - str = "esddsp"; - - If anybody can test it... - */ + /* FIXME - the value of getenv is AFAIK guranteed to stay + * current during the whole program run time. So in theory the + * next three lines could be replaced by something like this: + * - Max horn + * + * char *str = getenv ("ESDDSP_NAME"); + * if (!str) + * str = "esddsp"; + * + * If anybody can test it... + */ char *str = getenv ("ESDDSP_NAME"); + if (!str) + str = "esddsp"; + +/* OLD METHOD + + char *str = getenv ("ESDDSP_NAME"); ident = malloc (ESD_NAME_MAX); strncpy (ident, (str ? str : "esddsp"), ESD_NAME_MAX); use_mixer = 1; str = getenv ("HOME"); - /* FIXME - if $HOME is not set, mixer will stay NULL, but is passed later - on to open, leading to a potential crash. - */ + + FIXME - if $HOME is not set, mixer will stay NULL, but is passed later + on to open, leading to a potential crash. + if (str) { mixer = malloc (strlen (str) + strlen (ident) + 10); sprintf (mixer, "%s/.esddsp_%s", str, ident); } +*/ } } |
From: Justin <th...@us...> - 2002-11-07 23:10:02
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv11613 Modified Files: esddsp.c Log Message: forgot the CR, that should help now hehe Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- esddsp.c 7 Nov 2002 16:21:58 -0000 1.18 +++ esddsp.c 7 Nov 2002 23:09:57 -0000 1.19 @@ -236,7 +236,7 @@ { audio_buf_info *bufinfo = (audio_buf_info *) argp; bufinfo->bytes = ESD_BUF_SIZE; - printf("Setting Fragment to: %d, %d", *arg, bufinfo->bytes); + printf("Setting Fragment to: %d, %d\n", *arg, bufinfo->bytes); } break; @@ -252,7 +252,7 @@ { audio_buf_info *bufinfo = (audio_buf_info *) argp; bufinfo->bytes = ESD_BUF_SIZE; - printf("Setting ISpace to: %d, %d", *arg, bufinfo->bytes); + printf("Setting ISpace to: %d, %d\n", *arg, bufinfo->bytes); } break; @@ -260,7 +260,7 @@ { audio_buf_info *bufinfo = (audio_buf_info *) argp; bufinfo->bytes = ESD_BUF_SIZE; - printf("Setting OSpace to: %d, %d", *arg, bufinfo->bytes); + printf("Setting OSpace to: %d, %d\n", *arg, bufinfo->bytes); } break; |
From: Justin <th...@us...> - 2002-11-07 16:22:02
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv32088/lib Modified Files: esddsp.c Log Message: added some printouts to see what arts is doing Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- esddsp.c 7 Nov 2002 16:05:37 -0000 1.17 +++ esddsp.c 7 Nov 2002 16:21:58 -0000 1.18 @@ -236,6 +236,7 @@ { audio_buf_info *bufinfo = (audio_buf_info *) argp; bufinfo->bytes = ESD_BUF_SIZE; + printf("Setting Fragment to: %d, %d", *arg, bufinfo->bytes); } break; @@ -251,6 +252,7 @@ { audio_buf_info *bufinfo = (audio_buf_info *) argp; bufinfo->bytes = ESD_BUF_SIZE; + printf("Setting ISpace to: %d, %d", *arg, bufinfo->bytes); } break; @@ -258,6 +260,7 @@ { audio_buf_info *bufinfo = (audio_buf_info *) argp; bufinfo->bytes = ESD_BUF_SIZE; + printf("Setting OSpace to: %d, %d", *arg, bufinfo->bytes); } break; |
From: Justin <th...@us...> - 2002-11-07 16:05:41
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv21943 Modified Files: esddsp.c Log Message: ESD doesn't care about frags lets see if I can use it to reset the buffers Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- esddsp.c 7 Nov 2002 05:36:50 -0000 1.16 +++ esddsp.c 7 Nov 2002 16:05:37 -0000 1.17 @@ -202,9 +202,6 @@ { struct audio_info tmpinfo; - u_int u; - int idat, retval; - static esd_format_t fmt = ESD_BITS16 | ESD_STEREO | ESD_STREAM | ESD_PLAY; static int speed; @@ -236,23 +233,10 @@ break; case SNDCTL_DSP_SETFRAGMENT: - AUDIO_INITINFO(&tmpinfo); - idat = *arg; - if ((idat & 0xffff) < 4 || (idat & 0xffff) > 17) - return EINVAL; - tmpinfo.blocksize = 1 << (idat & 0xffff); - tmpinfo.hiwat = ((unsigned)idat >> 16) & 0x7fff; - if (tmpinfo.hiwat == 0) /* 0 means set to max */ - tmpinfo.hiwat = 65536; - (void) ioctl(fd, AUDIO_SETINFO, &tmpinfo); - retval = ioctl(fd, AUDIO_GETINFO, &tmpinfo); - if (retval < 0) - return retval; - u = tmpinfo.blocksize; - for(idat = 0; u > 1; idat++, u >>= 1) - ; - idat |= (tmpinfo.hiwat & 0x7fff) << 16; - *arg = idat; + { + audio_buf_info *bufinfo = (audio_buf_info *) argp; + bufinfo->bytes = ESD_BUF_SIZE; + } break; case SNDCTL_DSP_GETFMTS: |
From: Justin <th...@us...> - 2002-11-07 05:36:53
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv23548/lib Modified Files: esddsp.c Log Message: might work, will have to try arts tomorrow I think that is all the handles it needs Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- esddsp.c 7 Nov 2002 04:40:37 -0000 1.15 +++ esddsp.c 7 Nov 2002 05:36:50 -0000 1.16 @@ -36,6 +36,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> +#include <sys/errno.h> #include "liboss/soundcard.h" #include "liboss/audioio.h" @@ -199,6 +200,11 @@ static int dspctl (int fd, request_t request, void *argp) { + struct audio_info tmpinfo; + + u_int u; + int idat, retval; + static esd_format_t fmt = ESD_BITS16 | ESD_STEREO | ESD_STREAM | ESD_PLAY; static int speed; @@ -227,6 +233,26 @@ case SNDCTL_DSP_GETBLKSIZE: *arg = ESD_BUF_SIZE; + break; + + case SNDCTL_DSP_SETFRAGMENT: + AUDIO_INITINFO(&tmpinfo); + idat = *arg; + if ((idat & 0xffff) < 4 || (idat & 0xffff) > 17) + return EINVAL; + tmpinfo.blocksize = 1 << (idat & 0xffff); + tmpinfo.hiwat = ((unsigned)idat >> 16) & 0x7fff; + if (tmpinfo.hiwat == 0) /* 0 means set to max */ + tmpinfo.hiwat = 65536; + (void) ioctl(fd, AUDIO_SETINFO, &tmpinfo); + retval = ioctl(fd, AUDIO_GETINFO, &tmpinfo); + if (retval < 0) + return retval; + u = tmpinfo.blocksize; + for(idat = 0; u > 1; idat++, u >>= 1) + ; + idat |= (tmpinfo.hiwat & 0x7fff) << 16; + *arg = idat; break; case SNDCTL_DSP_GETFMTS: |
From: Justin <th...@us...> - 2002-11-07 04:40:40
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv21338/lib Modified Files: esddsp.c Log Message: one more, hope your ready Rangerrick hehe, but it's gonna be the hardess by far Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- esddsp.c 7 Nov 2002 04:13:12 -0000 1.14 +++ esddsp.c 7 Nov 2002 04:40:37 -0000 1.15 @@ -251,6 +251,12 @@ } break; + case SNDCTL_DSP_GETTRIGGER: + case SNDCTL_DSP_SETTRIGGER: + /* XXX Do nothing for now. */ + *arg = PCM_ENABLE_OUTPUT; + break; + default: DPRINTF ("unhandled /dev/dsp ioctl (%x - %p)\n", request, argp); |
From: Justin <th...@us...> - 2002-11-07 04:13:14
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv4290/lib Modified Files: esddsp.c Log Message: One down, two to go Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- esddsp.c 6 Nov 2002 23:50:49 -0000 1.13 +++ esddsp.c 7 Nov 2002 04:13:12 -0000 1.14 @@ -237,6 +237,13 @@ *arg = 0; break; + case SNDCTL_DSP_GETISPACE: + { + audio_buf_info *bufinfo = (audio_buf_info *) argp; + bufinfo->bytes = ESD_BUF_SIZE; + } + break; + case SNDCTL_DSP_GETOSPACE: { audio_buf_info *bufinfo = (audio_buf_info *) argp; |
From: Justin <th...@us...> - 2002-11-07 04:13:14
|
Update of /cvsroot/liboss/liboss/include/liboss In directory usw-pr-cvs1:/tmp/cvs-serv4290/include/liboss Modified Files: Makefile.am Log Message: One down, two to go Index: Makefile.am =================================================================== RCS file: /cvsroot/liboss/liboss/include/liboss/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Makefile.am 6 Nov 2002 19:10:23 -0000 1.1 +++ Makefile.am 7 Nov 2002 04:13:11 -0000 1.2 @@ -2,7 +2,7 @@ ## Process this file with automake to produce Makefile.in ## -include_HEADERS = audioio.h soundcard.h soundcard_oss.h +include_HEADERS = audioio.h soundcard.h noinst_HEADERS = |
From: Justin <th...@us...> - 2002-11-07 02:46:16
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv13343/lib Removed Files: liboss.c Log Message: old files no longer needed --- liboss.c DELETED --- |
From: Justin <th...@us...> - 2002-11-07 02:46:16
|
Update of /cvsroot/liboss/liboss/include/liboss In directory usw-pr-cvs1:/tmp/cvs-serv13343/include/liboss Removed Files: soundcard_oss.h Log Message: old files no longer needed --- soundcard_oss.h DELETED --- |
From: Justin <th...@us...> - 2002-11-06 23:50:53
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv23404/lib Modified Files: esddsp.c Log Message: clean up out left over va_end calls, since they are done in the header now Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- esddsp.c 6 Nov 2002 23:34:45 -0000 1.12 +++ esddsp.c 6 Nov 2002 23:50:49 -0000 1.13 @@ -171,7 +171,6 @@ func = (int (*) (const char *, int, mode_t)) dlsym (REAL_LIBC, "_open"); mode = va_arg (args, int); - va_end (args); if (!strcmp (pathname, "/dev/dsp")) { @@ -370,7 +369,6 @@ func = (int (*) (int, request_t, void *)) dlsym (REAL_LIBC, "_ioctl"); argp = va_arg (args, void *); - va_end (args); if (fd == sndfd) return dspctl (fd, request, argp); |
From: Max H. <fin...@us...> - 2002-11-06 23:34:48
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv11645 Modified Files: esddsp.c Log Message: use the same indention rule everywhere; added two FIXME's, for the people working on this to review :-) Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- esddsp.c 6 Nov 2002 20:44:45 -0000 1.11 +++ esddsp.c 6 Nov 2002 23:34:45 -0000 1.12 @@ -94,18 +94,32 @@ { if (!ident) { + /* FIXME - the value of getenv is AFAIK guranteed to stay current during the + whole program run time. So in theory the next three lines could be replaced + by something like this: + + char *str = getenv ("ESDDSP_NAME"); + if (!str) + str = "esddsp"; + + If anybody can test it... + */ + char *str = getenv ("ESDDSP_NAME"); ident = malloc (ESD_NAME_MAX); strncpy (ident, (str ? str : "esddsp"), ESD_NAME_MAX); - use_mixer = 1; - - str = getenv ("HOME"); - if (str) - { - mixer = malloc (strlen (str) + strlen (ident) + 10); - sprintf (mixer, "%s/.esddsp_%s", str, ident); - } + use_mixer = 1; + + str = getenv ("HOME"); + /* FIXME - if $HOME is not set, mixer will stay NULL, but is passed later + on to open, leading to a potential crash. + */ + if (str) + { + mixer = malloc (strlen (str) + strlen (ident) + 10); + sprintf (mixer, "%s/.esddsp_%s", str, ident); + } } } @@ -139,10 +153,10 @@ static void liboss_init(void) { if (!acquired_handle) - { + { libSystem_handle = dlopen("/usr/lib/libSystem.dylib",RTLD_LAZY); acquired_handle = 1; - } + } dsp_init(); } |
From: Justin <th...@us...> - 2002-11-06 21:03:35
|
Update of /cvsroot/liboss/liboss/include/liboss In directory usw-pr-cvs1:/tmp/cvs-serv2463/include/liboss Modified Files: soundcard.h Log Message: I rock, works 100% with mpg123 now Index: soundcard.h =================================================================== RCS file: /cvsroot/liboss/liboss/include/liboss/soundcard.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- soundcard.h 6 Nov 2002 19:10:23 -0000 1.1 +++ soundcard.h 6 Nov 2002 21:03:30 -0000 1.2 @@ -328,12 +328,15 @@ # define LIBOSS_CLOSE close #endif -extern int liboss_write (int, const void *, size_t); +#ifndef LIBOSS_WRITE +# define LIBOSS_WRITE write +#endif #ifndef LIBOSS_INTERNAL extern int liboss_ioctl (int,unsigned long,va_list); extern int liboss_open (const char *,int,va_list); extern int liboss_close (int); +extern int liboss_write (int, const void *, size_t); static inline int LIBOSS_IOCTL (int x, unsigned long y,...) { @@ -358,10 +361,19 @@ } static inline int LIBOSS_CLOSE (int x) {liboss_close(x); return x;} + +static inline int LIBOSS_WRITE (int x, const void *y, size_t l) +{ + int result; + + result = liboss_write(x,y,l); + return result; +} #else extern int liboss_ioctl (int,unsigned long,va_list); extern int liboss_open (const char *,int,va_list); extern int liboss_close (int); +extern int liboss_write (int, const void *, size_t); #endif __END_DECLS #endif /* !_SOUNDCARD_H_ */ |
From: Justin <th...@us...> - 2002-11-06 21:03:35
|
Update of /cvsroot/liboss/liboss/src In directory usw-pr-cvs1:/tmp/cvs-serv2463/src Modified Files: osscat.c Log Message: I rock, works 100% with mpg123 now Index: osscat.c =================================================================== RCS file: /cvsroot/liboss/liboss/src/osscat.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- osscat.c 6 Nov 2002 20:14:43 -0000 1.12 +++ osscat.c 6 Nov 2002 21:03:32 -0000 1.13 @@ -88,7 +88,7 @@ return retval; while ( (sz = fread(buf, 1, BUF_SIZE, source)) > 0 ) { - if (liboss_write(play, buf, sz) <= 0) + if (write(play, buf, sz) <= 0) return 1; } |
From: Justin <th...@us...> - 2002-11-06 20:44:49
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv24336/lib Modified Files: esddsp.c Log Message: this creates bus errors for now Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- esddsp.c 6 Nov 2002 20:14:42 -0000 1.10 +++ esddsp.c 6 Nov 2002 20:44:45 -0000 1.11 @@ -186,29 +186,20 @@ static int dspctl (int fd, request_t request, void *argp) { - static esd_format_t fmt = ESD_BITS16 | ESD_MONO | ESD_STREAM | ESD_PLAY; + static esd_format_t fmt = ESD_BITS16 | ESD_STEREO | ESD_STREAM | ESD_PLAY; static int speed; int *arg = (int *) argp; - int retval = 0; switch (request) { case SNDCTL_DSP_RESET: - retval = liboss_ioctl(fd, AUDIO_FLUSH, 0); - if (retval < 0) - return retval; - break; - - case SNDCTL_DSP_SYNC: - retval = liboss_ioctl(fd, AUDIO_DRAIN, 0); - if (retval < 0) - return retval; + case SNDCTL_DSP_POST: break; - case SNDCTL_DSP_POST: - /* This call is merely advisory, and may be a nop. */ - /* Execpt that it is relevant for fragment implementations */ + case SNDCTL_DSP_SETFMT: + fmt |= (*arg & 0x30) ? ESD_BITS16 : ESD_BITS8; + settings |= 1; break; case SNDCTL_DSP_SPEED: @@ -225,11 +216,6 @@ *arg = ESD_BUF_SIZE; break; - case SNDCTL_DSP_SETFMT: - fmt |= (*arg & 0x30) ? ESD_BITS16 : ESD_BITS8; - settings |= 1; - break; - case SNDCTL_DSP_GETFMTS: *arg = 0x38; break; @@ -266,7 +252,7 @@ if (write(sndfd, ident, ESD_NAME_MAX) != ESD_NAME_MAX) return -1; - fmt = ESD_BITS16 | ESD_MONO | ESD_STREAM | ESD_PLAY; + fmt = ESD_BITS16 | ESD_STEREO | ESD_STREAM | ESD_PLAY; speed = 0; if (use_mixer) |
From: Justin <th...@us...> - 2002-11-06 20:14:46
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv7363/lib Modified Files: esddsp.c Log Message: Works much much better, gonna see if I can get mpg123 to work now Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- esddsp.c 6 Nov 2002 19:10:23 -0000 1.9 +++ esddsp.c 6 Nov 2002 20:14:42 -0000 1.10 @@ -186,7 +186,7 @@ static int dspctl (int fd, request_t request, void *argp) { - static esd_format_t fmt = ESD_STREAM | ESD_PLAY | ESD_MONO; + static esd_format_t fmt = ESD_BITS16 | ESD_MONO | ESD_STREAM | ESD_PLAY; static int speed; int *arg = (int *) argp; @@ -257,16 +257,16 @@ done = 1; - if (write (sndfd, &proto, sizeof (proto)) != sizeof (proto)) + if (write(sndfd, &proto, sizeof (proto)) != sizeof (proto)) return -1; - if (write (sndfd, &fmt, sizeof (fmt)) != sizeof (fmt)) + if (write(sndfd, &fmt, sizeof (fmt)) != sizeof (fmt)) return -1; - if (write (sndfd, &speed, sizeof (speed)) != sizeof (speed)) + if (write(sndfd, &speed, sizeof (speed)) != sizeof (speed)) return -1; - if (write (sndfd, ident, ESD_NAME_MAX) != ESD_NAME_MAX) + if (write(sndfd, ident, ESD_NAME_MAX) != ESD_NAME_MAX) return -1; - fmt = ESD_STREAM | ESD_PLAY | ESD_MONO; + fmt = ESD_BITS16 | ESD_MONO | ESD_STREAM | ESD_PLAY; speed = 0; if (use_mixer) @@ -407,7 +407,7 @@ for (i = (short*)buf; i < (short*)(buf + sz); ++i) *i = NXSwapShort(*i); - retval = write(play, buf, sz); /* if it errors, keep going */ + retval = write(play, buf, sz); return retval; } |
From: Justin <th...@us...> - 2002-11-06 20:14:46
|
Update of /cvsroot/liboss/liboss/src In directory usw-pr-cvs1:/tmp/cvs-serv7363/src Modified Files: osscat.c Log Message: Works much much better, gonna see if I can get mpg123 to work now Index: osscat.c =================================================================== RCS file: /cvsroot/liboss/liboss/src/osscat.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- osscat.c 6 Nov 2002 19:10:23 -0000 1.11 +++ osscat.c 6 Nov 2002 20:14:43 -0000 1.12 @@ -4,52 +4,92 @@ #include <stdio.h> #include <unistd.h> #include <stdlib.h> +#include <dirent.h> +#include <sys/stat.h> +#include <string.h> /* FIXME: Add capability for recording with 'libosscat /dev/audio > somefile' */ /* How to play the sound */ -#define BUF_SIZE 1024 +#define BUF_SIZE ESD_BUF_SIZE #define DEVICE "/dev/dsp" /* What kind of sound is this, anyway? */ /* NB: .wav is usually {1, 16, 20500, 0} */ -#define STEREO 0 -#define BITS 16 -#define RATE 20500 +#define STEREO ESD_STEREO +#define BITS ESD_BITS16 +#define RATE ESD_DEFAULT_RATE #define ENDIAN LITTLE_ENDIAN int main(int argc, char **argv) { - int fd, play, format, stereo, speed, sz; + int retval = 0, arg = 0; + int play, sz; + + int stereo = STEREO, speed = RATE; + int bits = BITS; + char buf[BUF_SIZE]; + + FILE *source = NULL; + char *name = NULL; - if (argc != 2) { - fprintf(stderr, "Usage: osscat file\n"); - exit(1); - } - - if ((fd = open(argv[1], O_RDONLY, 0)) < 0) { - fprintf(stderr, "File %s could not be opened.\n", argv[1]); - exit(1); + for (arg = 1; arg < argc; arg++) + { + if (!strcmp("-h",argv[arg])) + { + printf("usage:\n\t%s {-b} [-m} [-r freq] < file\n", + argv[0]); + exit(0); + } + else if (!strcmp("-b", argv[arg])) + bits = ESD_BITS8; + else if (!strcmp("-m", argv[arg])) + stereo = ESD_MONO; + else if (!strcmp("-r", argv[arg])) + { + arg++; + speed = atoi(argv[arg]); + } else if (source) { + printf("%s: ignoring extra file '%s'\n", argv[0], + argv[arg]); + } else { + name = argv[arg]; + if ((source = fopen(name, "r")) == NULL) + { + printf("%s: couldn't open sound file: %s\n", + argv[0], name); + return 1; + } + } } - + + if (!source) + source = stdin; + if ((play = open(DEVICE, O_WRONLY, 0)) < 0) { fprintf(stderr, "%s could not be opened.\n", DEVICE); exit(1); } - - format = (BITS == 16) ? AFMT_S16_NE : AFMT_S8; - ioctl(play, SNDCTL_DSP_SETFMT, &format); - stereo = STEREO; - ioctl(play, SNDCTL_DSP_STEREO, &stereo); - speed = RATE; - ioctl(play, SNDCTL_DSP_SPEED, &speed); - - while ( (sz = read(fd, buf, BUF_SIZE)) > 0 ) { - liboss_write(play, buf, sz); /* if it errors, keep going */ + int format = (bits == 16) ? AFMT_S16_NE : AFMT_S8; + retval = ioctl(play, SNDCTL_DSP_SETFMT, &format); + if (retval < 0) + return retval; + + retval = ioctl(play, SNDCTL_DSP_STEREO, &stereo); + if (retval < 0) + return retval; + + retval = ioctl(play, SNDCTL_DSP_SPEED, &speed); + if (retval < 0) + return retval; + + while ( (sz = fread(buf, 1, BUF_SIZE, source)) > 0 ) { + if (liboss_write(play, buf, sz) <= 0) + return 1; } return 0; |
From: Benjamin R. <ran...@us...> - 2002-11-06 19:10:27
|
Update of /cvsroot/liboss/liboss/src In directory usw-pr-cvs1:/tmp/cvs-serv5021/src Modified Files: osscat.c Log Message: moved the includes around a bit Index: osscat.c =================================================================== RCS file: /cvsroot/liboss/liboss/src/osscat.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- osscat.c 6 Nov 2002 18:51:35 -0000 1.10 +++ osscat.c 6 Nov 2002 19:10:23 -0000 1.11 @@ -1,6 +1,6 @@ #include "config.h" -#include "soundcard.h" +#include "liboss/soundcard.h" #include <stdio.h> #include <unistd.h> #include <stdlib.h> |
From: Benjamin R. <ran...@us...> - 2002-11-06 19:10:27
|
Update of /cvsroot/liboss/liboss/lib In directory usw-pr-cvs1:/tmp/cvs-serv5021/lib Modified Files: esddsp.c Log Message: moved the includes around a bit Index: esddsp.c =================================================================== RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- esddsp.c 6 Nov 2002 18:51:35 -0000 1.8 +++ esddsp.c 6 Nov 2002 19:10:23 -0000 1.9 @@ -37,8 +37,8 @@ #include <sys/stat.h> #include <stdio.h> -#include "soundcard.h" -#include "audioio.h" +#include "liboss/soundcard.h" +#include "liboss/audioio.h" #include <esd.h> |
From: Benjamin R. <ran...@us...> - 2002-11-06 19:10:26
|
Update of /cvsroot/liboss/liboss/include/liboss In directory usw-pr-cvs1:/tmp/cvs-serv5021/include/liboss Added Files: .cvsignore Makefile.am audioio.h soundcard.h soundcard_oss.h Log Message: moved the includes around a bit --- NEW FILE: .cvsignore --- Makefile Makefile.in --- NEW FILE: Makefile.am --- ## ## Process this file with automake to produce Makefile.in ## include_HEADERS = audioio.h soundcard.h soundcard_oss.h noinst_HEADERS = ### # Install header files (default=$includedir/liboss) # install-includeHEADERS: @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(includedir)/liboss @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/liboss/$$p"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/liboss/$$p; \ done ### # Remove them # uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) list='$(include_HEADERS)'; for p in $$list; do \ rm -f $(DESTDIR)$(includedir)/liboss/$$p; \ done mostlyclean-generic: -rm -f *~ \#* .*~ .\#* maintainer-clean-generic: -@echo "This command is intended for maintainers to use;" -@echo "it deletes files that may require special tools to rebuild." -rm -f Makefile.in --- NEW FILE: audioio.h --- /* $NetBSD: audioio.h,v 1.25.2.1 2002/10/18 02:45:38 nathanw Exp $ */ /* * Copyright (c) 1991-1993 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the Computer Systems * Engineering Group at Lawrence Berkeley Laboratory. * 4. Neither the name of the University nor of the Laboratory may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef _SYS_AUDIOIO_H_ #define _SYS_AUDIOIO_H_ /* * Audio device */ struct audio_prinfo { u_int sample_rate; /* sample rate in bit/s */ u_int channels; /* number of channels, usually 1 or 2 */ u_int precision; /* number of bits/sample */ u_int encoding; /* data encoding (AUDIO_ENCODING_* below) */ u_int gain; /* volume level */ u_int port; /* selected I/O port */ u_int seek; /* BSD extension */ u_int avail_ports; /* available I/O ports */ u_int buffer_size; /* total size audio buffer */ u_int _ispare[1]; /* Current state of device: */ u_int samples; /* number of samples */ u_int eof; /* End Of File (zero-size writes) counter */ u_char pause; /* non-zero if paused, zero to resume */ u_char error; /* non-zero if underflow/overflow ocurred */ u_char waiting; /* non-zero if another process hangs in open */ u_char balance; /* stereo channel balance */ u_char cspare[2]; u_char open; /* non-zero if currently open */ u_char active; /* non-zero if I/O is currently active */ }; typedef struct audio_prinfo audio_prinfo_t; struct audio_info { struct audio_prinfo play; /* Info for play (output) side */ struct audio_prinfo record; /* Info for record (input) side */ u_int monitor_gain; /* input to output mix */ /* BSD extensions */ u_int blocksize; /* H/W read/write block size */ u_int hiwat; /* output high water mark */ u_int lowat; /* output low water mark */ u_int _ispare1; u_int mode; /* current device mode */ #define AUMODE_PLAY 0x01 #define AUMODE_RECORD 0x02 #define AUMODE_PLAY_ALL 0x04 /* don't do real-time correction */ }; typedef struct audio_info audio_info_t; #define AUDIO_INITINFO(p) \ (void)memset((void *)(p), 0xff, sizeof(struct audio_info)) /* * Parameter for the AUDIO_GETDEV ioctl to determine current * audio devices. */ #define MAX_AUDIO_DEV_LEN 16 typedef struct audio_device { char name[MAX_AUDIO_DEV_LEN]; char version[MAX_AUDIO_DEV_LEN]; char config[MAX_AUDIO_DEV_LEN]; } audio_device_t; typedef struct audio_offset { u_int samples; /* Total number of bytes transferred */ u_int deltablks; /* Blocks transferred since last checked */ u_int offset; /* Physical transfer offset in buffer */ } audio_offset_t; /* * Supported audio encodings */ /* Encoding ID's */ #define AUDIO_ENCODING_NONE 0 /* no encoding assigned */ #define AUDIO_ENCODING_ULAW 1 /* ITU G.711 mu-law */ #define AUDIO_ENCODING_ALAW 2 /* ITU G.711 A-law */ #define AUDIO_ENCODING_PCM16 3 /* signed linear PCM, obsolete */ #define AUDIO_ENCODING_LINEAR AUDIO_ENCODING_PCM16 /* SunOS compat */ #define AUDIO_ENCODING_PCM8 4 /* unsigned linear PCM, obsolete */ #define AUDIO_ENCODING_LINEAR8 AUDIO_ENCODING_PCM8 /* SunOS compat */ #define AUDIO_ENCODING_ADPCM 5 /* adaptive differential PCM */ #define AUDIO_ENCODING_SLINEAR_LE 6 #define AUDIO_ENCODING_SLINEAR_BE 7 #define AUDIO_ENCODING_ULINEAR_LE 8 #define AUDIO_ENCODING_ULINEAR_BE 9 #define AUDIO_ENCODING_SLINEAR 10 #define AUDIO_ENCODING_ULINEAR 11 #define AUDIO_ENCODING_MPEG_L1_STREAM 12 #define AUDIO_ENCODING_MPEG_L1_PACKETS 13 #define AUDIO_ENCODING_MPEG_L1_SYSTEM 14 #define AUDIO_ENCODING_MPEG_L2_STREAM 15 #define AUDIO_ENCODING_MPEG_L2_PACKETS 16 #define AUDIO_ENCODING_MPEG_L2_SYSTEM 17 typedef struct audio_encoding { int index; char name[MAX_AUDIO_DEV_LEN]; int encoding; int precision; int flags; #define AUDIO_ENCODINGFLAG_EMULATED 1 /* software emulation mode */ } audio_encoding_t; /* * Balance settings. */ #define AUDIO_LEFT_BALANCE 0 /* left channel only */ #define AUDIO_MID_BALANCE 32 /* equal left/right channel */ #define AUDIO_RIGHT_BALANCE 64 /* right channel only */ #define AUDIO_BALANCE_SHIFT 3 /* * Output ports */ #define AUDIO_SPEAKER 0x01 /* built-in speaker */ #define AUDIO_HEADPHONE 0x02 /* headphone jack */ #define AUDIO_LINE_OUT 0x04 /* line out */ /* * Input ports */ #define AUDIO_MICROPHONE 0x01 /* microphone */ #define AUDIO_LINE_IN 0x02 /* line in */ #define AUDIO_CD 0x04 /* on-board CD inputs */ #define AUDIO_INTERNAL_CD_IN AUDIO_CD /* internal CDROM */ /* * Audio device operations */ #define AUDIO_GETINFO _IOR('A', 21, struct audio_info) #define AUDIO_SETINFO _IOWR('A', 22, struct audio_info) #define AUDIO_DRAIN _IO('A', 23) #define AUDIO_FLUSH _IO('A', 24) #define AUDIO_WSEEK _IOR('A', 25, u_long) #define AUDIO_RERROR _IOR('A', 26, int) #define AUDIO_GETDEV _IOR('A', 27, struct audio_device) #define AUDIO_GETENC _IOWR('A', 28, struct audio_encoding) #define AUDIO_GETFD _IOR('A', 29, int) #define AUDIO_SETFD _IOWR('A', 30, int) #define AUDIO_PERROR _IOR('A', 31, int) #define AUDIO_GETIOFFS _IOR('A', 32, struct audio_offset) #define AUDIO_GETOOFFS _IOR('A', 33, struct audio_offset) #define AUDIO_GETPROPS _IOR('A', 34, int) #define AUDIO_PROP_FULLDUPLEX 0x01 #define AUDIO_PROP_MMAP 0x02 #define AUDIO_PROP_INDEPENDENT 0x04 /* * Mixer device */ #define AUDIO_MIN_GAIN 0 #define AUDIO_MAX_GAIN 255 typedef struct mixer_level { int num_channels; u_char level[8]; /* [num_channels] */ } mixer_level_t; #define AUDIO_MIXER_LEVEL_MONO 0 #define AUDIO_MIXER_LEVEL_LEFT 0 #define AUDIO_MIXER_LEVEL_RIGHT 1 /* * Device operations */ typedef struct audio_mixer_name { char name[MAX_AUDIO_DEV_LEN]; int msg_id; } audio_mixer_name_t; typedef struct mixer_devinfo { int index; audio_mixer_name_t label; int type; #define AUDIO_MIXER_CLASS 0 #define AUDIO_MIXER_ENUM 1 #define AUDIO_MIXER_SET 2 #define AUDIO_MIXER_VALUE 3 int mixer_class; int next, prev; #define AUDIO_MIXER_LAST -1 union { struct audio_mixer_enum { int num_mem; struct { audio_mixer_name_t label; int ord; } member[32]; } e; struct audio_mixer_set { int num_mem; struct { audio_mixer_name_t label; int mask; } member[32]; } s; struct audio_mixer_value { audio_mixer_name_t units; int num_channels; int delta; } v; } un; } mixer_devinfo_t; typedef struct mixer_ctrl { int dev; int type; union { int ord; /* enum */ int mask; /* set */ mixer_level_t value; /* value */ } un; } mixer_ctrl_t; /* * Mixer operations */ #define AUDIO_MIXER_READ _IOWR('M', 0, mixer_ctrl_t) #define AUDIO_MIXER_WRITE _IOWR('M', 1, mixer_ctrl_t) #define AUDIO_MIXER_DEVINFO _IOWR('M', 2, mixer_devinfo_t) /* * Well known device names */ #define AudioNmicrophone "mic" #define AudioNline "line" #define AudioNcd "cd" #define AudioNdac "dac" #define AudioNaux "aux" #define AudioNrecord "record" #define AudioNvolume "volume" #define AudioNmonitor "monitor" #define AudioNtreble "treble" #define AudioNmid "mid" #define AudioNbass "bass" #define AudioNbassboost "bassboost" #define AudioNspeaker "speaker" #define AudioNheadphone "headphones" #define AudioNoutput "output" #define AudioNinput "input" #define AudioNmaster "master" #define AudioNstereo "stereo" #define AudioNmono "mono" #define AudioNloudness "loudness" #define AudioNspatial "spatial" #define AudioNsurround "surround" #define AudioNpseudo "pseudo" #define AudioNmute "mute" #define AudioNenhanced "enhanced" #define AudioNpreamp "preamp" #define AudioNon "on" #define AudioNoff "off" #define AudioNmode "mode" #define AudioNsource "source" #define AudioNfmsynth "fmsynth" #define AudioNwave "wave" #define AudioNmidi "midi" #define AudioNmixerout "mixerout" #define AudioNswap "swap" /* swap left and right channels */ #define AudioNagc "agc" #define AudioNdelay "delay" #define AudioNselect "select" /* select destination */ #define AudioNvideo "video" #define AudioNcenter "center" #define AudioNdepth "depth" #define AudioNlfe "lfe" #define AudioEmulaw "mulaw" #define AudioEalaw "alaw" #define AudioEadpcm "adpcm" #define AudioEslinear "slinear" #define AudioEslinear_le "slinear_le" #define AudioEslinear_be "slinear_be" #define AudioEulinear "ulinear" #define AudioEulinear_le "ulinear_le" #define AudioEulinear_be "ulinear_be" #define AudioEmpeg_l1_stream "mpeg_l1_stream" #define AudioEmpeg_l1_packets "mpeg_l1_packets" #define AudioEmpeg_l1_system "mpeg_l1_system" #define AudioEmpeg_l2_stream "mpeg_l2_stream" #define AudioEmpeg_l2_packets "mpeg_l2_packets" #define AudioEmpeg_l2_system "mpeg_l2_system" #define AudioCinputs "inputs" #define AudioCoutputs "outputs" #define AudioCrecord "record" #define AudioCmonitor "monitor" #define AudioCequalization "equalization" #endif /* !_SYS_AUDIOIO_H_ */ --- NEW FILE: soundcard.h --- /* $NetBSD: soundcard.h,v 1.10.4.2 2002/02/06 14:04:46 he Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Lennart Augustsson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _SOUNDCARD_H_ #define _SOUNDCARD_H_ #include <sys/cdefs.h> __BEGIN_DECLS /* FIXME: what is this? */ #define SOUND_VERSION 0x030001 /* SNDCTL Defines */ #define SNDCTL_DSP_RESET _IO ('P', 0) #define SNDCTL_DSP_SYNC _IO ('P', 1) #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) #define SNDCTL_DSP_GETBLKSIZE _IOWR('P', 4, int) #define SNDCTL_DSP_SETFMT _IOWR('P', 5, int) #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT #define SNDCTL_DSP_CHANNELS _IOWR('P', 6, int) #define SNDCTL_DSP_POST _IO ('P', 8) #define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int) #define SNDCTL_DSP_SETFRAGMENT _IOWR('P', 10, int) #define SNDCTL_DSP_GETFMTS _IOR ('P', 11, int) #define SNDCTL_DSP_GETOSPACE _IOR ('P',12, struct audio_buf_info) #define SNDCTL_DSP_GETISPACE _IOR ('P',13, struct audio_buf_info) #define SNDCTL_DSP_NONBLOCK _IO ('P',14) #define SNDCTL_DSP_GETCAPS _IOR ('P',15, int) #define SNDCTL_DSP_GETTRIGGER _IOR ('P', 16, int) #define SNDCTL_DSP_SETTRIGGER _IOW ('P', 16, int) #define SNDCTL_DSP_GETIPTR _IOR ('P', 17, struct count_info) #define SNDCTL_DSP_GETOPTR _IOR ('P', 18, struct count_info) #define SNDCTL_DSP_MAPINBUF _IOR ('P', 19, struct buffmem_desc) #define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, struct buffmem_desc) #define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) #define SNDCTL_DSP_SETDUPLEX _IO ('P', 22) #define SNDCTL_DSP_PROFILE _IOW ('P', 23, int) /* AFMT Defines */ #define AFMT_QUERY 0x00000000 #define AFMT_MU_LAW 0x00000001 #define AFMT_A_LAW 0x00000002 #define AFMT_IMA_ADPCM 0x00000004 #define AFMT_U8 0x00000008 #define AFMT_S16_LE 0x00000010 #define AFMT_S16_BE 0x00000020 #define AFMT_S8 0x00000040 #define AFMT_U16_LE 0x00000080 #define AFMT_U16_BE 0x00000100 #define AFMT_MPEG 0x00000200 /* SOUND Defines */ #define SOUND_PCM_READ_RATE _IOR ('P', 2, int) #define SOUND_PCM_READ_BITS _IOR ('P', 5, int) #define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS #define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int) #define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int) #define SOUND_PCM_READ_FILTER _IOR ('P', 7, int) /* DSP Defines */ #define DSP_CAP_REVISION 0x000000ff #define DSP_CAP_DUPLEX 0x00000100 #define DSP_CAP_REALTIME 0x00000200 #define DSP_CAP_BATCH 0x00000400 #define DSP_CAP_COPROC 0x00000800 #define DSP_CAP_TRIGGER 0x00001000 #define DSP_CAP_MMAP 0x00002000 /* PCM Defines */ #define PCM_ENABLE_INPUT 0x00000001 #define PCM_ENABLE_OUTPUT 0x00000002 /* APF Defines */ #define APF_NORMAL 0 #define APF_NETWORK 1 #define APF_CPUINTENS 2 /* Need native 16 bit format which depends on byte order */ #include <machine/endian.h> #include <machine/byte_order.h> #if _BYTE_ORDER == _LITTLE_ENDIAN #define AFMT_S16_NE AFMT_S16_LE #else #define AFMT_S16_NE AFMT_S16_BE #endif #if _BYTE_ORDER == _LITTLE_ENDIAN #define AFMT_U16_NE AFMT_U16_LE #else #define AFMT_U16_NE AFMT_U16_BE #endif #if _BYTE_ORDER == _LITTLE_ENDIAN #define OSS_LITTLE_ENDIAN #else #define OSS_BIG_ENDIAN #endif /* Aliases */ #define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT #define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED #define SOUND_PCM_POST SNDCTL_DSP_POST #define SOUND_PCM_RESET SNDCTL_DSP_RESET #define SOUND_PCM_SYNC SNDCTL_DSP_SYNC #define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE #define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT #define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS #define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT #define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE #define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE #define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK #define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS #define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER #define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER #define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO #define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR #define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR #define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF #define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF /* Mixer defines */ #define SOUND_MIXER_FIRST 0 #define SOUND_MIXER_NRDEVICES 25 #define SOUND_MIXER_VOLUME 0 #define SOUND_MIXER_BASS 1 #define SOUND_MIXER_TREBLE 2 #define SOUND_MIXER_SYNTH 3 #define SOUND_MIXER_PCM 4 #define SOUND_MIXER_SPEAKER 5 #define SOUND_MIXER_LINE 6 #define SOUND_MIXER_MIC 7 #define SOUND_MIXER_CD 8 #define SOUND_MIXER_IMIX 9 #define SOUND_MIXER_ALTPCM 10 #define SOUND_MIXER_RECLEV 11 #define SOUND_MIXER_IGAIN 12 #define SOUND_MIXER_OGAIN 13 #define SOUND_MIXER_LINE1 14 #define SOUND_MIXER_LINE2 15 #define SOUND_MIXER_LINE3 16 #define SOUND_MIXER_DIGITAL1 17 #define SOUND_MIXER_DIGITAL2 18 #define SOUND_MIXER_DIGITAL3 19 #define SOUND_MIXER_PHONEIN 20 #define SOUND_MIXER_PHONEOUT 21 #define SOUND_MIXER_VIDEO 22 #define SOUND_MIXER_RADIO 23 #define SOUND_MIXER_MONITOR 24 #define SOUND_ONOFF_MIN 28 #define SOUND_ONOFF_MAX 30 #define SOUND_MIXER_NONE 31 #define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \ "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \ "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \ "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"} #define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \ "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \ "line1", "line2", "line3", "dig1", "dig2", "dig3", \ "phin", "phout", "video", "radio", "monitor"} #define SOUND_MIXER_RECSRC 0xff #define SOUND_MIXER_DEVMASK 0xfe #define SOUND_MIXER_RECMASK 0xfd #define SOUND_MIXER_CAPS 0xfc #define SOUND_CAP_EXCL_INPUT 1 #define SOUND_MIXER_STEREODEVS 0xfb #define MIXER_READ(dev) _IOR('M', dev, int) #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC) #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK) #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK) #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS) #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS) #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME) #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS) #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE) #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH) #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM) #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER) #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE) #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC) #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD) #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX) #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM) #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV) #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN) #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN) #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1) #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) #define MIXER_WRITE(dev) _IOW ('M', dev, int) #define MIXER_WRITE_R(dev) _IOWR('M', dev, int) #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) #define SOUND_MIXER_WRITE_R_RECSRC MIXER_WRITE_R(SOUND_MIXER_RECSRC) #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME) #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS) #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE) #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH) #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER) #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE) #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC) #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD) #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX) #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM) #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV) #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN) #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN) #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1) #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME) #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS) #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE) #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH) #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM) #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER) #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE) #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC) #define SOUND_MASK_CD (1 << SOUND_MIXER_CD) #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX) #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM) #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV) #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN) #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN) #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) typedef struct mixer_info { char id[16]; char name[32]; int modify_counter; int fillers[10]; } mixer_info; typedef struct _old_mixer_info { char id[16]; char name[32]; } _old_mixer_info; #define SOUND_MIXER_INFO _IOR('M', 101, mixer_info) #define SOUND_OLD_MIXER_INFO _IOR('M', 101, _old_mixer_info) #define OSS_GETVERSION _IOR ('M', 118, int) typedef struct audio_buf_info { int fragments; int fragstotal; int fragsize; int bytes; } audio_buf_info; typedef struct count_info { int bytes; int blocks; int ptr; } count_info; typedef struct buffmem_desc { unsigned int *buffer; int size; } buffmem_desc; /* Make sure we don't override the headers by accident! */ #include <fcntl.h> #include <sys/ioctl.h> #include <stdio.h> #include <stdarg.h> #include <unistd.h> #include <esd.h> #undef ioctl #undef open #undef close #ifndef LIBOSS_IOCTL # define LIBOSS_IOCTL ioctl #endif #ifndef LIBOSS_OPEN # define LIBOSS_OPEN open #endif #ifndef LIBOSS_CLOSE # define LIBOSS_CLOSE close #endif extern int liboss_write (int, const void *, size_t); #ifndef LIBOSS_INTERNAL extern int liboss_ioctl (int,unsigned long,va_list); extern int liboss_open (const char *,int,va_list); extern int liboss_close (int); static inline int LIBOSS_IOCTL (int x, unsigned long y,...) { int result; va_list l; va_start(l,y); result = liboss_ioctl(x,y,l); va_end (l); return result; } static inline int LIBOSS_OPEN (const char* x, int y,...) { int result; va_list l; va_start(l,y); result = liboss_open(x,y,l); va_end (l); return result; } static inline int LIBOSS_CLOSE (int x) {liboss_close(x); return x;} #else extern int liboss_ioctl (int,unsigned long,va_list); extern int liboss_open (const char *,int,va_list); extern int liboss_close (int); #endif __END_DECLS #endif /* !_SOUNDCARD_H_ */ --- NEW FILE: soundcard_oss.h --- /* $NetBSD: soundcard.h,v 1.13 2002/05/27 14:42:15 wiz Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Lennart Augustsson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * WARNING! WARNING! * This is an OSS (Linux) audio emulator. * Use the Native NetBSD API for developing new code, and this * only for compiling Linux programs. */ #ifndef _SOUNDCARD_H_ #define _SOUNDCARD_H_ #define SOUND_VERSION 0x030001 #define SNDCTL_DSP_RESET _IO ('P', 0) #define SNDCTL_DSP_SYNC _IO ('P', 1) #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) #define SOUND_PCM_READ_RATE _IOR ('P', 2, int) #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) #define SNDCTL_DSP_GETBLKSIZE _IOWR('P', 4, int) #define SNDCTL_DSP_SETFMT _IOWR('P', 5, int) #define AFMT_QUERY 0x00000000 #define AFMT_MU_LAW 0x00000001 #define AFMT_A_LAW 0x00000002 #define AFMT_IMA_ADPCM 0x00000004 #define AFMT_U8 0x00000008 #define AFMT_S16_LE 0x00000010 #define AFMT_S16_BE 0x00000020 #define AFMT_S8 0x00000040 #define AFMT_U16_LE 0x00000080 #define AFMT_U16_BE 0x00000100 #define AFMT_MPEG 0x00000200 #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT #define SOUND_PCM_READ_BITS _IOR ('P', 5, int) #define SNDCTL_DSP_CHANNELS _IOWR('P', 6, int) #define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS #define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int) #define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int) #define SOUND_PCM_READ_FILTER _IOR ('P', 7, int) #define SNDCTL_DSP_POST _IO ('P', 8) #define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int) #define SNDCTL_DSP_SETFRAGMENT _IOWR('P', 10, int) #define SNDCTL_DSP_GETFMTS _IOR ('P', 11, int) #define SNDCTL_DSP_GETOSPACE _IOR ('P',12, struct audio_buf_info) #define SNDCTL_DSP_GETISPACE _IOR ('P',13, struct audio_buf_info) #define SNDCTL_DSP_NONBLOCK _IO ('P',14) #define SNDCTL_DSP_GETCAPS _IOR ('P',15, int) # define DSP_CAP_REVISION 0x000000ff # define DSP_CAP_DUPLEX 0x00000100 # define DSP_CAP_REALTIME 0x00000200 # define DSP_CAP_BATCH 0x00000400 # define DSP_CAP_COPROC 0x00000800 # define DSP_CAP_TRIGGER 0x00001000 # define DSP_CAP_MMAP 0x00002000 #define SNDCTL_DSP_GETTRIGGER _IOR ('P', 16, int) #define SNDCTL_DSP_SETTRIGGER _IOW ('P', 16, int) # define PCM_ENABLE_INPUT 0x00000001 # define PCM_ENABLE_OUTPUT 0x00000002 #define SNDCTL_DSP_GETIPTR _IOR ('P', 17, struct count_info) #define SNDCTL_DSP_GETOPTR _IOR ('P', 18, struct count_info) #define SNDCTL_DSP_MAPINBUF _IOR ('P', 19, struct buffmem_desc) #define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, struct buffmem_desc) #define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) #define SNDCTL_DSP_SETDUPLEX _IO ('P', 22) #define SNDCTL_DSP_PROFILE _IOW ('P', 23, int) #define APF_NORMAL 0 #define APF_NETWORK 1 #define APF_CPUINTENS 2 /* Need native 16 bit format which depends on byte order */ #include <machine/endian.h> #if _BYTE_ORDER == _LITTLE_ENDIAN #define AFMT_S16_NE AFMT_S16_LE #else #define AFMT_S16_NE AFMT_S16_BE #endif /* Aliases */ #define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT #define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED #define SOUND_PCM_POST SNDCTL_DSP_POST #define SOUND_PCM_RESET SNDCTL_DSP_RESET #define SOUND_PCM_SYNC SNDCTL_DSP_SYNC #define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE #define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT #define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS #define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT #define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE #define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE #define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK #define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS #define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER #define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER #define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO #define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR #define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR #define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF #define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF /* Mixer defines */ #define SOUND_MIXER_FIRST 0 #define SOUND_MIXER_NRDEVICES 25 #define SOUND_MIXER_VOLUME 0 #define SOUND_MIXER_BASS 1 #define SOUND_MIXER_TREBLE 2 #define SOUND_MIXER_SYNTH 3 #define SOUND_MIXER_PCM 4 #define SOUND_MIXER_SPEAKER 5 #define SOUND_MIXER_LINE 6 #define SOUND_MIXER_MIC 7 #define SOUND_MIXER_CD 8 #define SOUND_MIXER_IMIX 9 #define SOUND_MIXER_ALTPCM 10 #define SOUND_MIXER_RECLEV 11 #define SOUND_MIXER_IGAIN 12 #define SOUND_MIXER_OGAIN 13 #define SOUND_MIXER_LINE1 14 #define SOUND_MIXER_LINE2 15 #define SOUND_MIXER_LINE3 16 #define SOUND_MIXER_DIGITAL1 17 #define SOUND_MIXER_DIGITAL2 18 #define SOUND_MIXER_DIGITAL3 19 #define SOUND_MIXER_PHONEIN 20 #define SOUND_MIXER_PHONEOUT 21 #define SOUND_MIXER_VIDEO 22 #define SOUND_MIXER_RADIO 23 #define SOUND_MIXER_MONITOR 24 #define SOUND_ONOFF_MIN 28 #define SOUND_ONOFF_MAX 30 #define SOUND_MIXER_NONE 31 #define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \ "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \ "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \ "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"} #define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \ "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \ "line1", "line2", "line3", "dig1", "dig2", "dig3", \ "phin", "phout", "video", "radio", "monitor"} #define SOUND_MIXER_RECSRC 0xff #define SOUND_MIXER_DEVMASK 0xfe #define SOUND_MIXER_RECMASK 0xfd #define SOUND_MIXER_CAPS 0xfc #define SOUND_CAP_EXCL_INPUT 1 #define SOUND_MIXER_STEREODEVS 0xfb #define MIXER_READ(dev) _IOR('M', dev, int) #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC) #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK) #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK) #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS) #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS) #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME) #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS) #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE) #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH) #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM) #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER) #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE) #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC) #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD) #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX) #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM) #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV) #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN) #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN) #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1) #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) #define MIXER_WRITE(dev) _IOW ('M', dev, int) #define MIXER_WRITE_R(dev) _IOWR('M', dev, int) #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) #define SOUND_MIXER_WRITE_R_RECSRC MIXER_WRITE_R(SOUND_MIXER_RECSRC) #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME) #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS) #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE) #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH) #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER) #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE) #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC) #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD) #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX) #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM) #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV) #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN) #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN) #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1) #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME) #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS) #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE) #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH) #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM) #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER) #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE) #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC) #define SOUND_MASK_CD (1 << SOUND_MIXER_CD) #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX) #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM) #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV) #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN) #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN) #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1) #define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2) #define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3) #define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN) #define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT) #define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO) #define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO) #define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR) typedef struct mixer_info { char id[16]; char name[32]; int modify_counter; int fillers[10]; } mixer_info; typedef struct _old_mixer_info { char id[16]; char name[32]; } _old_mixer_info; #define SOUND_MIXER_INFO _IOR('M', 101, mixer_info) #define SOUND_OLD_MIXER_INFO _IOR('M', 101, _old_mixer_info) #define OSS_GETVERSION _IOR ('M', 118, int) typedef struct audio_buf_info { int fragments; int fragstotal; int fragsize; int bytes; } audio_buf_info; typedef struct count_info { int bytes; int blocks; int ptr; } count_info; typedef struct buffmem_desc { unsigned int *buffer; int size; } buffmem_desc; #if 0 /* This is what we'd like to have, but it causes prototype conflicts. */ #define ioctl _oss_ioctl #else #define ioctl(x,y,z) _oss_ioctl(x,y,z) #endif #include <sys/cdefs.h> __BEGIN_DECLS int _oss_ioctl __P((int fd, unsigned long com, void *argp)); __END_DECLS #endif /* !_SOUNDCARD_H_ */ |
From: Benjamin R. <ran...@us...> - 2002-11-06 19:10:26
|
Update of /cvsroot/liboss/liboss/include In directory usw-pr-cvs1:/tmp/cvs-serv5021/include Modified Files: Makefile.am Removed Files: audioio.h soundcard.h soundcard_oss.h Log Message: moved the includes around a bit Index: Makefile.am =================================================================== RCS file: /cvsroot/liboss/liboss/include/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Makefile.am 6 Nov 2002 03:14:54 -0000 1.4 +++ Makefile.am 6 Nov 2002 19:10:22 -0000 1.5 @@ -1,38 +1 @@ -## -## Process this file with automake to produce Makefile.in -## - -include_HEADERS = audioio.h soundcard.h - -noinst_HEADERS = - -### -# Install header files (default=$includedir/liboss) -# -install-includeHEADERS: - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(includedir)/liboss - @list='$(include_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ - echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/liboss/$$p"; \ - $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/liboss/$$p; \ - done - -### -# Remove them -# -uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - list='$(include_HEADERS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(includedir)/liboss/$$p; \ - done - - -mostlyclean-generic: - -rm -f *~ \#* .*~ .\#* - - -maintainer-clean-generic: - -@echo "This command is intended for maintainers to use;" - -@echo "it deletes files that may require special tools to rebuild." - -rm -f Makefile.in +SUBDIRS = liboss --- audioio.h DELETED --- --- soundcard.h DELETED --- --- soundcard_oss.h DELETED --- |
From: Benjamin R. <ran...@us...> - 2002-11-06 19:10:25
|
Update of /cvsroot/liboss/liboss In directory usw-pr-cvs1:/tmp/cvs-serv5021 Modified Files: configure.in Log Message: moved the includes around a bit Index: configure.in =================================================================== RCS file: /cvsroot/liboss/liboss/configure.in,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- configure.in 6 Nov 2002 18:14:51 -0000 1.30 +++ configure.in 6 Nov 2002 19:10:21 -0000 1.31 @@ -93,7 +93,7 @@ dnl Common cflags for all platforms CFLAGS="$CFLAGS $nocpp $wall -I${prefix}/include -O2 -fprefetch-loop-arrays -frename-registers -mcpu=750 -mtune=750 -mmultiple -mstring" NONPIC_CFLAGS="$nopic" -CLIENT_CFLAGS="$INCLUDES -Dopen=___sys_open -Dclose=___sys_close -Dioctl=___sys_ioctl -include soundcard.h" +CLIENT_CFLAGS="$INCLUDES -Dopen=___sys_open -Dclose=___sys_close -Dioctl=___sys_ioctl -include liboss/soundcard.h" CPPFLAGS="$CPPFLAGS $CFLAGS" DEBUG_CFLAGS="$CFLAGS $DEBUG_CFLAGS" LIBS="-L${prefix}/lib" @@ -206,5 +206,6 @@ lib/Makefile src/Makefile include/Makefile +include/liboss/Makefile doc/Makefile]) AC_OUTPUT |
From: Benjamin R. <ran...@us...> - 2002-11-06 18:58:46
|
Update of /cvsroot/liboss/liboss/include/liboss In directory usw-pr-cvs1:/tmp/cvs-serv29618/liboss Log Message: Directory /cvsroot/liboss/liboss/include/liboss added to the repository |