Download Multimedia Files

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Scheduling (computing) wikipedia , lookup

Transcript
Chapter 19/20: Real-time
and Multimedia Systems
Inclusions from Tanenbaum, Boss,
Modern Operating Systems, 2014
Operating System Concepts – 8th Edition,
Silberschatz, Galvin and Gagne ©2009
Multimedia and Real-Time Systems
 Multimedia files
 Compression
 Requirements of Multimedia Kernels
 CPU Scheduling
 Disk Scheduling
 Network Management
Operating System Concepts – 8th Edition
20.2
Silberschatz, Galvin and Gagne ©2009
What is Multimedia?
 Document or file containing two or more continuous
media.
 Media that must be accessed and played back at a
specific rate or over a specific time interval.
Operating System Concepts – 8th Edition
20.3
Silberschatz, Galvin and Gagne ©2009
What is Multimedia
 Multimedia data is stored in the file system like other
ordinary data
 Key characteristics of multimedia:

Multimedia files can be large!


100 minute movie (mpeg) requires 1.125 GB
Multimedia uses high data transfer rates

Comes from the nature of visual and acoustic information
–
Eye and ear can process prodigious amounts of information and
must be fed at a constant rate.

Multimedia requires real-time playback

Once a file is delivered to a client, it must continue at a certain rate
of playback.
Operating System Concepts – 8th Edition
20.4
Silberschatz, Galvin and Gagne ©2009
Definitions: Streaming
 Streaming is delivering a multimedia file from a server to a client - typically
the deliver occurs over a network connection
 There are two different types of streaming:
1. Progressive download - the client begins playback of the multimedia file
as it is delivered. The file is ultimately stored on the client computer
2. Real-time streaming - the multimedia file is delivered to - but not stored
on - the client’s computer
Operating System Concepts – 8th Edition
20.5
Silberschatz, Galvin and Gagne ©2009
Definitions: Real-time Streaming
 There are two types of real-time streaming:
(1) Live streaming - used to deliver a live event while it is occurring
(2) On-demand streaming - used to deliver media streams such as movies,
archived lectures, etc. The events are not delivered in real-time
Operating System Concepts – 8th Edition
20.6
Silberschatz, Galvin and Gagne ©2009
Multimedia Operating System Issues
The operating system must guarantee the specific data rate and timing
requirements of continuous media
QOS : Quality of Service
Guarantee specific rate and timing requirements of media
Guarantee clear picture/voice synchronization
Influences OS tasks such as
 Compression and decoding may require significant CPU
 Disk Scheduling: File systems must be efficient to meet rate requirements
 CPU Scheduling: multimedia task must be scheduled with certain priorities
to ensure meeting deadline requirements of continuous media.
 Network protocols must support bandwidth requirements
Operating System Concepts – 8th Edition
20.7
Silberschatz, Galvin and Gagne ©2009
Multimedia Files
 Multimedia files are… more than one…
Operating System Concepts – 8th Edition
20.8
Silberschatz, Galvin and Gagne ©2009
Multimedia Files : Video
 For example, video must be displayed at 24-30 frames per second.
Multimedia video data must be delivered at a rate which guarantees 24-30
frames/second.
Experiments show that people notice a flicker less than 24 frames / second
SO, to increase frame rate
Progressive technique
- use more bandwidth to send more frames
Interlacing: (analog)
- show odd scan lines then show even ones
Operating System Concepts – 8th Edition
20.9
Silberschatz, Galvin and Gagne ©2009
Multimedia Files : Video
Operating System Concepts – 8th Edition
20.10
Silberschatz, Galvin and Gagne ©2009
Multimedia Files : Video
 For example, video must be displayed at 24-30 frames per second.
Multimedia video data must be delivered at a rate which guarantees 24-30
frames/second.
Experiments show that people notice a flicker less than 24 frames / second
SO, to increase frame rate
Progressive technique
- use more bandwidth to send more frames
Interlacing: (analog)
- show odd scan lines then show even ones

Repaint the screen (digital)
Operating System Concepts – 8th Edition
20.11
Silberschatz, Galvin and Gagne ©2009
Multimedia Files : Audio
Audio waves are converted to binary by quantizing
the sample of the sine wave
Operating System Concepts – 8th Edition
20.12
Silberschatz, Galvin and Gagne ©2009
Multimedia Files: Compression
Multimedia files are big.
 Because of the size and rate requirements of multimedia systems,
multimedia files are often compressed into a smaller form

Compression requires 2 algorithms: encoding - decoding
 JPEG – (Joint Photographic Experts Group)

Quantizes blocks of the picture so that each shows the amount by which
it differs from the corresponding element in the previous block.
• Linearizes the elements to
produces the bit string file.
Operating System Concepts – 8th Edition
20.13
Silberschatz, Galvin and Gagne ©2009
Multimedia Files: Compression
MPEG – (Motion Picture Experts Group)
 3 different kinds of frames

I (Intra-coded) frames:
Self-contained JPEG pictures

P (predictive) frames:


Block by block differences with last frame
B (Bidirectional) frames:

Differences from the last and next frame.
Operating System Concepts – 8th Edition
20.14
Silberschatz, Galvin and Gagne ©2009
Multimedia Files
 Multimedia files are… more than one…
Operating System Concepts – 8th Edition
20.15
Silberschatz, Galvin and Gagne ©2009
Multimedia Files : Video
Definitions:
Flicker is determined by the number of times the screen is painted/sec.
A still image painted 20 frames/sec will not show jerky motion but it will
flicker because the image will decay from the retina.
Smoothness of motion is determined by the number of different images /sec
A movie with 20 different frames/sec, each painted 4x in a row will not
flicker, but the motion will appear jerky
Operating System Concepts – 8th Edition
20.16
Silberschatz, Galvin and Gagne ©2009
Multimedia File Systems
 File placement

Contiguous
Interleave video, audio and text in a single contiguous file per movie

Block model
Operating System Concepts – 8th Edition
20.17
Silberschatz, Galvin and Gagne ©2009
Multimedia File Systems
 Use a different paradigm than traditional file systems

Traditional: open > read (block) > read (unrelated block)
… doesn’t work
Pull Server
Push
Server
• Predictable next buffer
• Timing deadlines
• Rate requirements
Operating System Concepts – 8th Edition
20.18
Silberschatz, Galvin and Gagne ©2009
Disk Scheduling
 Disk scheduling algorithms must be optimized to meet the timing deadlines
and rate requirements of continuous media
 Earliest-Deadline-First (EDF) Scheduling
 SCAN-EDF Scheduling
Operating System Concepts – 8th Edition
20.19
Silberschatz, Galvin and Gagne ©2009
Disk Scheduling (Cont)
 The EDF scheduler uses a queue to order requests according to the time it
must be completed (its deadline)
Operating System Concepts – 8th Edition
20.20
Silberschatz, Galvin and Gagne ©2009
Disk Scheduling (Cont)
 SCAN-EDF scheduling is similar to EDF except that requests with the same
deadline are ordered according to a SCAN policy
Operating System Concepts – 8th Edition
20.21
Silberschatz, Galvin and Gagne ©2009
Deadline and cylinder requests for SCAN-EDF scheduling
Operating System Concepts – 8th Edition
20.22
Silberschatz, Galvin and Gagne ©2009
CPU Scheduling
 Multimedia systems require hard realtime scheduling to ensure critical
tasks will be serviced within timing deadlines
 Most hard realtime CPU scheduling algorithms assign realtime
processes static priorities that do not change over time
Operating System Concepts – 8th Edition
20.23
Silberschatz, Galvin and Gagne ©2009
Requirement of Multimedia Operating Systems
 There are three levels of QoS
(1) Best-effort service - the system makes a best effort with no QoS
guarantees
(2) Soft QoS - allows different traffic streams to be prioritized, however
no QoS guarantees are made
(3) Hard QoS - the QoS rquirements are guaranteed
Operating System Concepts – 8th Edition
20.24
Silberschatz, Galvin and Gagne ©2009
Further QoS Issues
 Different processes must run at different frequencies with different amounts
of work with different deadlines
 Scheduling of multiple competing processes, some or all with different
deadlines to be met
Operating System Concepts – 8th Edition
 real-time scheduling
20.25
Silberschatz, Galvin and Gagne ©2009
Real-Time CPU Scheduling
 Periodic processes require the CPU at specified intervals (periods)
 p is the duration of the period
 d is the deadline by when the process must be serviced
 t is the processing time
Operating System Concepts – 8th Edition
20.26
Silberschatz, Galvin and Gagne ©2009
3 periodic processes
Operating System Concepts – 8th Edition
20.27
Silberschatz, Galvin and Gagne ©2009
Multimedia Disk Scheduling

Operating System Concepts – 8th Edition
20.28
Silberschatz, Galvin and Gagne ©2009
Rate Montonic Scheduling
 A priority is assigned based on the inverse of its period
 Shorter periods = higher priority;
 Longer periods = lower priority
 P1 is assigned a higher priority than P2.
Operating System Concepts – 8th Edition
20.29
Silberschatz, Galvin and Gagne ©2009
Earliest Deadline First Scheduling
 Priorities are assigned according to deadlines:
the earlier the deadline, the higher the priority;
the later the deadline, the lower the priority
Operating System Concepts – 8th Edition
20.30
Silberschatz, Galvin and Gagne ©2009
Network Management
 Three general methods for delivering content from a server to a client
across a network:
(1) Unicasting - the server delivers the content to a single client
(2) Broadcasting - the server delivers the content to all clients, regardless
whether they want the content or not
(3) Multicasting - the server delivers the content to a group of receivers who
indicate they wish to receive the content
Operating System Concepts – 8th Edition
20.31
Silberschatz, Galvin and Gagne ©2009
RealTime Streaming Protocol (RTSP)
 Standard HTTP is stateless whereby the server does not maintain the
status of its connection with the client
Operating System Concepts – 8th Edition
20.32
Silberschatz, Galvin and Gagne ©2009
Streaming media from a conventional web server
Operating System Concepts – 8th Edition
20.33
Silberschatz, Galvin and Gagne ©2009
Realtime Streaming Protocol
Operating System Concepts – 8th Edition
20.34
Silberschatz, Galvin and Gagne ©2009
RTSP States
 SETUP - the server allocates resources for a client session
 PLAY - the server delivers a stream to a client session
 PAUSE - the server suspends delivery of a stream
 TEARDOWN - the server breaks down the connection and releases the
resources allocated for the session
Operating System Concepts – 8th Edition
20.35
Silberschatz, Galvin and Gagne ©2009
RTSP state machine
Operating System Concepts – 8th Edition
20.36
Silberschatz, Galvin and Gagne ©2009
End of Chapter 20
Operating System Concepts – 8th Edition,
Silberschatz, Galvin and Gagne ©2009
Operating System Concepts – 8th Edition
20.38
Silberschatz, Galvin and Gagne ©2009
Exercise 20.10
Operating System Concepts – 8th Edition
20.39
Silberschatz, Galvin and Gagne ©2009