<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Got Kernel?</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/chadduffey/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/chadduffey/feed.xml</link>
    <description>A very public place to store those little bits of information i know i will need sometime down the track</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:30:06 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Implement Background Audio for Modern Windows Applications</title>
      <link>https://docs.microsoft.com/archive/blogs/chadduffey/implement-background-audio-for-modern-windows-applications</link>
      <pubDate>Fri, 27 Jun 2014 16:05:00 GMT</pubDate>
      <dc:creator><![CDATA[Chad Duffey]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chadduffey/2014/06/27/implement-background-audio-for-modern-windows-applications/</guid>
      <description><![CDATA[I had a requirement to test some background audio scenarios for my team and found it more difficult...]]></description>
      <content:encoded><![CDATA[<p>I had a requirement to test some background audio scenarios for my team and found it more difficult than i expected to get this done.</p>
<p>There is documentation out there (references at the end of this post), but i didn&#39;t find anything that went end to end without any gaps for an inexperienced Windows 8 developer like me to follow. I also noticed some of the content had changed a little since Windows 8 was released.</p>
<p>This post will show you how to implement basic background audio in a working (JavaScript based) sample for Windows 8.1.</p>
<p>Starting right at the beginning:</p>
<p>1. Open Visual Studio and select the options to create a new project, based on the JavaScript &quot;Blank App&quot; template. (The name, location etc. are up to you).</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/new.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/new.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/new.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/new.PNG" border="0" /></a></p>
<p>2. &#39;OK&#39; the new application wizard and you should arrive at the basic new application screen with the default.js open and a list of resources listed under your solution on the right.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/firstscreen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/firstscreen.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/firstscreen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/firstscreen.PNG" border="0" /></a></p>
<p>3. Add an .mp3 to the solution to test things out with. (For a real project you will want to build a file picker, but for this we can just add an .mp3 to the project).</p>
<p>You can do this by creating a &#39;audio&#39; folder and adding the file to play in the new folder.</p>
<p>Right click on the Application name under solution explorer, then select &quot;Add&quot;, &quot;New Folder&quot;.</p>
<p>I called the new folder &quot;audio&quot; but it doesn&#39;t matter too much what you call it.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/newfolder.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/newfolder.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/newfolder.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/newfolder.PNG" border="0" /></a></p>
<p>4. Right click on your new &quot;audio&quot; folder and choose &quot;Add&quot;, &quot;Existing Item&quot;. Then navigate to the audio file you want to use in the &#39;Add Item&#39; dialog.</p>
<p>You should end up with a solution explorer that looks like this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/addaudio.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/addaudio.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/addaudio.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/addaudio.PNG" border="0" /></a></p>
<p>5. At this point, we could go right ahead and make a simple change that would allow us to play the track. Lets do that just to see some progress.</p>
<p>In Solution Explorer, go to default.html and double click it to open it in the main window. Then insert the following 3 lines of HTML 5 code:</p>
<p><span style="font-family:courier new,courier;">&lt;audio id=&quot;audiotag&quot; controls=&quot;controls&quot;&gt;</span><br /><span style="font-family:courier new,courier;">&lt;source src=&quot;audio/b.mp3&quot; /&gt;</span><br /><span style="font-family:courier new,courier;">&lt;/audio&gt;</span></p>
<p>Default.html&nbsp;should look like this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/default-html-1.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/default_2D00_html_2D00_1.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/default-html-1.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/default_2D00_html_2D00_1.PNG" border="0" /></a></p>
<p>6. You should now have an app that plays audio. You should start the application to test this is true. (Click on the big green play button that says &quot;local machine&quot; at the top).</p>
<p>The application should look like this (and play the file you added):</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/v1.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/v1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/v1.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/v1.png" border="0" /></a></p>
<p>The thing you will notice&nbsp;is that when you switch to another application or minimize the app, your audio stops playing. At this point, the app is not capable of background audio (try it).</p>
<p>To get the application ready for background audio, there are three high level&nbsp;steps:</p>
<p><span style="color:#008000;"><strong>a) A background audio declaration must be in the app manifest.</strong></span></p>
<p><span style="color:#008000;"><strong>b) You must set the stream category (msAudioCategory) to either Communications or BackgroundCapableMedia.</strong></span></p>
<p><span style="color:#008000;"><strong>c) Your app must register for media transport controls.</strong></span></p>
<p>Expanding on each:</p>
<p><strong>a) Declare background audio in the application manifest:</strong></p>
<p>You can do this part graphically or in the xml.&nbsp;</p>
<p>Double click on the <strong>package.appxmanifest</strong> file in the solution explorer window and it will open up the manifest settings in a nice UI:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/appmanifest.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/appmanifest.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/appmanifest.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/appmanifest.PNG" border="0" /></a></p>
<p>In the editor choose the &quot;Declarations&quot; tab, then click the &quot;Add&quot; button:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/appmanifest4.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/appmanifest4.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/appmanifest4.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/appmanifest4.PNG" border="0" /></a></p>
<p>You need to select &quot;Audio&quot; and type &quot;default.html&quot; in for the start page.</p>
<p>That&#39;s it for part a) we can close the <strong>package.appxmanifest</strong> file.</p>
<p><strong>b) Set the stream category (msAudioCategory) to BackgroundCapableMedia</strong></p>
<p>This part is a snap. Just jump back to the HTML in &quot;<strong>default.html</strong>&quot; and change the audio element to include this information.</p>
<p>The original 3 lines of HTML now looks like this:</p>
<p><span style="font-family:courier new,courier;">&lt;audio id=&quot;audiotag&quot; controls=&quot;controls&quot; msAudioCategory=&quot;BackgroundCapableMedia&quot;&nbsp;&gt;</span><br /><span style="font-family:courier new,courier;">&lt;source src=&quot;audio/b.mp3&quot; /&gt;</span><br /><span style="font-family:courier new,courier;">&lt;/audio&gt;</span></p>
<p>In the editor:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/default-html-2.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/default_2D00_html_2D00_2.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/default-html-2.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/default_2D00_html_2D00_2.PNG" border="0" /></a></p>
<p>(Don&#39;t worry that the msAudioCategory attribute has a squiggle under it for now)</p>
<p><strong>c) Register for the media transport controls</strong></p>
<p>Because you are playing background audio, you must register and handle the media controls.</p>
<p>What are they?</p>
<p>They are the&nbsp;buttons you get when you navigate away from your background audio playing application that let you handle volume and song selection:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/audiocontrols.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/audiocontrols.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/audiocontrols.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/audiocontrols.PNG" border="0" /></a></p>
<p>Without this functionality in your app, the background audio wont work (but the audio will while the app has focus).</p>
<p>To get it done (the <span style="text-decoration:underline;">minimal amount</span>) you need to add some code:</p>
<p>In solution explorer navigate to the &quot;js&quot; folder, then open the &quot;<strong>default.js</strong>&quot; file.</p>
<p>When it is first opened, it will look like this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/default-js.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/default_2D00_js.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/default-js.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/default_2D00_js.PNG" border="0" /></a></p>
<p>We need to add the following code (explanations are&nbsp;inline):</p>
<p>In <strong>app.onactivated</strong> we add:</p>
<p><span style="font-family:courier new,courier;">//add the media control</span><br /><span style="font-family:courier new,courier;">var MediaControls = Windows.Media.MediaControl;</span></p>
<p><span style="font-family:courier new,courier;">// Add event listeners for the buttons</span><br /><span style="font-family:courier new,courier;">MediaControls.addEventListener(&quot;playpressed&quot;, play, false);</span><br /><span style="font-family:courier new,courier;">MediaControls.addEventListener(&quot;pausepressed&quot;, pause, false);</span><br /><span style="font-family:courier new,courier;">MediaControls.addEventListener(&quot;playpausetogglepressed&quot;, playpausetoggle, false);</span></p>
<p><span style="font-family:courier new,courier;">// Add event listeners for the audio element</span><br /><span style="font-family:courier new,courier;">document.getElementById(&quot;audiotag&quot;).addEventListener(&quot;playing&quot;, playing, false);</span><br /><span style="font-family:courier new,courier;">document.getElementById(&quot;audiotag&quot;).addEventListener(&quot;paused&quot;, paused, false);</span><br /><span style="font-family:courier new,courier;">document.getElementById(&quot;audiotag&quot;).addEventListener(&quot;ended&quot;, ended, false);</span></p>
<p>The result for <strong>app.onactivated</strong> will look like this (note the code is added just after the default code but before the closing brace):</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/onactivatedcode.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/onactivatedcode.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/onactivatedcode.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/onactivatedcode.PNG" border="0" /></a></p>
<p>Now all we need is handler functions for that media control. Again, a very basic example might look like this:</p>
<p><span style="font-family:courier new,courier;">// Define functions that will be the event handlers</span><br /><span style="font-family:courier new,courier;">function play() {</span></p>
<p><span style="font-family:courier new,courier;">}</span></p>
<p><span style="font-family:courier new,courier;">function pause() {</span></p>
<p><span style="font-family:courier new,courier;">}</span></p>
<p><span style="font-family:courier new,courier;">function playpausetoggle() {</span></p>
<p><span style="font-family:courier new,courier;">}</span></p>
<p><span style="font-family:courier new,courier;">function playing() {</span></p>
<p><span style="font-family:courier new,courier;">}</span></p>
<p><span style="font-family:courier new,courier;">function paused() {</span></p>
<p><span style="font-family:courier new,courier;">}</span></p>
<p><span style="font-family:courier new,courier;">function ended() {</span></p>
<p><span style="font-family:courier new,courier;">}</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/handlerfunctions.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/handlerfunctions.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/handlerfunctions.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/handlerfunctions.PNG" border="0" /></a></p>
<p>We paste the functions in just above the <strong>app.start();</strong> code.</p>
<p>Note that none of the wiring is done. However, we should find that the application will now play the audio in the background.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/playing.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/playing.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/playing.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/playing.PNG" border="0" /></a></p>
<p>As expected, the audio continues to play in the background when the app is minimized or another app is switched in. We also get the audio controls although they don&#39;t do anything.</p>
<p>(I&#39;ve attached the very basic solution to this post - i removed the audio file so you just need to add an mp3 in the audio folder - call it b.mp3 to make it simple, or modify the code with your file name).</p>
<p>That&#39;s it. Seems straight forward to me now, but it took me longer than it should have, hence the blog post.</p>
<p>The appropriate resources are:</p>
<p>Being Productive When your App is Off-screen - <a href="https://blogs.msdn.com/b/windowsappdev/archive/2012/05/16/being-productive-when-your-app-is-offscreen.aspx">Blog post</a>.</p>
<p>Adding Audio to a Windows Application - <a href="https://msdn.microsoft.com/en-us/library/windows/apps/hh452730.aspx">MSDN</a>.</p>
<p>Audio Sample Code - <a href="https://code.msdn.microsoft.com/windowsapps/Playback-Manager-e6526e67">MSDN</a>.</p>
<p>Background Media - <a href="https://channel9.msdn.com/Events/BUILD/BUILD2011/PLAT-776T">Channel 9 Talk</a></p>
<p>Configure Media Controls - <a href="https://msdn.microsoft.com/en-us/library/windows/apps/hh452722.aspx">MSDN</a> (shows you how to complete the controls)</p>
<p>Programming Windows Apps - <a href="https://blogs.msdn.com/b/microsoft_press/archive/2012/10/29/free-ebook-programming-windows-8-apps-with-html-css-and-javascript.aspx">Free eBook</a></p>
<p>Have a great weekend.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/10170/00/00/03/63/37/05/App3.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-10170-00-00-03-63-37-05/App3.zip">App3.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>DRAM refresh &amp; PASR</title>
      <link>https://docs.microsoft.com/archive/blogs/chadduffey/dram-refresh-pasr</link>
      <pubDate>Fri, 14 Mar 2014 18:25:00 GMT</pubDate>
      <dc:creator><![CDATA[Chad Duffey]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chadduffey/2014/03/14/dram-refresh-pasr/</guid>
      <description><![CDATA[You can think of DRAM&nbsp;like a big array of buckets&nbsp;for storing electrical charge. Every...]]></description>
      <content:encoded><![CDATA[<p>You can think of DRAM&nbsp;like a big array of buckets&nbsp;for storing electrical charge. Every bucket represents a single binary digit.&nbsp;If&nbsp;the bucket is full, we have a 1, if its less than a certain&nbsp;capacity we have a 0.</p>
<p>Unfortunately, the buckets can leak pretty quickly and retaining the content is what this post is all about.&nbsp;The buckets we should probably call capacitors.&nbsp;The array is an integrated circuit.&nbsp;This post is concerned with&nbsp;how&nbsp;we retain the &quot;data&quot;&nbsp;despite the&nbsp;energy&nbsp;constantly&nbsp;dissipating from the&nbsp;cell.&nbsp;&nbsp;</p>
<p>It goes something like this:</p>
<p>During the active operation of a Windows device the contents of system memory (<em>our buckets</em>) are maintained through a process called&nbsp;&ldquo;<strong>automatic refresh</strong>&rdquo;.&nbsp;It also gets a zap when the DRAM is &lsquo;touched&rsquo; through via a &ldquo;normal&rdquo; read or write.</p>
<p><em>(It is interesting to note that read operations from DRAM are destructive; during a read the charge is removed from the cell, and the sense amplifiers on the chip rewrite the cell in much the same way a write operation would occur ).</em></p>
<p>The amount of time between automatic refreshes is specific to the DRAM type but it is usually expressed in milliseconds. (As an example, automatic refresh is required at least every 64ms in the DDR2 specification ).&nbsp; <br /><br />The automatic refresh operation is responsible for a large portion of the total system power cost during active (screen on) device use.<br /><br />During screen off, or standby, a different approach is taken although&nbsp;memory refresh&nbsp;can still be a&nbsp;significant part of the total standby power consumption. <br /> <br /><strong>Self-refresh</strong>, sometimes referred to as IDD6 is a DRAM power mode where the memory controller clock is deactivated to reduce the power consumption of the system.<br /> <br />During self-refresh the DRAM automatically executes a refresh operation using the internal DRAM refresh counter rather than relying on the memory controller clock to signal an automatic refresh.<br /><br />In the context of a Windows system &lsquo;standby&rsquo; is during sleep (S3) or Connected Standby. Both low power modes require the contents of system memory to be maintained. This is in contrast to &lsquo;Hibernate&rsquo; (S4) mode where the contents of memory are saved to the hard disk and the DRAM turned off with the rest of the system. S4 has a considerable impact on the time taken to wake the device compared to sleep but an improvement in standby capacity because the DRAM refresh is disabled once the memory content is saved to disk.<br /> <br />In addition to the self-refresh mode there are a series of power management features defined in the&nbsp;DRAM specifications and implemented by some DRAM manufacturers to further reduce the power consumption of a device during standby.<br /> <br />Some of the advanced power features for memory are enabled and configured during DRAM or system manufacture, others may be exposed via system firmware and controlled and optimized by the operating system in partnership with the device manufacturer.</p>
<p><strong>Partial Array Self Refresh</strong> <strong>(PASR)</strong> is one such feature. PASR allows portions of a memory array to be put into a no refresh state while the device is operating in standby.<br /> <br />Typically the entire memory array is put into self-refresh during standby because there is the hardware has no knowledge of memory content, no way to determine which pages are important to the system. The assumption must be that the entire DRAM array contains important data.<br /> <br />Using PASR the Operating System&nbsp;should intelligently place data during active use so that only a portion of the DRAM requires self-refresh during standby (because the OS has grouped memory pages in an efficient way).</p>
<p>In the example below memory pages are placed in bank 1 and bank 0 only, allowing self-refresh to be disabled on the other banks during standby.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/pasr1.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/pasr1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/pasr1.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/pasr1.png" border="0" /></a></p>
<p>In the LP-DDR3 JEDEC specification PASR uses two registers to control which memory banks, and which segments should be refreshed during standby.</p>
<p>-&nbsp;Mode Register 16 (MR16), the bank mask<br />-&nbsp;Mode Register 17 (MR17), the segment mask</p>
<p>DRAM modules that support PASR are divided into Banks and Segments.</p>
<p>A DRAM module typically contains 8 banks and each bank is broken into 8 segments.</p>
<p>The PASR registers MR16, and MR17 contain 8 bits each. The 8 bits in each register line up with the 8 banks, and 8 segments of those banks. In this way, the register provides a mask of the banks requiring self-refresh and which do not. The registers can be manipulated by the memory controller to control which banks should be refreshed at a given time.</p>
<p>It is important to note that there is not an individual register for each bank. This would mean that the granularity offered by this bitmask is not individual segments on individual banks, but rather &ndash; the same segments on every bank if the segment mask (MR17) is in use.</p>
<p>Another interesting point is that in the specification,&nbsp;the PASR mode registers are documented as write only. There is no interface to determine the current value of the registers; only to write the value. So the system would need to maintain knowledge of the banks currently being self refreshed.</p>
<p>It sounds really interesting. I should mention, I don&#39;t actually know of a system that is actively using PASR yet. That&#39;s not to say they don&#39;t exist, i just haven&#39;t found one. I will add a reference to this post if/when i do.&nbsp;&nbsp;</p>
<p>Before i sign off,&nbsp;there is another self-refresh&nbsp;feature called <strong>Temperature Controlled Self Refresh (TCSR)</strong> worth a quick introduction:</p>
<p><strong>TCSR </strong>is based on the idea is that the electrical charge in DRAM dissipates at a lower rate when&nbsp;a device is cool. So, as the device cools down during sleep&nbsp;we&nbsp;wont need to charge the DRAM cells as frequently. So, in the (LP-DDR) specifications for DRAM there is a feature (TCSR)&nbsp;which is able to detect when the&nbsp;device&nbsp;has cooled down to actively&nbsp;reduce the self-refresh frequency.&nbsp;This give us longer battery life.&nbsp;Neat.</p>
<p>The real point of this post -&nbsp;references for DRAM refresh:&nbsp;</p>
<p>JEDEC DDR3 Specification<br /><a href="https://www.jedec.org/standards-documents/docs/jesd-79-3d">https://www.jedec.org/standards-documents/docs/jesd-79-3d</a></p>
<p>JEDEC DDR2 Specification<br /><a href="https://www.jedec.org/standards-documents/docs/jesd-79-2e">https://www.jedec.org/standards-documents/docs/jesd-79-2e<br /></a> <br />JEDEC LP-DDR3 Specification<br /><a href="https://www.jedec.org/sites/default/files/docs/JESD209-3.pdf">https://www.jedec.org/sites/default/files/docs/JESD209-3.pdf</a>&nbsp;<br /> <br />JEDEC LP-DDR2 Specification<br /><a href="https://www.jedec.org/sites/default/files/docs/JESD209-2B.pdf">https://www.jedec.org/sites/default/files/docs/JESD209-2B.pdf</a><br /><br />Temperature Controlled Self Refresh: Micron <br /><a href="https://www.elpida.com/pdfs/E0599E20.pdf">https://www.elpida.com/pdfs/E0599E20.pdf</a><br /><br />PASR Reference: Micron <br /><a href="https://www.elpida.com/pdfs/E0597E10.pdf">https://www.elpida.com/pdfs/E0597E10.pdf</a><br /><br />Deep Power Down Whitepaper: Micron <br /><a href="https://www.elpida.com/pdfs/E0598E21.pdf">https://www.elpida.com/pdfs/E0598E21.pdf</a><br /><br />Elpida Memory FAQ:<br /><a href="https://www.elpida.com/en/products/faq.html#tech-dr">https://www.elpida.com/en/products/faq.html#tech-dr</a> <br /><br />Micron: Low-Power versus Standard DDR SDRAM<br /><a href="https://download.micron.com/pdf/technotes/DDR/tn4615.pdf">https://download.micron.com/pdf/technotes/DDR/tn4615.pdf</a>&nbsp; <br /><br />LP-DDR2 - the new mainstream for embedded and mobile applications? <br /><a href="https://www.denali.com/wordpress/index.php/dmr/2010/05/20/lpddr2-the-new-mainstream-memory-for-emb">https://www.denali.com/wordpress/index.php/dmr/2010/05/20/lpddr2-the-new-mainstream-memory-for-emb</a>&nbsp; <br /><br />Texas Instruments: Keystone Architecture for DDR3 Memory Controller<br /><a href="https://www.ti.com/lit/ug/sprugv8c/sprugv8c.pdf">https://www.ti.com/lit/ug/sprugv8c/sprugv8c.pdf</a>&nbsp; <br /><br />Wiki: Mobile DDR<br /><a href="https://en.wikipedia.org/wiki/Mobile_DDR">https://en.wikipedia.org/wiki/Mobile_DDR</a>&nbsp; <br /><br />ELPIDA: Low power function of Mobile RAM<br /><a href="https://www.elpida.com/pdfs/E0597E10.pdf">https://www.elpida.com/pdfs/E0597E10.pdf</a>&nbsp; <br /><br />Research Paper: Trends in Low Power RAM circuit technologies<br /><a href="https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&amp;arnumber=371965">https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&amp;arnumber=371965</a>&nbsp; <br /><br />Data Sheets for LP-RAM from Micron<br /><a href="https://www.micron.com/products/dram/mobile-lpdram#fullPart&amp;306=0">https://www.micron.com/products/dram/mobile-lpdram#fullPart&amp;306=0</a></p>]]></content:encoded>
    </item>
    <item>
      <title>What is Application Launch Prefetching?</title>
      <link>https://docs.microsoft.com/archive/blogs/chadduffey/what-is-application-launch-prefetching</link>
      <pubDate>Fri, 14 Mar 2014 18:24:05 GMT</pubDate>
      <dc:creator><![CDATA[Chad Duffey]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chadduffey/2014/03/14/what-is-application-launch-prefetching/</guid>
      <description><![CDATA[In a nutshell, it is about speeding up the launch of Windows client applications by optimizing the...]]></description>
      <content:encoded><![CDATA[<p>In a nutshell, it is about speeding up the launch of Windows client applications by optimizing the startup IO.</p>
<p>Digging in:</p>
<p>When an application is launched the required code and data pages are unlikely to be read from contiguous locations on the storage device. More often than not part of the file is read, then other parts in the same file, parts of other required files and maybe other parts of the original binary.<br />&nbsp; <br />In terms of application performance and startup time this is undesirable because the jumping between distant locations on storage slows application startup time considerably. The cost of retrieving random IO compared to sequential IO can be significant.</p>
<p>How significant?</p>
<p>Well, take a look at notepad:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/notepad-dlls.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/notepad_2D00_dlls.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/notepad-dlls.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/notepad_2D00_dlls.PNG" border="0" /></a></p>
<p>There are parts of 30 binaries in the notepad&nbsp;address space. 30&nbsp;files we needed to find on the disk!</p>
<p>Consider the (worst case) scenario where none, or very few of the binaries already reside in memory&nbsp;and none of them sit contiguously on disk. Lets say the disk has 10ms of seek latency...</p>
<p>30 x 10ms = 300ms&nbsp;of seek latency just to <span style="text-decoration:underline;">find</span>&nbsp;the pages required to start the application because we are&nbsp;jumping all over the disk looking for the pieces required by the process.</p>
<p><em>Of course, the example&nbsp;is oversimplified - there may be pages already resident in memory which can soft faulted into the process address space;&nbsp;not all the process binaries in the diagram&nbsp;are needed for launch, and there are other optimizations at play. (Also, even with prefetch, the IO is not necessarily contiguous in terms of physical location, however, the IO is issued sequentially). </em></p>
<p>But&nbsp;the example&nbsp;gives you an idea of the problem&nbsp;application prefetch is intended to solve.&nbsp;Also keep in mind that notepad is a simple application... take a look at outlook.exe or internet explorer to see a <em>real</em> list of binaries in a process address space.&nbsp;</p>
<p><em>(Note: Solid State Disks [SSD&#39;s] come up a lot when discussing this feature. Issuing sequential IO is still <span style="text-decoration:underline;">very</span> beneficial to SSD even without the rotational latency mentioned above. This is especially true on a busy device where we want to get all the startup IO into the queue together)</em><br />&nbsp;<br />Anyway - To improve application launch experience the Applaunch Prefetch component was implemented way back in Windows XP as a <span style="text-decoration:underline;">component</span>&nbsp;of the Sysmain Windows service (%systemroot%\System32\Sysmain.dll).<br />&nbsp; <br />Applaunch prefetch attempts to improve startup time by optimizing the startup IO of windows applications.&nbsp;Prefetch optimizes for more sequential IO by reading the initial application IO in large efficient batches.<br />&nbsp;<br />Prefetch achieves this optimization by monitoring the code and data required for an application to launch. The prefetcher monitors up to the first 10 seconds of application startup with heuristics to stop sooner if the launch is completed sooner (when the application stops faulting pages).<br />&nbsp;<br />The prefetch trace data is then written to a per-application file in %systemroot%\Prefetch.<br />&nbsp;<br />The trace file names in the prefetch directory are comprised of the application name with a hexadecimal representation of the file path (hash) and a .pf extension.</p>
<p>For example: c:\windows\Prefetch\WINWORD.EXE-2437DA78.pf.</p>
<p>Trace files (.pf) describe the pages that were historically accessed by the application during launch.</p>
<p>You can use Mark Russinovich&#39; s <a href="https://technet.microsoft.com/en-us/sysinternals/bb897439.aspx">strings</a> application&nbsp;to inspect a prefetch file if you are interested.</p>
<p>This is the notepad.exe example from above:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/strings-notepadprefetch.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/strings_2D00_notepadprefetch.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/strings-notepadprefetch.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/strings_2D00_notepadprefetch.PNG" border="0" /></a>&nbsp;</p>
<p>When an application is launched the prefetcher looks in the prefetch directory to determine whether a .pf file is present for the application.</p>
<p>If the .pf file exists, the kernel component of the prefetcher issues asynchronous IOs to prefetch metadata, data, and image pages described in the trace file (.pf file).</p>
<p>In an effort to further optimize performance, every 72 hours during system idle time the Sysmain service provides information that can be used by the system defragmenter. The information is provided to enable defrag to physically order files and directories in the order they are referenced during application launch. This order is stored in the %systemroot%\Prefetch\Layout.ini file.</p>
<p>The Sysmain service does not run defragmentation, it only provides data for systems that have defragmentation enabled (SSD&#39;s have defrag off).</p>
<p>And that&#39;s the bulk of it.</p>
<p>The impact is pretty big. In some recent tests we saw between 10% and 80%&nbsp;improvement in application launch times across multiple devices, multiple applications, with multiple configurations doing all sorts of different things.&nbsp;</p>
<p>Interestingly,&nbsp;the biggest improvements are when devices&nbsp;are under a heavy IO load.&nbsp;The smallest gains are&nbsp;on&nbsp;SSD devices&nbsp;with no load at all. Issuing the IO in large contiguous chunks is very beneficial&nbsp;for application launch because&nbsp;the application is not constantly waiting in line behind other IO every time it needs to jump to a different binary.&nbsp;</p>
<p>You could think of it as: One person waiting in line to buy movie tickets for&nbsp;the whole family rather than each person doing it individually. (Especially if they turn up&nbsp;a few milliseconds seconds apart and having a random stranger jump into the line between you).</p>
<p>In the good scenario, you turn up at the counter with your five ticket requests and they are all completed at once.&nbsp;You head on in to the cinema, happy days.</p>
<p>In the bad scenario, you line up and get your ticket. Then you have to wait on your wife, who is behind some dude deciding between pop corn and a chock top.&nbsp;Then, you both have to wait on your son who is behind three&nbsp;other folk in the line... etc.&nbsp;Its going to take a while before you get in to the cinema because you all have to go together.</p>
<p>Well, its roughly the same&nbsp;deal for your application launch IO. We cant start till we fetch all the pages we need for launch.</p>
<p>Have a great weekend.&nbsp;&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Fessing up. The "30 minute application" took a couple of weeks...</title>
      <link>https://docs.microsoft.com/archive/blogs/chadduffey/fessing-up-the-30-minute-application-took-a-couple-of-weeks</link>
      <pubDate>Fri, 14 Mar 2014 18:19:00 GMT</pubDate>
      <dc:creator><![CDATA[Chad Duffey]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chadduffey/2014/03/14/fessing-up-the-30-minute-application-took-a-couple-of-weeks/</guid>
      <description><![CDATA[Yep, in the end, the &quot;30 minute application&quot; took me a couple of weeks to get into the...]]></description>
      <content:encoded><![CDATA[<p>Yep, in the end, the &quot;30 minute application&quot; took me a couple of weeks to get into the application store.</p>
<p>This was partly because I wasn&#39;t paying attention, partly because i didn&#39;t allocate time, but to be honest, partly because the simple app generator tool mentioned in the previous post allowed me to create an application that failed the assessment.</p>
<p>(Your application goes through assessment when you try to publish it to the store).</p>
<p>The first two problems are mine to fix up.</p>
<p>The third problem i wanted to touch on quickly since i posted how &quot;easy&quot; it was to get an application in the store, and how &quot;anyone&quot; could do it. And i managed to mess it up.</p>
<p>For the most part, i still maintain its pretty simple using the tool&nbsp;- but here are&nbsp;some extra&nbsp;caveats:</p>
<p>1. The tool will allow you to make&nbsp;mistakes. Not many, but its possible.&nbsp;(My mistake was choosing a background that actually made some of the content unreadable if a person had their phone set up a certain way).</p>
<p>2. You still need to know how to take some screenshots of the application to include with your store submission. (I failed to do this, and i failed to write it in the previous post).</p>
<p>The good news is, for every mistake you make, the submission people send you a &quot;how to&quot; on fixing the problem. It comes in a very easy to read .pdf that explains it all.</p>
<p>The down side is that you might have a couple of days wait while the review happens.</p>
<p>Anyway - the final result of the &quot;30 minute app&quot; is here: <br /><br /><a href="https://www.windowsphone.com/s?appid=1d4c4ece-97fc-4d2b-98d1-93deb5fe46c7">https://www.windowsphone.com/s?appid=1d4c4ece-97fc-4d2b-98d1-93deb5fe46c7</a></p>
<p>Its not much to look at, but it was great to be able to follow the create -&gt; submit -&gt; publish process with an easy example.</p>
<p>Looking forward to adding some real functionality to the app at some point, but i can see how it would be very useful for small business to get up and running quickly.</p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>"Build" a Windows Phone App in 30 minutes using only your web browser</title>
      <link>https://docs.microsoft.com/archive/blogs/chadduffey/build-a-windows-phone-app-in-30-minutes-using-only-your-web-browser</link>
      <pubDate>Fri, 21 Feb 2014 15:15:00 GMT</pubDate>
      <dc:creator><![CDATA[Chad Duffey]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chadduffey/2014/02/21/build-a-windows-phone-app-in-30-minutes-using-only-your-web-browser/</guid>
      <description><![CDATA[It is incredibly easy to build a real Windows Phone application.
So easy, you could do it with your...]]></description>
      <content:encoded><![CDATA[<p>It is incredibly easy to build a real Windows Phone application.</p>
<p>So easy, you could do it with your kids, this weekend, in less than an hour. (30 minutes&nbsp;if you aren&#39;t doing chocolate milk&nbsp;&amp; cookie breaks while you work).</p>
<p>HUGE CAVEAT: Be realistic, it wont be the next Angry Birds,&nbsp;it probably wont make you rich. The next Angry Birds is&nbsp;probably not going to happen in an hour, without tools, in your browser, drinking chocolate milk and eating cookies. But,&nbsp;your application&nbsp;will look slick&nbsp;and it will be available in the store to show your mum/dad/wife/etc very soon after you finish it.</p>
<p>If you have a small business,&nbsp;an application&nbsp;is&nbsp;a great&nbsp;way to promote it.</p>
<p>[<em>By the way, I completely understand that this isn&#39;t a Kernel topic at all. I just wanted to share the experience in case anyone else was up for an hour of fun that has nothing to do with our day job</em>.]</p>
<p>First step&nbsp;- Go to this site:</p>
<p><a href="https://appstudio.windowsphone.com/">https://appstudio.windowsphone.com/</a></p>
<p>In truth, that&#39;s very close to all you need&nbsp;from this post. You essentially follow the&nbsp;prompts from that point onwards.&nbsp;But let me share the&nbsp;application&nbsp;my five year old son&nbsp;and I just built.</p>
<p>The application is&nbsp;just a simple&nbsp;interface to this site. (I couldn&#39;t think of anything more creative this high up in the stack).</p>
<p>The site:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/app%20screen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/app-screen.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/app%20screen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/app-screen.PNG" border="0" /></a></p>
<p>Log in, and then choose a template for your application...</p>
<p>I just choose blank.&nbsp;The UI to drag and drop content from the blank template&nbsp;is&nbsp;very easy. But, if you would prefer, there are templates for restaurant menus, fitness plans, goals, all sorts of stuff.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/basics.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/basics.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/basics.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/basics.PNG" border="0" /></a></p>
<p>Once you choose a template you can select&nbsp;where to pull data from. In my case, this blog&nbsp;website using RSS. If you want, you can just add static data as well and just republish the application when you want to change it.</p>
<p>Then you&nbsp;start to navigate through the bits and pieces about colors, fonts etc.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/tiles.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/tiles.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/tiles.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/tiles.PNG" border="0" /></a></p>
<p>(Yes, i know this blog is really,&nbsp;boringly simple... i just wanted to share how easy it actually is to get something in the store you can have your friends download and use).</p>
<p>Once you have colors, content, layout done all you need to do is choose some publishing information and whether you want ads in your application (to make some cash) and boom, you are just about done.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/finsih.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/finsih.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/finsih.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/finsih.PNG" border="0" /></a></p>
<p>Choose finish and you will be prompted on which type of application you want to generate.</p>
<p>(I chose Windows Phone 8 for simplicity)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/generate.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/generate.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/generate.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/generate.PNG" border="0" /></a></p>
<p>Right at the end, after&nbsp;your application has&nbsp;finished generating it gets slightly trickier if you haven&#39;t published an application before. Its not a big deal, it&nbsp;is because you need to know how to take the application package and move it to the Windows store.</p>
<p>Its not difficult, just something you mess about with once and then its pretty simple from that point onwards.</p>
<p>(If you want to,you can install the application on your phone, or friends phones by providing a certificate rather than using the store at all. But to get it in the store, you have to download the publish package and submit it to the store as an application.)</p>
<p>To get the application into the store, download the &quot;<strong>publish package</strong>&quot;:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/pp.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/pp.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/pp.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/pp.PNG" border="0" /></a></p>
<p>Once you have the package, go to the phone developer site.</p>
<p><a href="https://developer.windowsphone.com/en-us">https://developer.windowsphone.com/en-us</a></p>
<p>There is a link that says &quot;submit an app&quot;</p>
<p>You will see a heap of options, but you can scroll past most of&nbsp;them and down the bottom you will be prompted to &quot;agree to continue&quot; (of course, read all the terms etc. first).</p>
<p>If this is your first time developing something for the Windows Store you might be prompted to set up some account details.</p>
<p>Once you are done, you will arrive at this screen:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/dashboard.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/dashboard.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/dashboard.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/dashboard.PNG" border="0" /></a></p>
<p>Once again, click &quot;submit app&quot; and then start to fill out the details of the application.</p>
<p>Eventually, you will be prompted to provide the package you downloaded - the &quot;<strong>publish package</strong>&quot;.</p>
<p>Mine looks like this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/pubpackage.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/pubpackage.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/pubpackage.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/pubpackage.PNG" border="0" /></a></p>
<p>You will choose the markets it should go to (Australia, US, Canada etc.), and then type of application category&nbsp;your application belongs to.&nbsp;There are few other details but&nbsp;it is all fairly intuitive stuff.</p>
<p>Once you answer all the questions, you are done:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/done.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/done.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/done.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/done.PNG" border="0" /></a></p>
<p>Within a few hours, you should have an application to try out.</p>
<p>I will upload mine on this blog once it hits the store.</p>
<p>Angry Birds riches here i come!</p>
<p>Thanks,</p>
<p>Chad</p>]]></content:encoded>
    </item>
    <item>
      <title>Fun with Breakpoints</title>
      <link>https://docs.microsoft.com/archive/blogs/chadduffey/fun-with-breakpoints</link>
      <pubDate>Sun, 16 Feb 2014 19:07:00 GMT</pubDate>
      <dc:creator><![CDATA[Chad Duffey]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chadduffey/2014/02/16/fun-with-breakpoints/</guid>
      <description><![CDATA[In the previous post we looked at the task of attaching a debugger to a Windows machine.
The topic...]]></description>
      <content:encoded><![CDATA[<p>In the previous post we looked at the task of attaching a debugger to a Windows machine.</p>
<p>The topic is reasonably interesting on its own because you can start to mess about in there, especially if you crack open the in-built help (not kidding, it is an exceptional help file)&nbsp;to start exploring.</p>
<p>So, the thing is, when we attach the debugger to the system we take control but the&nbsp;target appears frozen while we are broken in. Wouldn&#39;t it be cool if we could just let the system run as normal until it arrived at the spot we&nbsp;were interested in? Potentially we could just keep using the system as normal till it does that thing that has been irking you.</p>
<p>The next logical step then - is to explore the system using breakpoints!</p>
<p>For example, say we want to explore what happens when we create files in Windows...</p>
<p>Well, MSDN tells us one&nbsp;function that can be used to create files is ntCreateFile (or zwCreateFile).&nbsp;MSDN tells us this here: <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff566424(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/hardware/ff566424(v=vs.85).aspx</a></p>
<p>Then - lets do a breakpoint for that function so we can just break in right when the system is doing that stuff...</p>
<p>Example:</p>
<p>1. Break into the system using the techniques in the previous post: <a href="https://bit.ly/MYhESc">https://bit.ly/MYhESc</a></p>
<p>2. At the debugger type <strong>bp zwcreatefile</strong></p>
<p><strong><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/zwcreatefile.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/zwcreatefile.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/zwcreatefile.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/zwcreatefile.PNG" border="0" /></a><br /></strong></p>
<p><strong><br /></strong>3. Now hit <strong>g</strong> to let the system run. The plan is, if the debugger notices that function being called we should break in at that point and we can dig around and learn about the function and how it works.</p>
<p>In this example, the function is called and the debugger breaks in.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/breakpoint%20hit.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/breakpoint-hit.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/breakpoint%20hit.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/breakpoint-hit.PNG" border="0" /></a></p>
<p>We can have a dig around using commands like <strong>k</strong> to display the call stack or <strong>ub</strong> to &quot;unnasemble backwards&quot; (unassembled the current function backwards and display the instructions - in this example we have picked up the PfQuerySuperFetchInformation function and you can see if calling the NtCreateFile function). We will do some messing around with debugger commands in another post shortly.</p>
<p>That&#39;s about it, setting a breakpoint is fairly simple if you know the function you are interested in.</p>
<p>Oh! To remove the breakpoints type <strong>bd * </strong>to clear them all, or <strong>bd&nbsp;&quot;{function}&quot;</strong> to&nbsp;disable (bd == breakpoint disable)&nbsp;that one. You can also use <strong>bl</strong> to list the breakpoints that are currently set.</p>
<p>Thanks!</p>
<p>Chad</p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Cheat Sheet: Break into a Windows machine with a debugger</title>
      <link>https://docs.microsoft.com/archive/blogs/chadduffey/cheat-sheet-break-into-a-windows-machine-with-a-debugger</link>
      <pubDate>Sat, 15 Feb 2014 18:06:32 GMT</pubDate>
      <dc:creator><![CDATA[Chad Duffey]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chadduffey/2014/02/15/cheat-sheet-break-into-a-windows-machine-with-a-debugger/</guid>
      <description><![CDATA[Short version - there&nbsp;steps:
1.&nbsp; Enable debugging on the Windows guest machine.
2....]]></description>
      <content:encoded><![CDATA[<p><span style="text-decoration:underline;">Short version - there&nbsp;steps:</span></p>
<p>1.&nbsp; Enable debugging on the Windows guest machine.</p>
<p>2. Change the VM settings to support debugging via named pipe.</p>
<p>3. Configure your debugger and break in.</p>
<p><span style="text-decoration:underline;">Longer Version:</span></p>
<p><span style="color:#339966;">1. Enable debugging on the Windows guest machine<span style="text-decoration:underline;">.</span></span></p>
<p>This assumes you have a Windows virtual machine already built and running. You also need administrative privileges and a reboot will be required.</p>
<p>Open an administrative command prompt and type:</p>
<p><strong>bcdedit /set debug on</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/bcdedit.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/bcdedit.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/bcdedit.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/bcdedit.PNG" border="0" /></a></p>
<p>If you want to check - type <strong>bcdedit</strong> on its own and you should see debug - Yes.</p>
<p>Reboot the machine.</p>
<p><span style="color:#339966;">2. Change the VM settings to support debugging via named pipe.</span></p>
<p>Open the HYPER-V Console and find the machine you wish to debug. (Similar process for other VM platforms).</p>
<p>Open the virtual machine settings and find the COM settings.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/comsettings.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/comsettings.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/comsettings.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/comsettings.PNG" border="0" /></a></p>
<p>Choose the option for a &quot;named pipe&quot;.</p>
<p>It doesn&#39;t matter too much what you call the pipe, once you type something it will tell give you a path to the pipe which you can use in your debugger. This will be important for step 3.</p>
<p>In my example: <strong>\\.\pipe\dbg</strong></p>
<p>3. <span style="color:#339966;">Configure your debugger and break in</span>.</p>
<p>You need to install a debugger. I find <strong>windbg</strong> useful for what i do, but the choice is yours. It has a next &gt; next &gt; next style install so i wont waste your time here. Once it is installed we are ready to roll.</p>
<p>Open the debugger <span style="text-decoration:underline;">elevated</span> so that you can get access to the guest machine running on the host.</p>
<p>Choose File &gt; Kernel Debug and locate the tab that says COM</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/dbg.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/dbg.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/dbg.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/dbg.PNG" border="0" /></a></p>
<p>This is where you type the path that the virtual machine COM settings gave you. In my example it was \\.\pipe\dbg</p>
<p>When you hit ok, the debug will attempt to attach to your virtual machine.</p>
<p>If you get an error - check that you used an elevated version of the windbg process and check the Port (pipe) path. Also make sure you ticked &quot;pipe&quot; in the debugger like the image above.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/windbg.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/windbg.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/windbg.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/windbg.PNG" border="0" /></a></p>
<p>At this point, the machine is ready for you to break in. If you hit the icon with the blue squiggly lines (shown above) you take control of the machine and can start to mess around with the debugger. Remember, the machine will appear &quot;frozen&quot; while you are broken in because you are controlling the machine and stepping through instructions. If you want to let it proceed, just type &#39;g&#39; for Go in the debugger.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/output.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/output.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/output.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/output.PNG" border="0" /></a></p>
<p>If you want to break in again, just hit the break icon as before (or&nbsp;type ctrl-break)</p>
<p>Thanks,</p>
<p>Chad</p>
<p></p>
<p></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Connected Standby &amp; You</title>
      <link>https://docs.microsoft.com/archive/blogs/chadduffey/connected-standby-you</link>
      <pubDate>Sat, 15 Feb 2014 16:51:00 GMT</pubDate>
      <dc:creator><![CDATA[Chad Duffey]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chadduffey/2014/02/15/connected-standby-you/</guid>
      <description><![CDATA[Connected Standby is an improved standby mode available on some Windows 8 (&amp; 8.1)...]]></description>
      <content:encoded><![CDATA[<p>Connected Standby is an improved standby mode available on some Windows 8 (&amp; 8.1) devices.</p>
<p>Connected Standby&nbsp;devices can generally out-perform most&nbsp;non-connected standby devices in terms of power consumption while actually getting&nbsp;a small amount of critical&nbsp;work done while the screen is off.</p>
<p>With Connected standby&nbsp;Windows devices&nbsp;get a lot of the benefit&nbsp;you expect from a mobile phone.</p>
<p>Things like&nbsp;<span style="text-decoration:underline;">inbound</span> Skype calls even&nbsp;while&nbsp;the device is in your backpack&nbsp;(fantastic when you are travelling overseas&nbsp;because roaming on your mobile phone is&nbsp;very expensive).</p>
<p>Also,&nbsp;your content&nbsp;stays up to date while the device is off (email, live tiles etc.)&nbsp;&amp; the device resumes from screen-off exceptionally quickly.</p>
<p>The bit i have really come to depend on though, is that while i wander around campus from meeting to meeting, building to building,&nbsp;the device is joining the appropriate wireless networks as i go.</p>
<p>As soon as&nbsp;i open the device in my next meeting the device is ready to&nbsp;go.&nbsp;There is no waiting to get on a network, watching the little connection status icon spin for what seems like eternity (to be fair it is 20 or 30 seconds, but zero is much better).</p>
<p>With Connected Standby as soon as i open the device, it is ready to go and my content is fresh.</p>
<p>I&nbsp;really like this feature&nbsp;and i miss it when i pick up a non-connected standby device for the day.</p>
<p>If you have time, this video explains it much better in 2 minutes or less:</p>
<p>[View:~/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/What-is-Connected-Standby.mp4:0:0]</p>
<p>That&#39;s the cool parts of connected standby...</p>
<p>Up until 6 months ago i worked in a<a href="https://blogs.msdn.com/b/canberrapfe/"> field role </a>for Microsoft and i have been involved in a few conversations&nbsp; involving negative connected standby&nbsp;experiences.</p>
<p>At the time, i didn&#39;t really understand what was going on. In most cases I had the customer routed to the correct support people to work it through.&nbsp;But now,&nbsp;six months into my role in&nbsp;the Kernel team&nbsp;I wanted to share some of the information i have picked up along the way in hope that it will help you with any trouble maker devices.</p>
<p>The first&nbsp;thing i wanted to call out is: if you aren&#39;t getting good battery life on a connected standby device&nbsp;- something is wrong.&nbsp;</p>
<p>I can almost hear you saying &quot;well done Captain Obvious!&quot;. But what i mean by that is, Connected Standby devices are engineered from the group up to be very good on battery, especially during standby.</p>
<p>If you bought a Connected Standby device, the hardware is more than likely the better stuff.&nbsp;Components like Memory&nbsp;of the&nbsp;DDR3-RS, DDR3L&nbsp;even LP-DDR3 flavor rather than normal PC-DDR. (will cover DRAM in another post shortly, or you can <a href="https://www.bing.com/search?q=DDR3L+DDR3L-RS&amp;qs=n&amp;form=QBRE&amp;pq=ddr3l+ddr3l-rs&amp;sc=1-14&amp;sp=-1&amp;sk=&amp;cvid=8d26e9a426ad4b5ba3d6b061f2ded5e6">bing it</a>). The device will most likely have low power networking components (both Bluetooth and WiFi, maybe even Mobile Broadband) and&nbsp;low power storage.&nbsp;The system most likely&nbsp;be&nbsp;designed around a low power SoC (System on a Chip).</p>
<p>If your device supports CS, you have&nbsp;a very good quality device in terms of hardware components.</p>
<p>(Want to be sure if your device supports CS? Launch an elevated command prompt and run &quot;<strong>Powercfg /a</strong>&quot;. You are looking for output like that below)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/cs-device.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/cs_2D00_device.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/cs-device.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/cs_2D00_device.PNG" border="0" /></a></p>
<p>Actually, for a quick detour: why <em>wouldn&#39;t</em> a device support connected standby?</p>
<p>The short answer is, its very difficult. But i gave a hint with the premium hardware comments above.</p>
<p>The hardware needs to be capable of supporting the new very low power states. At worst, the controllers must be able to deal with devices attached to the system that don&#39;t do well with low power. On top of that, the system as a whole needs to be able to communicate advanced power states to Windows through a driver called a PEP. The firmware of the devices often has specific modifications for low power activity. Generally&nbsp;speaking the device manufacturer needs to be thinking about CS right from the first blueprint.</p>
<p>Actually, a much better way to&nbsp;see&nbsp;what you might expect from the&nbsp;hardware is to watch this short video.</p>
<p>(Our team published&nbsp;these on MSDN&nbsp;only this&nbsp;week. They are short and&nbsp;interesting I promise):</p>
<p>[View:~/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/DPM.mp4:550:0]</p>
<p>(The video is available with some follow up&nbsp;text&nbsp;is here: <a href="https://msdn.microsoft.com/library/windows/hardware/dn481230(v=vs.85).aspx">https://msdn.microsoft.com/library/windows/hardware/dn481230(v=vs.85).aspx</a> )</p>
<p>The main point: Connected Standby&nbsp;begins as a hardware feature.</p>
<p>Windows checks if the device manufacturer considers the device to be CS capable during system boot.</p>
<p>Windows&nbsp;reads the system firmware on the way up looking for an AOAC flag (AOAC == Always On Always Connected). If the firmware doesn&#39;t say&nbsp;AOAC, Windows doesn&#39;t implement the connected standby&nbsp;features. (Your device manufacturer&nbsp;supplies the firmware).</p>
<p>Windows&nbsp;also checks a few things itself. One of which, is that the device uses a solid state disk (SSD). It does this by checking&nbsp;whether the seek latency on the disk is greater than 0ms. Remember that seek latency is the time is takes the disk to find (not retrieve) the information you need. On a rotational disk this involves getting the disk platter to where it needs to be, and moving the head to the&nbsp;right spot. This takes time. On an SSD, there are no moving parts just an array of storage locations - we get&nbsp;0ms &#39;seek&#39; time.</p>
<p>Anyway, we are off track... What can you do if you are seeing battery drain that is out of the ordinary?</p>
<p>The good news is that there was a big chunk of work done&nbsp;during Windows 8.1 development that will definitely help out.&nbsp;</p>
<p>The feature is called Sleep Study, and it is&nbsp;fairly easy to&nbsp;use and understand in most cases.</p>
<p>At its most simple, you just type: &quot;<strong>Powercfg /sleepstudy</strong>&quot; from a command prompt on your device.&nbsp;This will get you a HTML report which details where all your battery went and why.</p>
<p>The basics:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/sleepstudy.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/sleepstudy.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/sleepstudy.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/sleepstudy.PNG" border="0" /></a></p>
<p>Up the top we get a graph showing all the charges and drains. Then we get a breakdown of every CS session over the last three days.</p>
<p>Each individual connected standby&nbsp;session&nbsp;has a hyperlink that leads&nbsp;to a more detailed section&nbsp;further down&nbsp;the document.</p>
<p>As an example,&nbsp;if i take Session&nbsp;8 which shows me I lost 1% of my battery in 43 minutes and achieved a low power state&nbsp;only 89% of screen off time&nbsp;i could click for more detail:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/cs-detail.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/cs_2D00_detail.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/70/cs-detail.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-70/cs_2D00_detail.PNG" border="0" /></a></p>
<p>In&nbsp;the example, I can drill in to see what things are going on in the background (BI&nbsp;== Background Infrastructure) and in the case i can see that there is some Skype, and some Windows Mail.</p>
<p>If i&nbsp;think about that, it makes sense that the network controller wouldn&#39;t go to sleep completely for about 8% of the time if i am doing a lot of mail and Skype.&nbsp;</p>
<p>I will do a full post on sleepstudy with some solid examples shortly but I hope&nbsp;knowing about it gets some issues solved/understood in the meantime.</p>
<p>Depending on what the sleepstudy tells you there are some actionable things&nbsp;you can&nbsp;do:</p>
<p>- For some things, there will be a valid explanation. Maybe you are syncing a lot of mail or roaming between a lot of networks. Even then, the drain shouldn&#39;t be ridiculous though. There are heavy constraints on what the system is allowed to do and when (see the &quot;Introduction to Connected Standby whitepaper). If the system appears to be just running flat out, something is wrong.</p>
<p>- Update your drivers. Bad drivers will never do on a Connected Standby system. Keep in mind that&nbsp;a connected standby system relies on drivers and firmware&nbsp;to tell Windows when to be in the lowest power state. To give a really tangible example, consider you network card firmware. On a Connected Standby system the firmware contains a list of the types of packets that should be allowed to wake the CPU with an interrupt and ultimately the rest of the system (think of a Skype call: push notification packet). If the firmware&nbsp;is bad, the system wont do well in Connected Standby because it may be woken up for all kinds of non-important traffic that is floating around wireless networks. &nbsp;</p>
<p>- Make sure no drivers are missing. None. If you type &quot;devmgmt.msc&quot; at the start screen and find any yellow exclamation marks&nbsp;next to a device you have probably found the reason your battery is not doing well. The&nbsp;hardware components are tightly integrated&nbsp;on a Connected Standby system. One bad component may ruin the experience for an otherwise amazing device.</p>
<p>- Remove trouble maker applications from the lock screen. The applications configured as &#39;lock screen applications&#39; on your system are allowed much more CPU and Network time during a CS session than others. As a test, remove any trouble makers you find&nbsp;using your sleepstudy report as a guide and see if Connected Standby gets better.</p>
<p>- Test with Airplane mode on. Just a test, not a long term solution.&nbsp;Airplane mode turns off the radio devices on the system. No radio devices, no inbound packets. Its a test that leaves the network interfaces in their lowest power mode. No roaming between networks, no push notifications. Its only a test though, if you find drastically improves the issue&nbsp;there is something unexpected going on that needs to be addressed.</p>
<p>- Test with &quot;Quiet Hours&quot;. Background tasks and most notifications are suppressed during quiet hours. Default on Windows is 12 - 6am. See if extending this gives relief. Again, only for testing, not a long term solution.</p>
<p>Over the next few weeks i will cover off some more things like a detailed look at sleepstudy, some information about the guts of connected standby and try to keep a reference to any fixes i come across with either Microsoft updates or System Builder drivers and firmware if they are released.</p>
<p>For now, there is much more Information available:</p>
<p>Introduction to Connected Standby (Actually quite deep, originally for system builders):<br /> <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/dn481224(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/hardware/dn481224(v=vs.85).aspx</a></p>
<p>Connected Standby User Experiences: <br /><a href="https://msdn.microsoft.com/library/windows/hardware/dn481217(v=vs.85).aspx">https://msdn.microsoft.com/library/windows/hardware/dn481217(v=vs.85).aspx</a></p>
<p>Applications and their impact on Connected Standby: <br /><a href="https://msdn.microsoft.com/en-us/library/windows/hardware/dn481223(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/hardware/dn481223(v=vs.85).aspx</a></p>
<p>Thanks,</p>
<p>Chad</p>]]></content:encoded>
    </item>
  </channel>
</rss>