<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>twam.info &#187; SPDIF</title>
	<atom:link href="http://www.twam.info/tag/spdif/feed" rel="self" type="application/rss+xml" />
	<link>http://www.twam.info</link>
	<description>My computer, physics, electronics &#38; photography blog</description>
	<lastBuildDate>Wed, 25 Jan 2012 20:49:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Simultaneity in the AirPlay Universe</title>
		<link>http://www.twam.info/hardware/apple/simultaneity-in-the-airplay-universe</link>
		<comments>http://www.twam.info/hardware/apple/simultaneity-in-the-airplay-universe#comments</comments>
		<pubDate>Wed, 28 Sep 2011 19:59:14 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Airplay]]></category>
		<category><![CDATA[Apple TV]]></category>
		<category><![CDATA[iMac]]></category>
		<category><![CDATA[SPDIF]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=2103</guid>
		<description><![CDATA[Most Apple products support the streaming of audio (and some even video) data through the network to AirPlay enabled devices like Apple TV, AirPort Express or third vendor products. Apple advertises the AirPlay technology with: [...], you can stream your tunes to more than one room simultaneously, [...]. AirPlay works over Wi-Fi or an Ethernet [...]]]></description>
			<content:encoded><![CDATA[<p>Most <a href="http://www.apple.com">Apple</a> products support the streaming of audio (and some even video) data through the network to<br />
<a href="http://www.apple.com/itunes/airplay/">AirPlay</a> enabled devices like <a href="http://www.apple.com/appletv/">Apple TV</a>, <a href="http://www.apple.com/airportexpress/">AirPort Express</a> or third vendor products. Apple advertises the AirPlay technology with:<br />
<blockquote>[...], you can stream your tunes to more than one room simultaneously, [...]. AirPlay works over Wi-Fi or an Ethernet connection, or a combination of both.</p></blockquote>
<p>But how simultan can these devices stream under real world conditions? I tried to address this issue with two 2nd generation Apple TVs and an <a href="http://www.apple.com/imac/">iMac</a> Streaming through Wi-Fi and <a href="http://en.wikipedia.org/wiki/Gigabit_Ethernet">Gigabit Ethernet</a>. It proved to be a difficult task to measure this precisely!<span id="more-2103"></span></p>
<p>The 2nd generation Apple TV has only an optical <a href="http://en.wikipedia.org/wiki/TOSLINK">TOSLINK</a> audio output and a <a href="http://en.wikipedia.org/wiki/HDMI">HDMI</a> output, there is no way to get the analog audio signal directly. My first idea to compare the <a href="http://en.wikipedia.org/wiki/S/PDIF">S/PDIF</a> data streams was difficult. It was required to convert the data stream to electrical signals to be able to analyse them with my oscilloscope. As the fiber optic receiving modules TORX* from <a href="http://www.toshiba.de/">Toshiba</a> are dependent from the power supply the signal wasn&#8217;t 100% identical. I also discarded my second idea to use simple S/PDIF-to-<a href="http://en.wikipedia.org/wiki/RCA_connector">RCA</a> connectors. There are either cheap and of questionable quality or rare and expensive and could also have an impact on the measurement. So I decided another way to go:</p>
<p><div id="attachment_2121" class="wp-caption alignright" style="width: 220px"><a href="http://www.twam.info/hardware/apple/simultaneity-in-the-airplay-universe/attachment/scope_41" rel="attachment wp-att-2121"><img src="http://www.twam.info/wp-content/uploads/2011/09/scope_41-210x126.png" alt="Screenshot of RAW S/PDIF data" title="Screenshot of RAW S/PDIF data" width="210" height="126" class="size-medium wp-image-2121" /></a><p class="wp-caption-text">Screenshot of RAW S/PDIF data</p></div>I connected the iMac and the 2 Apple TVs using optical TOSLINK cables to 3 <a href="http://media.digikey.com/pdf/Data%20Sheets/Toshiba%20PDFs/TORX177PL,F,T.pdf">TORX177PL</a>. They were powered with 5V using a <a href="http://en.wikipedia.org/wiki/Power_Supply#Programmable_power_supply">programmable power supply</a>. The output signal was grabbed with my <a href="http://www.twam.info/electronics/agilent-dso-x3014a">Agilent DSO-X 3014A</a> which saved the data to an USB stick in RAW Format. Then the data was copied to my iMac and post-processed using a self-written program which extracts the S/PDIF stream from the RAW data file, decodes it and writes the actual audio data to an output file. As the oscilloscope recorded the signal of all 3 sources at the same time it is possible to make statements about the relative times.</p>
<p>I did all the measurements using a 10 minute 16 bit uncompressed <a href="http://en.wikipedia.org/wiki/Audio_Interchange_File_Format">AIFF</a> file with a 50 Hz tone using a 48000 kHZ sample rate to have the same conditions for all measurements. The 50 Hz tone has a periodicity of 20 ms, which was the maximum time frame I was able to measure at one measurement. If I would have chosen larger time frames, the time resolution wouldn&#8217;t be enough to decode the S/PDIF signal without errors. As I would not be able to measure time delays of more than 20 ms with that method I did several test measurements with music audio data and the delay was always below 20 ms.</p>
<p>The following picture shows an example measurement after decoding the S/PDIF data stream. The red signal comes from the optical output of the iMac, the green signal from an Apple TV connected by WiFi and the blue signal from an Apple TV connected by Ethernet.</p>
<p><a href="http://www.twam.info/hardware/apple/simultaneity-in-the-airplay-universe/attachment/scope_22" rel="attachment wp-att-2124"><img src="http://www.twam.info/wp-content/uploads/2011/09/scope_22.png" alt="Example measurement" title="Example measurement" width="640" height="480" class="aligncenter size-full wp-image-2124" /></a></p>
<p>As we chose an exact 50 Hz sine tone it was easy to fit the time differences with <a href="http://www.gnuplot.info/">gnuplot</a>. We also fitted the time difference in reference to the iMac. In this example the green curve from the WiFi connected Apple TV has a delay of 0.42 ms and the blue curve from the Ethernet connected Apple TV has a delay of 1.39 ms.</p>
<p>We did a total of 30 measurements: 10 with both Apple TV connected to WLAN, 10 with one Apple TV connected to WLAN and the other one connected to LAN and 10 with both Apple TV connected to LAN. The following figure shows a summary of the time delays measured. After 10 measurements, when the connection was changed, both Apple TVs were restarted a reselected in iTunes as additional speakers. It&#8217;s strange to see, that the devices connected to Ethernet have longer delays than those connected to WiFi.</p>
<p><a href="http://www.twam.info/hardware/apple/simultaneity-in-the-airplay-universe/attachment/data" rel="attachment wp-att-2135"><img src="http://www.twam.info/wp-content/uploads/2011/09/data.png" alt="Time delays" title="Time delays" width="640" height="480" class="aligncenter size-full wp-image-2135" /></a></p>
<p>This cannot be seen that easily in music audio data as the next example shows. As both Apple TV devices output the data as a 48 kHZ S/PDIF stream whereas the iMac produces an 44.1 kHZ S/PDIF stream the signal is a little bit different, but in this example it&#8217;s easy to see, that Apple TV connected to Ethernet is about 0.1 ms before the iMac whereas the Apple TV connected to WiFi is about 0.3 ms behind.</p>
<p><a href="http://www.twam.info/hardware/apple/simultaneity-in-the-airplay-universe/attachment/scope_50-2" rel="attachment wp-att-2137"><img src="http://www.twam.info/wp-content/uploads/2011/09/scope_501.png" alt="WiFi/Ethernet comparison" title="WiFi/Ethernet comparison" width="640" height="480" class="aligncenter size-full wp-image-2137" /></a></p>
<p>In summary it can be said, that the latency between the different sources is less than 2 ms which is in my opinion a rather good value compared to how easy this thing is to install. Just plug it in and it just works, independent from the connection over Ethernet of WiFi.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/hardware/apple/simultaneity-in-the-airplay-universe/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SPDIF Ausgang für die Audigy 2 ZS</title>
		<link>http://www.twam.info/electronics/spdif-audigy2</link>
		<comments>http://www.twam.info/electronics/spdif-audigy2#comments</comments>
		<pubDate>Sat, 29 Dec 2007 18:00:18 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Audigy]]></category>
		<category><![CDATA[SPDIF]]></category>

		<guid isPermaLink="false">http://blog.twam.info/?p=91</guid>
		<description><![CDATA[Da ich mir nach langer Zeit nun auch einen richtigen Dolby Digital Verstärker bestellt habe, um meine Creative Inspire Boxen upzugraden, will ich natürlich auch den PC an den Verstärker anschließen. Da ein optisches SPDIF-Kabel Brummschleifen vermeidet, sollte dies der Weg meiner Wahl sein, doch er scheint nicht ganz so einfach zu gehen. Die Audigy [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_92" class="wp-caption alignright" style="width: 220px"><a href="http://www.twam.info/wp-content/uploads/2009/03/spdif-board.jpg"><img class="size-medium wp-image-92" title="SPDIF_IO Ausgang auf Audigy 2 ZS" src="http://www.twam.info/wp-content/uploads/2009/03/spdif-board-300x230.jpg" alt="SPDIF_IO Ausgang auf Audigy 2 ZS" width="210" height="161" /></a><p class="wp-caption-text">SPDIF_IO Ausgang</p></div>
<p>Da ich mir nach langer Zeit nun auch einen richtigen Dolby Digital Verstärker bestellt habe, um meine Creative Inspire Boxen upzugraden, will ich natürlich auch den PC an den Verstärker anschließen. Da ein optisches SPDIF-Kabel Brummschleifen vermeidet, sollte dies der Weg meiner Wahl sein, doch er scheint nicht ganz so einfach zu gehen.</p>
<p>Die Audigy 2 ZS (meine Soundkarte) bietet nämlich nur in der Platinum Edition optische SPDIF Ein-/Ausgänge. Nach etwas googlen im Internet bin ich auf die Homepage von Ralf Einhorn &#8220;<a onclick="window.open(this.href, '_blank'); return false;" href="http://www.mml.uni-hannover.de/einhorn/spdif/index.html">SPDIF-I/O für Creative SB Live und Audigy</a>&#8221; gestoßen. Er beschreibt dort zwar hervorragend, wie das Problem zu lösen ist, leider aber nur mit Creatives SoundBlaster Live! oder der Audigy in der ersten Version. In der FAQ ist zu lesen, das es mit Version 2 leider nicht funktioniert.<span id="more-91"></span></p>
<div id="attachment_93" class="wp-caption alignright" style="width: 220px"><a href="http://www.twam.info/wp-content/uploads/2009/03/spdif-oszi.jpg"><img class="size-medium wp-image-93" title="SPDIF Ausgänge an Audigy 2 ZS mit Oszi gemessen" src="http://www.twam.info/wp-content/uploads/2009/03/spdif-oszi-300x218.jpg" alt="SPDIF Ausgänge an Audigy 2 ZS mit Oszi gemessen" width="210" height="153" /></a><p class="wp-caption-text">SPDIF Ausgänge mit Oszi gemessen</p></div>
<p>Da aber auch meine Audigy 2 ZS einige Anschlussmöglichkeiten bietet und die Platinum Edition diese Anschlüsse ja vorweist, war ich damit nicht zufrieden. Ich machte mich also selbst auf die Suche. Mein Erkenntnisse gibt es hier online. Natürlich übernehme ich keinerlei Haftung.</p>
<p>Den SPDIF_IO Anschluss auf meiner Audigy 2 ZS fand ich besonders vielversprechend. Also packte ich das Oszilloskop aus und begann zu messen. Dabei kam ich zu folgendem Ergebnis:</p>
<p>Pin 1 liegt dauernd auf Vcc<br />
Pin 3,4,6,7,8 liegen auf Masse.<br />
Pin 5 ist unbekannt.<br />
Pin 9 ist der SPDIF-out.</p>
<div id="attachment_94" class="wp-caption alignright" style="width: 138px"><a href="http://www.twam.info/wp-content/uploads/2009/03/spdif-io.gif"><img class="size-full wp-image-94" title="Steckerbelegung" src="http://www.twam.info/wp-content/uploads/2009/03/spdif-io.gif" alt="Steckerbelegung" width="128" height="101" /></a><p class="wp-caption-text">Steckerbelegung</p></div>
<p>Dass es sich bei Pin 9 um den SPDIF-out handeln muss, war mit Hilfe des Oszilloskopes leicht herauszufinden. Ich klemmte Kanal 1 (gelb) an den externen SPDIF-out (Klinkenstecker) und verglich es mit Pin 9 auf dem zweiten Kanal (blau).</p>
<p>Da nur noch Pin 5 als möglicher Anschluss für den SPDIF-in übrig bleibt, schließe ich mal daraus, dass es dieser ist und komme damit zu der Belegung die rechts im Bild zu sehen ist.</p>
<p>Leider funktionierte bei mir Ralf Einhorns Schaltung nicht auf Anhieb. Als ich sie aber etwas vereinfacht habe, funktionierte der Ausgang bei mir einwandfrei. Den Eingang habe ich nicht getestet.</p>
<p><a href="http://www.twam.info/wp-content/uploads/2009/03/spdif-schaltung.gif"><img class="aligncenter size-full wp-image-95" title="spdif-schaltung" src="http://www.twam.info/wp-content/uploads/2009/03/spdif-schaltung.gif" alt="spdif-schaltung" width="510" height="213" /></a></p>
<div id="attachment_96" class="wp-caption alignright" style="width: 199px"><a href="http://www.twam.info/wp-content/uploads/2009/03/spdif-slot1.jpg"><img class="size-medium wp-image-96" title="ASUS SPDIF Connector" src="http://www.twam.info/wp-content/uploads/2009/03/spdif-slot1-300x219.jpg" alt="Slotblende innen" width="189" height="138" /></a><p class="wp-caption-text">Slotblende innen</p></div>
<p>Als ich mich ans Platinen basteln machen wollte, fiel mir ein, dass ich von meinem ASUS-Board noch einen SPDIF-Adapter hatte. Nach genauerer Untersuchung stellt sich heraus, dass dieser auch nur aus einem Widerstand und dem Senderbaustein bestand. Also hab ich ihn mal kurzer Hand angeschlossen (Vcc, Masse und SPDIF-out verbunden). Und siehe da: Es klappte einwandfrei.</p>
<p>Nun kann ich mit meiner Audigy 2 ZS auch einen digital optischen Ausgang nutzen.</p>
<div id="attachment_99" class="wp-caption alignright" style="width: 199px"><a href="http://www.twam.info/wp-content/uploads/2009/03/spdif-slot2.jpg"><img class="size-medium wp-image-99" title="ASUS SPDIF Connector" src="http://www.twam.info/wp-content/uploads/2009/03/spdif-slot2-300x175.jpg" alt="Slotblende außen" width="189" height="110" /></a><p class="wp-caption-text">Slotblende außen</p></div>
<p>Da es einige Nachfragen bezüglich des ASUS SPDIF Boards gab:</p>
<p>Die Belegung ist recht einfach:</p>
<p><a href="http://www.twam.info/wp-content/uploads/2009/03/spdif-asusbelegung.gif"><img class="aligncenter size-full wp-image-97" title="spdif-asusbelegung" src="http://www.twam.info/wp-content/uploads/2009/03/spdif-asusbelegung.gif" alt="spdif-asusbelegung" width="80" height="20" /></a></p>
<p>Mit einem selbstgebastelten Kabeladapter (einfach die &#8220;Farben&#8221; verbinden) sieht das dann so aus:</p>
<div id="attachment_98" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.twam.info/wp-content/uploads/2009/03/spdif-fertig.jpg"><img class="size-medium wp-image-98" title="spdif-fertig" src="http://www.twam.info/wp-content/uploads/2009/03/spdif-fertig-300x187.jpg" alt="Fertiges Ergebnis" width="300" height="187" /></a><p class="wp-caption-text">Fertiges Ergebnis</p></div>
<p><strong>Hinweis</strong></p>
<p>Die Audigy 2 ZS Karte kann selbst nur ein Stereosignal auf dem SPDIF Port ausgeben. Dieses kann entweder in 48kHz oder 96kHz erfolgen, aber nicht alle Receiver können mit 96kHz umgehen.</p>
<p>Wenn man Mehrkanalton über den SPDIF Port übertragen will, muss dieser schon komprimiert an die Soundkarte geschickt werden. Jede DVD-Abspielsoftware macht das z.B. wenn man dort als Ausgangsformat SPDIF einstellt. Dann gibt die Audigy die Daten einfach nur durch und es hängt vom Receiver ab, was er damit anfangen kann. Hier gilt Vorsicht, wenn DTS Ton ausgewählt wird, da viele Receiver diesen auch nicht interpretieren können.</p>
<p>Will man z.B. den Mehrkanalton in Spielen (EAX) auf dem Receiver hören, muss man diesen zusätzlich analog (über 3 Kabel (vorne, hinten, center/subwoofer)) verbinden, da die Audigy nicht in der Lage ist, die Kanäle ins Dolby Digital Format umzuwandeln.</p>
<p>Gleiches gilt für die DVD-Audio. Hier kann die Soundkarte den Ton decodieren und über die analogen Ports ausgeben. Auf dem SPDIF Port erfolgt hier ebenfalls nur eine Ausgabe in Stereo.</p>
<p>Seit kurzem bietet Creative einen <a onclick="window.open(this.href, '_blank'); return false;" href="http://de.europe.creative.com/shop/product.asp?product=1114">Analog-to-DTS Converter DTS-610</a> mit dem sich dann auch der Analogton digital an den Receiver anschließen läßt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/electronics/spdif-audigy2/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>

