210 likes | 341 Views
ITFN 2601 Introduction to Operating Systems. Lecture 23 Intro to Multimedia MMOS: Scheduling. Agenda. Intro to Multimedia Audio Video Multimedia Scheduling Round Robin General Real-time Rate Monotonic Earliest Deadline First. Intro to Multimedia.
E N D
ITFN 2601Introduction to Operating Systems Lecture 23 Intro to MultimediaMMOS: Scheduling
Agenda • Intro to Multimedia • Audio • Video • Multimedia Scheduling • Round Robin • General Real-time • Rate Monotonic • Earliest Deadline First
Intro to Multimedia • What makes Multimedia OS different from OS we’ve talked about heretofore? • Multimedia – audio & video • Extremely high data rates • Real-time playback • Quality of Service – users will notice!
Standards • Video – 30 frames per second (NTSC) • Based on what we can see • Audio – 44,100 samples per second (CD) • Human ear range = 20 Hz to 20 kHz
Consider HDTV • Just bought that expensive HDTV system… • Wanna actually watch cool, high-quality movies streamed to your home? • Uncompressed: 570 GB per movie & 648 Mbps – YIKES!
Audio • 44,100 samples/sec @ 16 bits • Range of 0-22,050 Hz • 65,536 distinct values(of possible 1M that the human ear can hear) • This yields 1.411 Mbps uncompressed • Given psychoacoustics, we can compress (MP3) to 1/10th of this
Video • Is it important to have higher than 24-bit color video output? • Why not? • Uncompressed video (24 bit color at 1024x768 XGA) = 472 Mbps (25 fps)!
Video Compression • It’s OK to be lossy • Uncompressed != original • Encoding can be slow, but decoding must be fast • JPEG – single image (20:1 compression) • MPEG – motion images (16:1 compression)
MMOS OverviewSummary • Multimedia OS (MMOS) • Handle large audio & video files • Require real-time playback • Use extremely high data rates • Even when utilizing MP3/MPEG compression
MMOS: Round Robin • Works well if all streams are • Same bandwidth, compression, size, etc. • Fixed number of streams/movies • Run processes in SAME order • Sum of run times <= 30 msec such that you can serve at 30 fps
MMOS: General Real-Time • Round robin unrealistic • We’re going to have multiple, different-quality streams • Assume each process has own “agenda” • If we know frequency, work, & deadlines of each process…
Is it Schedulable? • Back to Chapter 2 • Schedulable iff Sum (1-n) Ci / Pi <= 1 • If 3 jobs A, B, & C have work times of 10msec, 15msec, & 5msec and deadlines every 30msec, 40msec, & 50msec respectively, is this schedulable?
MMOS: Rate Monotonic • Prioritize process by 1 / rate • A would have priority 33 (1/30) • B would have priority 25 (1/40) • C would have priority 20 (1/50) • When CPU becomes available • Pick process w/ highest priority & run, preempting as needed
MMOS: Earliest Deadline First • RMS (Rate Monotonic Scheduling) fails, even if the processes are theoretically schedulable • EDF ALWAYS works if theoretically schedulable • Sort processes by deadline • Run processes w/ closest deadline, preempting as needed
Summary • Flavors of Scheduling • General Real-time • Rate Monotonic • Earliest Deadline First • EDF guarantees schedulability (if theoretically schedulable) • But slow, so keep RMS around if usable