No sound in Xpat2 with sound option on

Bug #694877 reported by Graham Aiken
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xpat2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: xpat2

The sound does not work in Xpat2 when the sound option is turned on. This appears to be due to the fact that the program checks for the presence of /dev/audio before playing sounds, and /dev/audio is no longer present by default in Ubuntu 10.10. The following patch applied to the source file '/src/X-sound_SUN.c' seems to solve the problem.

--- xpat2-1.07.orig/src/X-sound_SUN.c 1999-05-01 01:22:04.000000000 +1000
+++ xpat2-1.07/src/X-sound_SUN.c 2010-12-25 22:17:26.000000000 +1100
@@ -19,22 +19,8 @@
     static int audio = 1;
     if (audio && checksound()) {
  char fullname[200];
- FILE *fp, *fsnd;
- int c;
- if (!(fsnd = fopen(AUDIO_DEVICE, "wb"))) {
- audio = 0;
- return; /* cannot open /dev/audio */
- }
  flush_display();
- sprintf(fullname, "%s/audio/%s.au", LIBDIR, filename);
- if (!(fp = fopen(fullname, "rb"))) {
- fclose(fsnd);
- return;
- }
- /* yeah, copy data */
- while ((c = getc(fp)) != EOF)
- fputc(c, fsnd);
- fclose(fsnd);
- fclose(fp);
+ sprintf(fullname, "aplay %s/audio/%s.au", LIBDIR, filename);
+ system(fullname);
     }
 }

After extracting the source file 'xpat2_1.07.orig.tar.gz' downloaded form the Ubuntu repository and applying applying the supplied patch 'xpat2_1.07-16.diff' I also found it necessary to change a line in the '/src/Xpat.tmpl' file to make the directory structure match that presently in Ubuntu 10.10.
 'XPATROOT = /usr/games/lib/xpat' changed to
 'XPATROOT = /usr/share/games/xpat'

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: xpat2 1.07-17
ProcVersionSignature: Ubuntu 2.6.35-23.41-generic 2.6.35.7
Uname: Linux 2.6.35-23-generic i686
Architecture: i386
Date: Tue Dec 28 09:43:35 2010
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
ProcEnviron:
 LANG=en_AU.utf8
 SHELL=/bin/bash
SourcePackage: xpat2

Revision history for this message
Graham Aiken (gjaiken) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.