Isn't WODM_RESET should stop playback/recording immediately? In which case shouldn't we use snd_pcm_drop instead?
I'm guessing here. I have that loop disabled here for some time now. And I can't hear any artifacts.
PS: If we drop that loop we should remove all associated stuff as well.
Vitaliy Margolen
Monday, July 25, 2005, 9:27:42, Robert Shearman wrote:
Changelog: wait_for_poll can go into an infinite loop. Remove it and replace it with snd_pcm_drain which is more likely to do what the original author intended.
Vitaliy Margolen wrote:
Isn't WODM_RESET should stop playback/recording immediately? In which case shouldn't we use snd_pcm_drop instead?
From MSDN: The *waveOutReset* function stops playback on the given waveform-audio output device and resets the current position to zero. All pending playback buffers are marked as done and returned to the application. From ALSA docs: snd_pcm_drop: Stop a PCM dropping pending frames. This function stops the PCM /immediately/. The pending samples on the buffer are ignored. snd_pcm_drain: Stop a PCM preserving pending frames. For capture stop PCM permitting to retrieve residual frames.
To me it sounds like waveOutReset should call snd_pcm_drain, rather than snd_pcm_drop.
I'm guessing here. I have that loop disabled here for some time now. And I can't hear any artifacts.
PS: If we drop that loop we should remove all associated stuff as well.
Ok, I'll do that and resend the patch once we agree which ALSA function to use.
Monday, July 25, 2005, 10:08:40 AM, Robert Shearman wrote:
Vitaliy Margolen wrote:
Isn't WODM_RESET should stop playback/recording immediately? In which case shouldn't we use snd_pcm_drop instead?
From MSDN: The *waveOutReset* function stops playback on the given waveform-audio output device and resets the current position to zero. All pending playback buffers are marked as done and returned to the application.
Well that's the part that's not really clear to me. It doesn't say "what playback/recording does with those buffers". I could imagine a program (that's say winamp) playing a song. Not sure how big of a buffers it's using, but that's say big enough to minimize cpu usage. You hit a stop button.
From ALSA docs: snd_pcm_drop: Stop a PCM dropping pending frames. This function stops the PCM /immediately/. The pending samples on the buffer are ignored. snd_pcm_drain: Stop a PCM preserving pending frames. For capture stop PCM permitting to retrieve residual frames.
To me it sounds like waveOutReset should call snd_pcm_drain, rather than snd_pcm_drop.
I tried that with snd_pcm_drain and it has a small delay before it stops. I would say that's try it and see what happens. It's still better then hanging wine. And if people will start having some problems with it (sound artifacts in games?) we can drop that all together (there is call to snd_pcm_drop few lines bellow).
Vitaliy