================================================================
Dear Bug Team!
There's a race condition in alsaplay.c which prevents sound-files (or
loaded sounds) from playing.
To reproduce the bug, start xemacs and evaluate
(play-sound-file "/usr/share/xemacs/xemacs-packages/etc/sounds/whistle.au" 100)
(adjust path to suit). Nothing happens.
No idea how system-dependent or recent this is.
I tracked the problem down to the fact that the existing code calls
snd_pcm_close on the device handle immediately after writing to it.
I guess this worked once, maybe what 'blocking' means has changed, but
in an case this patch will fix it (discovered by comparing the
equivalent code in emacs, which doesn't have this problem):
--- a/src/alsaplay.c Wed Apr 24 20:16:14 2013 -0400
+++ b/src/alsaplay.c Fri Oct 11 16:38:23 2013 +0100
@@ -375,6 +375,11 @@
if ((err = snd_pcm_writei (pcm_handle, data, length)) < 0)
goto error_mixer;
+ /* wait for it to finish -- added by HST to fix killing the thing
+ before it's actually played much if anything */
+ if ((err = snd_pcm_drain (pcm_handle)) < 0)
+ goto error_mixer;
+
/* Put the volume back the way it used to be */
reset_volume (&mix);
================================================================
System Info to help track down your bug:
---------------------------------------
uname -a: Linux calexico.inf.ed.ac.uk 2.6.32-279.11.1.el6.x86_64 #1 SMP Tue Oct 16
11:16:02 CDT 2012 x86_64 x86_64 x86_64 GNU/Linux
./configure '--prefix=/group/ltg/projects/lcontrib_sl6' '--without-msw'
'--with-mule' '--with-clash-detection'
'--with-database=berkdb,gdbm' '--without-ldap'
'--with-mail-locking=lockf' '--with-pop' '--without-hesiod'
'--with-pdump' '--with-debug' '--enable-bignum=gmp'
'--with-sound=nonative,alsa' '--with-menubars=lucid'
'--with-widgets=athena' '--with-dialogs=athena'
'--with-scrollbars=lucid' '--with-xim=xlib' '--without-wnn'
'--with-png' '--with-xpm' '--with-canna=no' 'CFLAGS=-O2 -g
-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing'
XEmacs 21.5-b33 "horseradish" 02d0124c6314+ configured for
`x86_64-unknown-linux'.
Compilation Environment and Installation Defaults:
Source code location:
/afs/inf.ed.ac.uk/user/h/ht/lcontrib_sl6/src/xemacs-upstream
Installation prefix: /group/ltg/projects/lcontrib_sl6
Operating system description file: `s/linux.h'
Not using any machine description file
Compiler version: gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
- GCC specs file: specs.
- Compiler command: gcc -Wall -Wno-switch -Wundef -Wsign-compare
-Wno-char-subscripts -Wpacked -Wshadow -Wmissing-declarations -Wmissing-prototypes
-Wstrict-prototypes -Wdeclaration-after-statement -Wunused-parameter -g -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
-m64 -mtune=generic -fno-strict-aliasing
libc version: glibc-2.12-1.80.el6_3.5.x86_64
glibc-2.12-1.80.el6_3.5.i686
Relocating allocator for buffers: no
GNU version of malloc: yes
- Using Doug Lea's new malloc from the GNU C Library.
Package Search (a 'root' contains '{xemacs,mule,site}-packages'):
User package roots: ~/.xemacs
System package roots: /group/ltg/projects/lcontrib_sl6/share/xemacs
Window System:
Compiling in support for the X window system:
- X Windows headers location:
- X Windows libraries location:
- Handling WM_COMMAND properly.
Compiling in support for the Athena widget set:
- Athena headers location: X11/Xaw
- Athena library to link: Xaw
Using Lucid menubars.
Using Lucid scrollbars.
Using Athena dialog boxes.
Using Athena native widgets.
TTY:
Compiling in support for ncurses.
Images:
Compiling in support for XPM images.
Compiling in support for PNG images.
Compiling in support for JPEG images.
Sound:
Compiling in support for ALSA (Advanced Linux Sound Architecture).
Databases:
Compiling in support for Berkeley database.
Compiling in support for GNU DBM.
Compiling in support for PostgreSQL.
- Using PostgreSQL header file: libpq-fe.h
- Using PostgreSQL V7 bindings.
Internationalization:
Compiling in support for Mule (multi-lingual Emacs).
Compiling in support for XIM (X11R5+ I18N input method).
- Using raw Xlib to provide XIM support.
Mail:
Compiling in support for POP mail retrieval.
Compiling in support for "lockf" mail spool file locking method.
Other Features:
Inhibiting IPv6 canonicalization at startup.
Compiling in support for dynamic shared object modules.
Compiling in support for more number types using the GNU MP library.
Using the new GC mark algorithms (KKCC).
WARNING: ---------------------------------------------------------
WARNING: The new algorithms are experimental. They are enabled by
WARNING: default for this release. Use `--disable-kkcc' to
WARNING: turn it off.
WARNING: ---------------------------------------------------------
Using the new portable dumper.
Dumping into executable.
Compiling in support for extra debugging code.
Compiling in support for runtime error checking.
WARNING: ---------------------------------------------------------
WARNING: XEmacs will run noticeably more slowly as a result.
WARNING: Error checking is on by default for XEmacs beta releases.
WARNING: ---------------------------------------------------------
Load-Path Lisp Shadows:
----------------------
(/afs/inf.ed.ac.uk/user/h/ht/emacs/lucid/rooms
/afs/inf.ed.ac.uk/user/h/ht/emacs/shared/rooms
/afs/inf.ed.ac.uk/user/h/ht/emacs/lucid/my-news
/afs/inf.ed.ac.uk/user/h/ht/emacs/shared/my-news
/afs/inf.ed.ac.uk/user/h/ht/emacs/local/init
/afs/inf.ed.ac.uk/user/h/ht/emacs/shared/init
/afs/inf.ed.ac.uk/user/h/ht/emacs/shared/tcl
/group/ltg/projects/lcontrib_sl6/share/xemacs/xemacs-packages/lisp/prog-modes/tcl
/group/ltg/projects/lcontrib_sl6/share/xemacs/xemacs-packages/lisp/cedet-common/working
/group/ltg/projects/lcontrib_sl6/share/xemacs/xemacs-packages/lisp/semantic/working
/group/ltg/projects/lcontrib_sl6/share/xemacs/xemacs-packages/lisp/cedet-common/sformat
/group/ltg/projects/lcontrib_sl6/share/xemacs/xemacs-packages/lisp/semantic/sformat
/group/ltg/projects/lcontrib_sl6/share/xemacs/mule-packages/lisp/mule-base/china-util
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/mule/china-util
/group/ltg/projects/lcontrib_sl6/share/xemacs/mule-packages/lisp/mule-base/ethio-util
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/mule/ethio-util
/group/ltg/projects/lcontrib_sl6/share/xemacs/mule-packages/lisp/mule-base/japan-util
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/mule/japan-util
/group/ltg/projects/lcontrib_sl6/share/xemacs/mule-packages/lisp/mule-base/viet-util
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/mule/viet-util
/group/ltg/projects/lcontrib_sl6/share/xemacs/mule-packages/lisp/mule-base/korea-util
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/mule/korea-util
/afs/inf.ed.ac.uk/user/h/ht/emacs/shared/hebrew
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/mule/hebrew
/group/ltg/projects/lcontrib_sl6/share/xemacs/xemacs-packages/lisp/apel/alist
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/alist
/group/ltg/projects/lcontrib_sl6/share/xemacs/xemacs-packages/lisp/build/build-report
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/build-report
/group/ltg/projects/lcontrib_sl6/share/xemacs/xemacs-packages/lisp/xemacs-base/regexp-opt
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/regexp-opt
/group/ltg/projects/lcontrib_sl6/share/xemacs/mule-packages/lisp/mule-ucs/unicode
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/unicode
/afs/inf.ed.ac.uk/user/h/ht/emacs/shared/misc
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/misc
/group/ltg/projects/lcontrib_sl6/share/xemacs/xemacs-packages/lisp/xemacs-base/easy-mmode
/group/ltg/projects/lcontrib_sl6/share/xemacs-21.5-b33/lisp/easy-mmode)
Internationalization Settings:
-------------------------
Environment:
Value of LC_ALL : nil
Value of LC_COLLATE : nil
Value of LC_CTYPE : nil
Value of LC_MESSAGES : nil
Value of LC_MONETARY : nil
Value of LC_NUMERIC : nil
Value of LC_TIME : nil
Value of LANG : en_GB.UTF-8
Lisp locale settings:
current-language-environment => "Latin-1"
default-buffer-file-coding-system => iso-8859-1
default-process-coding-system => (undecided . iso-8859-1)
(current-locale) => "en_GB.UTF-8"
keyboard-coding-system => iso-8859-1
terminal-coding-system => iso-8859-1
(coding-priority-list) =>
(iso-8-1 utf-16-little-endian-bom utf-16-bom utf-8-bom iso-7
no-conversion utf-8 iso-8-2 iso-8-designate iso-lock-shift
shift-jis big5 utf-16-little-endian utf-16 ucs-4)
Coding system aliases:
'native is aliased to iso-8859-1
'file-name is aliased to iso-8859-1
'mswindows-multibyte-system-default is not a coding system alias
Installed XEmacs Packages:
-------------------------
(zenirc ver: 1.16 upstream: 2.112)
(xwem ver: 1.23 upstream: lg(a)xwem.org--2005/xwem--main--2.1--versionfix-1)
(xslt-process ver: 1.12 upstream: 1.2.1)
(xslide ver: 1.09 upstream: 0.2.2)
(xlib ver: 1.14 upstream: lg(a)xwem.org--2005/xlib--main--2.1--version-0)
(xetla ver: 1.02 upstream: steve(a)eicq.org--2005/xetla--main--1.1--version-0)
(xemacs-devel ver: 1.82 upstream: No-Upstream-Ver)
(xemacs-base ver: 2.32 upstream: No-Upstream-Ver)
(x-symbol ver: 1.13 upstream: 4.5.1)
(w3 ver: 1.38 upstream: 4.0pre47)
(vm ver: 8.08 upstream: 8.0.12-devo)
(viper ver: 1.67 upstream: 3.09)
(view-process ver: 1.13 upstream: 2.4)
(vhdl ver: 1.22 upstream: 3.33.12)
(vc ver: 1.48 upstream: No-Upstream-Ver)
(tramp ver: 1.4 upstream: 2.0.56)
(tpu ver: 1.14 upstream: 4.2X)
(tm ver: 1.39 upstream: No-Upstream-Ver)
(time ver: 1.14 upstream: 1.17)
(textools ver: 1.15 upstream: No-Upstream-Ver)
(text-modes ver: 2.01 upstream: No-Upstream-Ver)
(texinfo ver: 1.3 upstream: No-Upstream-Ver)
(supercite ver: 1.21 upstream: 3.55x3)
(strokes ver: 1.1 upstream: No-Upstream-Ver)
(speedbar ver: 1.3 upstream: 1.0pre4)
(slider ver: 1.16 upstream: 0.3x1)
(sieve ver: 1.18 upstream: No-Upstream-Ver)
(sh-script ver: 1.24 upstream: 2.0f)
(sgml ver: 1.11 upstream: No-Upstream-Ver)
(semantic ver: 1.21 upstream: 2.0pre4)
(scheme ver: 1.18 upstream: No-Upstream-Ver)
(ruby-modes ver: 1.04 upstream: 1.8.7)
(rmail ver: 1.14 upstream: No-Upstream-Ver)
(riece ver: 1.23 upstream: 3.1.2)
(reftex ver: 1.34 upstream: 4.21)
(re-builder ver: 1.05 upstream: 1.20)
(python-modes ver: 1.14 upstream: 5.0.0)
(psgml ver: 1.45 upstream: 1.3.2)
(ps-print ver: 1.12 upstream: 6.5.6)
(prog-modes ver: 2.27 upstream: No-Upstream-Ver)
(pgg ver: 1.08 upstream: 0.1)
(perl-modes ver: 1.14 upstream: No-Upstream-Ver)
(pcomplete ver: 1.06 upstream: 1.1.6)
(pcl-cvs ver: 1.7 upstream: R-2_9_9)
(pc ver: 1.28 upstream: No-Upstream-Ver)
(os-utils ver: 1.41 upstream: No-Upstream-Ver)
(oo-browser ver: 1.05 upstream: 4.08)
(ocaml ver: 0.06 upstream: 3.06)
(net-utils ver: 1.57 upstream: N/A)
(misc-games ver: 1.22 upstream: No-Upstream-Ver)
(mine ver: 1.16 upstream: 1.9)
(mh-e ver: 1.33 upstream: 7.4.2)
(mew ver: 1.19 upstream: 1.94.2)
(mailcrypt ver: 2.14 upstream: 3.5.8)
(mail-lib ver: 1.8 upstream: No-Upstream-Ver)
(jde ver: 1.52 upstream: 2.3.5.1)
(ispell ver: 1.32 upstream: 3.6)
(ilisp ver: 1.36 upstream: 5.12.0)
(igrep ver: 1.16 upstream: 2.111)
(idlwave ver: 1.32 upstream: 5.1)
(ibuffer ver: 1.1 upstream: No-Upstream-Ver)
(hyperbole ver: 1.18 upstream: 5.0.3)
(hm--html-menus ver: 1.24 upstream: 5.9)
(haskell-mode ver: 1.11 upstream: 2.1)
(guided-tour ver: 0.52 upstream: No-Upstream-Ver)
(gnus ver: 1.94 upstream: 5.10.10)
(gnats ver: 1.17 upstream: 3.101)
(games ver: 1.21 upstream: 2.00)
(fsf-compat ver: 1.19 upstream: No-Upstream-Ver)
(fortran-modes ver: 1.05 upstream: No-Upstream-Ver)
(forms ver: 1.15 upstream: 2.37)
(footnote ver: 1.16 upstream: 0.18x)
(eudc ver: 1.41 upstream: 1.32)
(eterm ver: 1.18 upstream: No-Upstream-Ver)
(eshell ver: 1.18 upstream: 0fc80a3f6bb3bb59f42e9ff83cc8b89bf90fe658)
(escreen ver: 1.01 upstream: 1.16)
(emerge ver: 1.11 upstream: No-Upstream-Ver)
(eieio ver: 1.07 upstream: 1.0pre4)
(efs ver: 1.34 upstream: 1.24)
(edt ver: 1.14 upstream: No-Upstream-Ver)
(edit-utils ver: 2.46 upstream: No-Upstream-Ver)
(ediff ver: 1.81 upstream: 2.75)
(edebug ver: 1.22 upstream: No-Upstream-Ver)
(ede ver: 1.04 upstream: 1.0pre4)
(ecrypto ver: 0.21 upstream: 2.0)
(ecb ver: 1.22 upstream: 2.31)
(easypg ver: 1.03 upstream: 0.0.16)
(docbookide ver: 0.08 upstream: 0.1)
(dired ver: 1.2 upstream: 7.17)
(dictionary ver: 1.16 upstream: 1.8)
(debug ver: 1.18 upstream: No-Upstream-Ver)
(cookie ver: 1.15 upstream: No-Upstream-Ver)
(cogre ver: 1.02 upstream: 0.5)
(clearcase ver: 1.1 upstream: /main/laptop/165)
(cedet-common ver: 1.01 upstream: 1.0pre4)
(cc-mode ver: 1.56 upstream: 5.32.2)
(calendar ver: 1.38 upstream: No-Upstream-Ver)
(calc ver: 1.26 upstream: 2.02fX3)
(c-support ver: 1.22 upstream: No-Upstream-Ver)
(build ver: 1.15 upstream: 2.02)
(bbdb ver: 1.32 upstream: 2.35)
(auctex ver: 1.49 upstream: 11.55)
(apel ver: 1.34 upstream: 10.7)
(ada ver: 1.14 upstream: 2.27)
(skk ver: 1.24 upstream: 10.62a)
(mule-ucs ver: 1.18 upstream: 0.84)
(mule-base ver: 1.56 upstream: No-Upstream-Ver)
(lookup ver: 1.15 upstream: 1.0)
(leim ver: 1.32 upstream: No-Upstream-Ver)
(latin-unity ver: 1.2 upstream: 1.20)
(egg-its ver: 1.27 upstream: No-Upstream-Ver)
(edict ver: 1.17 upstream: 0.9.9)
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta