![]() |
![]() |
![]() |
![]() |
This chapter describes common playback errors and how to manage them.
The MME offers a number of methods for handling problems with media and with the environment in which it is used. These problems include damaged media, corrupt files, and vibrations in the environment.
Many of the options that configure the way the MME handles problems with media and its environment are configured in io-media. For more information, see io-media in the chapter MME Utilities Reference.
When they encounter a read problem, many CD drivers (such as devb-eide) automatically retry the read until they time out. If the read problem is due to vibrations, there is a good chance that the vibrations will cease before the time out and that the playback will continue successfully. However, if the read problem is due to scratched or otherwise damaged media, the read will continue to fail until the drive times out and delivers an EIO error.
This behavior indicates that driver read timeouts should be configured differently depending on the environment in which a drive is installed:
To set the timeout period for a drive, use the command-line options for your CD drive. For more information about setting the driver time-out period, refer to the documentation for the CD driver or drivers you are using.
To permit uninterrupted playback to the user in the event of recoverable read errors (such as errors caused by vibrations) io-media buffers data. By default, io-media queues 49 buffers of data for playback. The data is buffered before decompression, so the play time for these buffers varies according to the amount of compression used for the media tracks being played. Total buffered play time available with 49 buffers is, approximately:
Other media formats have comparable buffered play times, depending on the level of data compression.
You can specify the number of buffers available for queued playback via the io-media configuration file.
If io-media encounters a read error from a CD drive and it cannot recover within the time set in the device driver timeout configuration, the MME will attempt to skip ahead to a different part of the track and continue playing. If the MME encounters a read error at the new location, it increases the skip time and attempts to read the media at a third location. If this read fails, the MME repeats the process until one of the following conditions occurs:
![]() |
Note that io-media may skip ahead due to damaged (scratched) media or to vibrations in the environment; io-media knows only that the CD drive reported a read error and that it needs to skip to another part of the track it is trying to play. |
You should configure io-media at startup to define how it behaves in the event of playback read errors. Configurable settings are:
For example, with the skip seek time set to 120 milliseconds and the increment percent set to 50, if io-media is unable to play from a point on a track, it will:
When io-media is able to resume playback, it resets the skip seek time to the configured time.
![]() |
If a track is being played backwards, and io-media is configured to skip on error, io-media:
|
For more information about configuring playback read error recovery behavior, see “Configuring how the MME handles playback read errors” in the MME Configuration Guide. For information about how to configure io-media, see io-media in the MME Utilities Reference.
When the MME receives the instruction to play a track (mme_play(), mme_next(), or mme_prev()), it attempts to start playback of the requested track. If the requested track is not playable because the media is damaged (e.g. a scratched CD), the MME attempts to play the next track, continuing until it finds a playable track or it has tried and failed to play every track in the track session. This behavior prevents the MME from processing any other request until it has found a playable file or attempted to play every track in the track session.
To stop the MME from attempting to play every track in a track session, you can call mme_stop() to stop playback, and switch playback to another track session on another mediastore, such as the HDD, then eject the bad mediastore. You can determine the conditions under which your client application will use mme_stop() to stop a track session. For example, your client application can stop a track session after it receives several MME_PLAY_ERROR_READ and/or MME_PLAY_ERROR_CORRUPT events in sequence.
The MME provides a flag that identifies unplayable files. Your client application can use this flag to filter unplayable files from track sessions. If the MME is unable to play a track, it:
The playable field does not apply to files that the MME can start to play but on which it encounters errors later during playback. The MME marks only files for which it cannot initiate playback because, for example, the file is invalid, the codec for the file format is not available, or DRM forbids playback of the file.
For errors that occur after playback starts (e.g. a track is so badly scratched in the middle that io-media gives up trying to read it, or an MP3 file is corrupt somewhere in the middle), the MME doesn't send an MME_PLAY_ERROR* event and the playable field isn't set to 0 (zero). In these cases, the MME delivers an MME_EVENT_TRACKCHANGE event when it goes to play the next track.
To ensure that your client application does not attempt to play files marked as unplayable, you can include the clause WHERE playable=1, in the SQL SELECT statement you use to build your track sessions.
The <SkipUnplayable> configuration element can be used to have the MME automatically skip unplayable files without sending any error messages to the client application. For more information, see “Automatically skip files marked as unplayable” in the MME Configuration Guide.
To support handling of damaged media, when it encounters read errors, the MME returns the following events, depending on the type of read error condition encountered:
To support this behavior, the enumerated type mm_warnings_t has the following values:
typedef enum e_mm_warnings { MM_WARNING_READ_TIMEOUT = 0x1, MM_WARNING_READ_ERROR = 0x2, } mm_warnings_t;
![]() |
![]() |
![]() |
![]() |