[linux-audio-dev] What's the realtime code in mpg123 doing????

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] What's the realtime code in mpg123 doing????
From: Mike Patnode (mpatnode_AT_yahoo.com)
Date: Thu Apr 04 2002 - 07:32:49 EEST


I had rebuilt mpg123 0.59s with the SET_RT option, applied Andrew's
realtime patches (2.4.16) and I was still getting dropouts and slowdows
during CD ROM and network activity, even with -b 4096! I was about to
post a detailed scenario when I looked closer at the mpg123 code:

1 #ifdef SET_RT
2 if (param.realtime) { /* Get real-time priority */
3 struct sched_param sp;
4 if (!param.quiet) {
5 fprintf(stderr,"Getting real-time priority\n");
6 }
7 memset(&sp, 0, sizeof(struct sched_param));
8 sp.sched_priority = sched_get_priority_min(SCHED_FIFO);
9 if (sched_setscheduler(0, SCHED_RR, &sp) == -1)
10 fprintf(stderr,"Can't get real-time priority\n");
11
12 }
13 #endif

My problem seems to go away if I change lines 8 and 9 to be:

8 sp.sched_priority = sched_get_priority_max(SCHED_FIFO);
9 if (sched_setscheduler(0, SCHED_FIFO, &sp) == -1)

Which seems to be the recommended usage for sound apps. Is there
something more subtle the original code was trying to achieve? I do
not profess to be a realtime API expert by any means.

thx
mp

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Apr 04 2002 - 07:21:46 EEST