Package: timidity
Version: 2.13.2-33.1
Severity: normal

Attached patch from fedora:
* Wed Jun 03 2009 Hans de Goede <hdego...@redhat.com> 2.13.2-19 - Don't crash 
when started in daemon mode (with -iAD) (#501051) 
fixes the pulse_new assert when using -iAD.

There is also the need for to add timidity user to pulse-rt group. This I am 
not that easy to fix . Needs postinst changes.
Otherwise dreaded permission error is fired up when playing through timidity.
A workaround for the latter is to set the timidity user to the user playing 
through timidity (one seat station only that is).


Best regards
Alban

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.31-rc6-wleeepc (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages timidity depends on:
ii  libasound2             1.0.20-4          shared library for ALSA applicatio
ii  libaudio2              1.9.2-3           Network Audio System - shared libr
ii  libc6                  2.9-26            GNU C Library: Shared libraries
ii  libesd0                0.2.41-5          Enlightened Sound Daemon - Shared 
ii  libflac8               1.2.1-2+b1        Free Lossless Audio Codec - runtim
ii  libice6                2:1.0.5-1         X11 Inter-Client Exchange library
ii  libjack0               0.116.2+svn3592-2 JACK Audio Connection Kit (librari
ii  libncurses5            5.7+20090803-2    shared libraries for terminal hand
ii  libogg0                1.1.4~dfsg-1      Ogg bitstream library
ii  libpng12-0             1.2.39-1          PNG library - runtime
ii  libsm6                 2:1.1.1-1         X11 Session Management library
ii  libvorbis0a            1.2.0.dfsg-6      The Vorbis General Audio Compressi
ii  libvorbisenc2          1.2.0.dfsg-6      The Vorbis General Audio Compressi
ii  libx11-6               2:1.2.2-1         X11 client-side library
ii  libxaw7                2:1.0.6-1         X11 Athena Widget library
ii  libxext6               2:1.0.4-1         X11 miscellaneous extension librar
ii  libxmu6                2:1.0.4-2         X11 miscellaneous utility library
ii  libxt6                 1:1.0.6-1         X11 toolkit intrinsics library
ii  lsb-base               3.2-23            Linux Standard Base 3.2 init scrip
ii  zlib1g                 1:1.2.3.3.dfsg-15 compression library - runtime

Versions of packages timidity recommends:
ii  freepats                     20060219-1  Free patch set for MIDI audio synt
ii  timidity-daemon              2.13.2-33.1 runs TiMidity++ as a system-wide M

Versions of packages timidity suggests:
ii  fluid-soundfont-gm            3.1-2      Fluid (R3) General MIDI SoundFont 
ii  fluid-soundfont-gs            3.1-2      Fluid (R3) General MIDI SoundFont 
ii  pmidi                         1.6.0-5    A command line midi player for ALS

-- no debconf information
--- ../timidity-2.13.2/interface/alsaseq_c.c	2009-09-07 14:23:14.000000000 +0200
+++ interface/alsaseq_c.c	2009-09-07 14:25:16.000000000 +0200
@@ -390,23 +390,6 @@
 
 	play_mode->close_output();
 
-	if (ctl.flags & CTLF_DAEMONIZE)
-	{
-		int pid = fork();
-		FILE *pidf;
-		switch (pid)
-		{
-			case 0:			// child is the daemon
-				break;
-			case -1:		// error status return
-				exit(7);
-			default:		// no error, doing well
-				if ((pidf = fopen( "/var/run/timidity/timidity.pid", "w" )) != NULL )
-					fprintf( pidf, "%d\n", pid );
-				exit(0);
-		}
-	}
-
 	for (;;) {
 		server_reset();
 		doit(&alsactx);
--- ../timidity-2.13.2/timidity/timidity.c	2009-09-07 14:23:14.000000000 +0200
+++ timidity/timidity.c	2009-09-07 14:21:58.000000000 +0200
@@ -5127,6 +5127,29 @@
 {
     int i, cmderr = 0;
 
+    /* If we're going to fork for daemon mode, we need to fork now, as
+       certain output libraries (pulseaudio) become unhappy if initialized
+       before forking and then being used from the child. */
+    if (ctl->id_character == 'A' && (ctl->flags & CTLF_DAEMONIZE))
+    {
+	int pid = fork();
+	FILE *pidf;
+	switch (pid)
+	{
+	    case 0:		// child is the daemon
+		break;
+	    case -1:		// error status return
+		exit(7);
+	    default:		// no error, doing well
+		if ((pidf = fopen( "/var/run/timidity.pid", "w" )) != NULL )
+		{
+		    fprintf( pidf, "%d\n", pid );
+		    fclose( pidf );
+                }
+		exit(0);
+	}
+    }
+
     if(play_mode == &null_play_mode)
     {
 	char *output_id;

Reply via email to