<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'General Recording/Playback Problem under Windows7' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'General Recording/Playback Problem under Windows7' posted on the 'C/C++ Windows API' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2010 Programmers Heaven</copyright>
    <pubDate>Mon, 15 Mar 2010 20:47:24 -0700</pubDate>
    <lastBuildDate>Mon, 15 Mar 2010 20:47:24 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>General Recording/Playback Problem under Windows7</title>
      <link>http://www.programmersheaven.com/mb/Win32API/409927/409927/general-recordingplayback-problem-under-windows7/</link>
      <description>I have a strange problem when doing recording and playback of audio at the same time under Windows7. &lt;br /&gt;
&lt;br /&gt;
The problem can be described as follows:&lt;br /&gt;
&lt;br /&gt;
The Win32 API knows a waveIn and a waveOut unit.&lt;br /&gt;
All functions that make some noise (e.g. PlaySound
)&lt;br /&gt;
come sooner or later down to use the waveOut unit,&lt;br /&gt;
while all functions that do recording use at the l
ower end&lt;br /&gt;
the waveIn unit.&lt;br /&gt;
&lt;br /&gt;
The problem I have is, that if the waveIn and the&lt;br /&gt;
waveOut unit run at the same time AND are operated&lt;br /&gt;
from different threads, the waveOut unit gets &lt;br /&gt;
occasionally blocked (e.g. hangs within the PlaySound() call) if at the same time the waveIn unit operates (means I am processing WIM_DATA Messages and do waveInUnprepare=&amp;gt;something=&amp;gt;waveInPrepare=&amp;gt;waveInA
ddBuffer). &lt;br /&gt;
This happens on ALL Windows7 machines and ALL soundcards, so it is NOT hardware or driver related. WindowsXP and Vista are working fine with the very same executable.&lt;br /&gt;
&lt;br /&gt;
Speculation:&lt;br /&gt;
This problem is new in Windows7. Looks like they r
emoved&lt;br /&gt;
some semaphore protection or something from winmm.dll.&lt;br /&gt;
However, it is too easy to point into Microsofts' 
direction.&lt;br /&gt;
I haven't found anything about this problem in the
 Internet,&lt;br /&gt;
where plenty of complains must arise if this is a 
bug in &lt;br /&gt;
Microsofts' winmm.dll code.&lt;br /&gt;
So i guess I must do something wrong on my end.&lt;br /&gt;
Do I need to put the code executed on WIM_DATA into a critical section and do the same for any PlaySound Call?&lt;br /&gt;
&lt;br /&gt;
Any help or hint is very appreciated!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Win32API/409927/409927/general-recordingplayback-problem-under-windows7/</guid>
      <pubDate>Fri, 27 Nov 2009 05:56:08 -0700</pubDate>
      <category>C/C++ Windows API</category>
    </item>
  </channel>
</rss>