Bug#433643: making timidity's alsaseq interface _powerfriendly_

2007-07-18 Thread C.
Package: timidity
Severity: wishlist


Hi,

I got a new laptop with a onboard sound system, without any hw
synthesizer... since I'm an MIDI diehard, I tried timidity... (which worked
out of the box! THX!!)

Unfortunatly, the 10ms wakeup cycle in interface/alsaseq_c.c kills the
battery pretty fast. -> So, here are TWO approaches to save the battery life.
(hopefully the patches don't get screwed up...)

Thanks,
Chr.

Either FIRST:

--- timidity-2.13.2/interface/alsaseq_c.c.org   2007-07-18 14:44:57.675654262 
+0200
+++ timidity-2.13.2/interface/alsaseq_c.c   2007-07-18 14:45:20.324944971 
+0200
@@ -529,12 +529,9 @@ static void doit(struct seq_context *ctx
}
if (! ctxp->active || ! IS_STREAM_TRACE) {
fd_set rfds;
-   struct timeval timeout;
FD_ZERO(&rfds);
FD_SET(ctxp->fd, &rfds);
-   timeout.tv_sec = 0;
-   timeout.tv_usec = 1; /* 10ms */
-   if (select(ctxp->fd + 1, &rfds, NULL, NULL, &timeout) < 
0)
+   if (select(ctxp->fd + 1, &rfds, NULL, NULL, NULL) < 0)
goto __done;
}
}

-EOP-
or SECOND:

--- timidity-2.13.2/interface/alsaseq_c.c   2004-07-10 07:07:00.0 
+0200
+++ timidity-2.13.2-fix/interface/alsaseq_c.c   2007-07-17 14:55:28.393628042 
+0200
@@ -500,6 +500,7 @@ static void stop_playing(void)
 
 static void doit(struct seq_context *ctxp)
 {
+   int err, timeout_val = 10;
for (;;) {
while (snd_seq_event_input_pending(ctxp->handle, 1)) {
if (do_sequencer(ctxp))
@@ -532,10 +533,19 @@ static void doit(struct seq_context *ctx
struct timeval timeout;
FD_ZERO(&rfds);
FD_SET(ctxp->fd, &rfds);
-   timeout.tv_sec = 0;
-   timeout.tv_usec = 1; /* 10ms */
-   if (select(ctxp->fd + 1, &rfds, NULL, NULL, &timeout) < 
0)
+   timeout.tv_sec = (timeout_val / 1000);
+   timeout.tv_usec = (timeout_val % 1000) * 1000;
+   err = select(ctxp->fd + 1, &rfds, NULL, NULL, 
timeout_val < 0 ? NULL : &timeout);
+   if (err < 0)
goto __done;
+   else if (err == 0)
+   if (timeout_val < 1024)
+   timeout_val+=timeout_val;
+   else
+   timeout_val = -1;
+   else
+   timeout_val = 10;
+   
}
}
 
-EOP-

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-rc3-git6-wireless (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#433643: making timidity's alsaseq interface _powerfriendly_

2007-07-23 Thread Joost Yervante Damad
Hello,

I've been experimenting with both patches, and while the idea is good, they 
introduce a noticable delay on the first notes of a song, when I start 
playing a midi file with rosegarden...


Joost


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#433643: making timidity's alsaseq interface _powerfriendly_

2007-07-23 Thread Chr
On Monday, 23. July 2007, Joost Yervante Damad wrote:
> Hello,
> 
> I've been experimenting with both patches, and while the idea is good, they 
> introduce a noticable delay on the first notes of a song, when I start 
> playing a midi file with rosegarden...
> 

That's strange... I don't have any start or playback problems at all. Do you
have a "test" midi for me? (I tried various rosegarden's examples, but
they're all fine.)

But back to the topic: I could only test the patches on my laptop, 
since it's the only machine I have now...

(FYI: The laptop has a fast cpu (C2D T7500 ~ 2 x 2200 Mhz),
with 2.6.22-git17 x86_64, "Voluntary Preempt" and 250 Hz (not NO_HZ)). 
But I disabled one core and underclocked it to 800 Mhz for the testing 
procedure!
 

I didn't modify timidity.cfg (it is still original debian one), 
but I disabled the extra interfaces for emacs,xaw and ncurses.
It's because I don't need them, since I'm only using the server mode
and the ncurses thing eats lots of cycles... atleast according to
my oprofile logs.

Chr.



signature.asc
Description: This is a digitally signed message part.


Bug#433643: making timidity's alsaseq interface _powerfriendly_

2007-07-25 Thread Chr
Hi, 

I just want to ask if you have any news about the first note pauses,
if the ncurses interface is really the bottleneck here... 

I want fix this thing/to get this thing fixed. ;-)

Thanks,
Chr.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]