Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
S/PDIF
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Protocol specifications== S/PDIF is used to transmit digital signals in a number of formats, the most common being the 48 kHz [[sample rate]] format (used in [[Digital Audio Tape]] and [[DVD]]s) and the 44.1 kHz format, used in [[CD audio]]. In order to support both sample rates, as well as others that might be needed, the format has no defined [[bit rate]]. Instead, the data is sent using [[biphase mark code]], which has either one or two transitions for every bit, allowing the original [[word clock]] to be extracted from the signal itself. S/PDIF protocol differs from [[AES3]] only in the channel status bits; see {{section link|AES3|Protocol}} for the high-level view. Both protocols group 192 samples into an audio block, and transmit one channel status bit per sample, providing one 192-bit ''channel status word'' per channel per audio block. For S/PDIF, the 192-bit status word is identical between the two channels and is divided into 12 [[Word (data type)|words]] of 16 bits each, with the first 16 bits being a control code. {| class="wikitable" |+ S/PDIF control word components<ref>{{webarchive |url=https://web.archive.org/web/20190228070051/https://www.av-iq.com/avcat/images/documents/pdfs/digaudiochannelstatusbits.pdf/ |title=Understanding/Analyzing Digital Audio Channel Status Bits}}</ref> |- ! Byte ! Bit !width=45%| Unset (0) !width=45%| Set (1) |- ! rowspan=7 | 0 ! 0 | Consumer (S/PDIF) | Professional (AES3)<br />(changes meaning to [[AES3#Channel status word|AES3 channel status word]]) |- ! 1 | Normal PCM | Compressed data |- ! 2 | Copy restrict | Copy permit |- ! 3 | 2 channels | 4 channels |- ! 4 | β | β |- ! 5 | No pre-emphasis | [[Pre-emphasis]] 50/15 |- ! {{nowrap|6β7}} | colspan="2" | Mode, defines subsequent bytes; values other than zero are undefined. |- ! rowspan=2 | 1 ! 0β6 | colspan="2" | Audio source category indicating the type of source equipment (general, CD-DA, DVD, etc.) |- ! 7 | colspan="2" | L-bit, original or copy{{efn-ua|(for most category codes) indicates whether copy-restricted audio is original (may be copied once) or a copy (does not allow recording again). The L-bit is only used if bit 2 is zero, meaning copy-restricted audio. The L-bit polarity depends on the category, with recording allowed if it is 1 for DVD-R and DVD-RW, but 0 for CD-R, CD-RW, and DVD. For plain CD-DA (ordinary nonrecordable CDs), the L-bit is not defined, and recording is prevented by alternating bit 2 at a rate of 4β10 Hz.}} |- ! rowspan=2 | 2 ! 0β3 | colspan="2" | Source number |- ! 4β7 | colspan="2" | Channel number |- ! rowspan=3 | 3 ! 0β3 | colspan="2" | Sampling frequency: {{n-ary|0000|2}}: 44.1 kHz, {{n-ary|0100|2}}: 48 kHz, {{n-ary|1100|2}}: 32 kHz |- ! 4β5 | colspan="2" | Clock accuracy: {{n-ary|10|2}}: 50ppm,{{n-ary|00|2}}: 1100ppm, {{n-ary|01|2}}: variable pitch (requires compatible receiver) |- ! 6β7 | colspan="2" {{n/a|Undefined}} |- ! rowspan=3 | 4 ! 0 | Word length 20 bits | Word length 24 bits |- ! 1β3 | colspan="2" | Sample length (0: undefined, 1β4: word length minus 1-4 bits, 5: full word length) |- ! 4β7 | colspan="2" {{n/a|Undefined}} |- ! 5β10 ! 0-7 | rowspan=2 colspan="2" | EAN-13 code (possibly in binary-coded decimal) |- ! rowspan=2 | 11 ! 0-3 |- ! 4β7 | colspan="2" {{n/a|Undefined; padding on 13-digit EAN code}} |- ! 12β13 ! 0-7 | rowspan=2 colspan="2" {{n/a|Undefined}} |- ! rowspan=2 | 14 ! 0β3 |- ! 4-7 | rowspan=2 colspan="2" | ISRC (encoding unclear; ISRC is 2 alphabetic, 3 alphanumeric and 7 numeric, which is 26<sup>2</sup> Γ 36<sup>3</sup> Γ 10<sup>7</sup> β 2<sup>48.164</sup> and so obviously fits into 7.5 bytes, but a naive 5 ASCII + 7 BCD would be 8.5 bytes) |- ! 15β21 ! 0β7 |- ! {{nowrap|22β23}} ! 0β7 | colspan="2" {{n/a|Undefined}} |} {{Notelist-ua}} === Data framing === S/PDIF is meant to be used for transmitting 20-bit audio data streams plus other related information. S/PDIF can also transport 24-bit samples by way of four extra bits; however, not all equipment supports this, and these extra bits may be ignored. To transmit sources with less than 20 bits of sample accuracy, the superfluous bits will be set to zero, and the 4:1–3 bits (sample length) are set accordingly. ==== IEC 61937 encapsulation ==== IEC 61937 defines a way to transmit compressed, multi-channel data over S/PDIF.<ref>Digitalton - Schnittstelle fΓΌr nichtlinear-PCM-codierte Audio-BitstrΓΆme unter Verwendung von IEC 60958 - Teil 1: Allgemeines (IEC 61937-1:2007 + A1:2011); Deutsche Fassung EN 61937-1:2007 + A1:2011</ref> * The control word bit 0:1 is set to indicate the presence of non-linear-PCM data. * The sample rate is set to maintain the needed symbol (data) rate. The symbol rate is usually 64 times the sample rate. * Data is packed into blocks. Each data block is given a IEC 61937 preamble, containing two 16-bit sync words and indicating the state and identity (type, validity, bitstream number, length) of encapsulated data present. Padding is added to match full block size as required by timing. A number of encodings are available over IEC 61937, including Dolby [[Dolby Digital|AC-3]]/[[E-AC-3]], [[Dolby TrueHD]], MP3, AAC, [[ATRAC]], [[DTS Coherent Acoustics|DTS]], and [[WMA Pro]].<ref>{{cite web |title=FFmpeg: libavformat/spdif.h File Reference |url=https://ffmpeg.org/doxygen/trunk/spdif_8h.html |website=ffmpeg.org}}</ref><ref>{{cite web |title=Representing Formats for IEC 61937 Transmissions - Win32 apps |url=https://learn.microsoft.com/en-us/windows/win32/coreaudio/representing-formats-for-iec-61937-transmissions |website=learn.microsoft.com |language=en-us |date=15 May 2023}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
S/PDIF
(section)
Add topic