This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Creating a thread for gstreamer and xine

Tags: None
(comma "," separated)
Christian Lambert
Karma
0
I wonder if it would be possible to create a thread for operations related to playing audio and doing file I/O so that I can just change the priority of that thread with let\'s say schedtool or renice.

ck Kernel: http://members.optusnet.com.au/ckolivas/kernel/
shedtool: http://freshmeat.net/projects/schedtool/?topic_id=136

I use the Con Kolivas patchset (2.6.11-ck3) which allows process to use SCHED_ISO without having root privileges. All the process (amarok) has to try to do is acquire realtime privileges, but if it fails, it will be converted automatically to SCHED_ISO. This could be implemented in amarok, or be done manually by the user on the thread with schedtool -I .

Normal users running a vanilla kernel could still renice the thread to -10 in order to reduce audio dropouts. I think this could apply to xine engine too, as far as arts, it doesn\'t apply since artsd already runs in user space and can be reniced or changed to use SCHED_RR.

Now, the reason for creating the subthread is that I would not want the UI to take up priority over other processes. For example, while changing songs, I noticed that often the cpu goes to %100 while it loads up the album covers and other info related to the current playing song and this makes the mouse pause shortly.

To minimize this big cpu hog while switching songs, would it be possible to pre-load some of this information ahead of time slowly when reaching near the end of a song not to hog the cpu all at once?

Let me know

-Christian
User avatar
markey
KDE Developer
Posts
2286
Karma
3
OS
Regarding GStreamer-engine: The engine does already use threads for the audio pipeline. In fact amaroK has a hidden option to modify the thread priority. You can set it in amarokrc:

[code:1]
[Gst-Engine]
Thread Priority=int (range: 0 - lowest, 3 - highest)
[/code:1]

Default priority is 2. It\'s unclear to me whether 3 means realtime priority. I recommend checking back with the GStreamer developers. #gstreamer, irc.freenode.net


--
Mark Kretschmann - Amarok Developer


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, Sogou [Bot], Yahoo [Bot]