Fix buffer allocation and mmap with plugins

Fixed the bug producing silent tones with some combinations of plugins.
The internal buffer handling is now better (cleaner) integrated with
snd_pcm_generic_*().
This commit is contained in:
Takashi Iwai 2005-09-02 16:36:40 +00:00
parent e62ecc876a
commit ffdb04c3ea
9 changed files with 48 additions and 78 deletions

View file

@ -658,6 +658,12 @@ int snd_pcm_softvol_open(snd_pcm_t **pcmp, const char *name,
pcm->private_data = svol;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
/*
* Since the softvol converts on the place, and the format/channels
* must be identical between source and destination, we don't need
* an extra buffer.
*/
pcm->mmap_shadow = 1;
snd_pcm_set_hw_ptr(pcm, &svol->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &svol->plug.appl_ptr, -1, 0);
*pcmp = pcm;