Subject: pkg/12059: Patches for building mpg123 to use enlightened sound daemon (EsoundD)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bsd@cs.ubc.ca>
List: netbsd-bugs
Date: 01/27/2001 16:29:16
>Number:         12059
>Category:       pkg
>Synopsis:       Patches for building mpg123 to use enlightened sound daemon (EsoundD)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 27 16:32:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Brian de Alwis
>Release:        pkgsrc -current
>Organization:
>Environment:
System: NetBSD fifty 1.5 NetBSD 1.5 (GENERIC) #1: Sun Nov 19 21:42:11 MET 2000 fvdl@sushi:/work/trees/netbsd-1-5/sys/arch/i386/compile/GENERIC i386


>Description:
    mpg123 is built to write directly to the audio device. I'd
    like to use the Enlightened Sound Daemon (EsounD). mpg123
    has some support for this already. I've enclosed patches to
    add this capability for one netbsd target; I'm unsure how to
    proceed to get this incorporated officially or to modify it
    for various architectures.

>How-To-Repeat:
>Fix:
diff -cwbr ../orig/Makefile mpg123-0.59r/Makefile
*** ../orig/Makefile	Sat Jan 27 16:18:40 2001
--- mpg123-0.59r/Makefile	Sat Jan 27 16:25:04 2001
***************
*** 57,62 ****
--- 57,63 ----
  	@echo "make netbsd-arm32   NetBSD for strongarm"
  	@echo "make netbsd-i386    NetBSD optimized for i386"
  	@echo "make netbsd-i386-elf NetBSD optimized for i386, ELF format"
+ 	@echo "make netbsd-i386-elf-esd NetBSD optimized for i386, ELF format, EsounD"
  	@echo "make netbsd-m68k    NetBSD optimized for m68k"
  	@echo "make bsdos          BSDI BSD/OS"
  	@echo "make bsdos4         BSDI BSD/OS 4.0"
***************
*** 389,394 ****
--- 390,408 ----
  			-funroll-all-loops -ffast-math -DROT_I386 \
  			-DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DUSE_MMAP \
  			-DREAD_MMAP -DNETBSD -DTERM_CONTROL' \
+ 		mpg123-make
+ 
+ netbsd-i386-elf-esd:
+ 	$(MAKE) CC=cc LDFLAGS= \
+ 		AUDIO_LIB="`esd-config --libs`" \
+ 		OBJECTS='decode_i386.o dct64_i386.o decode_i586.o \
+ 			$(GETBITS) audio_esd.o term.o' \
+ 		CFLAGS="$(CFLAGS) -Wall -ansi -pedantic -O4 -m486 -fomit-frame-pointer \
+ 			-funroll-all-loops -ffast-math -DROT_I386 \
+ 			-DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DUSE_MMAP \
+ 			-DREAD_MMAP -DNETBSD -DTERM_CONTROL \
+ 			-DI386_ASSEM -DOSS \
+ 			`esd-config --cflags`" \
  		mpg123-make
  
  netbsd-m68k:
diff -cwbr ../orig/audio_esd.c mpg123-0.59r/audio_esd.c
*** ../orig/audio_esd.c	Fri May 28 08:06:29 1999
--- mpg123-0.59r/audio_esd.c	Sat Jan 27 16:23:38 2001
***************
*** 8,13 ****
--- 8,17 ----
  #include <stropts.h>
  #include <sys/conf.h>
  #endif
+ #ifdef NETBSD
+ #include <sys/ioctl.h>
+ #include <sys/audioio.h>
+ #endif
  
  static unsigned esd_rate = 0, esd_format = 0, esd_channels = 0;
  
***************
*** 75,81 ****
    else if (ai->rate > esd_rate)
      return -1;
  
!   ai->fn = esd_play_stream_fallback(format, ai->rate, esdserver, "mpg123");
    return (ai->fn);
  }
  
--- 79,85 ----
    else if (ai->rate > esd_rate)
      return -1;
  
!   ai->fn = esd_play_stream_fallback(format, ai->rate, NULL /*esdserver*/, "mpg123");
    return (ai->fn);
  }
  
>Release-Note:
>Audit-Trail:
>Unformatted: