Re: [linux-audio-dev] sound/gui interaction

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

Subject: Re: [linux-audio-dev] sound/gui interaction
From: Benno Senoner (sbenno_AT_gardena.net)
Date: Thu Jul 20 2000 - 22:22:36 EEST


On Thu, 20 Jul 2000, douglas irving repetto wrote:
I heard that older versions of linux have some problems with this call but I am
not sure:

what I usually do is just use sched_setscheduler() at the begin of the thread's
mainloop before I jump to the endless DSP processing loop.

every thread sets it's own policy, I know it's not nice but it works.

if someone has infos about the pthread_schedparam problems
(or non problems) then let me know please.

Benno.

>
>
> i've also (i think) set my dsp thread to the highest priority:
>
>
> /* start our audio thread */
> printf("going to create audio thread\n");
> retcode = pthread_create(&th_sound, NULL, ProcessLoop, (void*)this);
> if (retcode != 0)
> fprintf(stderr, "create a failed %d\n", retcode);
> else
> printf("thread created\n");
>
> sched_param param;
> memset(&param, 0, sizeof(param));
> param.sched_priority = sched_get_priority_max(SCHED_FIFO);
>
> retcode = pthread_setschedparam(th_sound, SCHED_FIFO, &param);
>
> if (retcode != 0)
> fprintf(stderr, "failed to set sched param%d\n", retcode);
>
> retcode = pthread_detach(th_sound);
>
> if (retcode != 0)
> fprintf(stderr, "failed to detach thread%d\n", retcode);
>
>
> this seems to _hurt_ performance quite a bit! i get more glitches than
> ever this way, so i must be doing something dumb. any comments? i've
> pretty much just copied this code from the man pages...
>
> thanks,
> douglas
>
> --
> douglas irving repetto
> http://music.columbia.edu/~douglas
> the music-dsp mailing list and website:
> http://shoko.calarts.edu/musicdsp


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

This archive was generated by hypermail 2b28 : Thu Jul 20 2000 - 22:00:55 EEST