mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm:mmap_emul: Fix sw_params and others in bypass mode
When the slave doesn't need any mmap-emulation, the plugin shouldn't do anything special in sw_params and other callbacks but just pass to the generic helpers and update hwptr and applptr. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									15c6f83296
								
							
						
					
					
						commit
						f562b032be
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -212,6 +212,9 @@ static int snd_pcm_mmap_emul_sw_params(snd_pcm_t *pcm,
 | 
				
			||||||
	mmap_emul_t *map = pcm->private_data;
 | 
						mmap_emul_t *map = pcm->private_data;
 | 
				
			||||||
	int err;
 | 
						int err;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!map->mmap_emul)
 | 
				
			||||||
 | 
							return snd_pcm_generic_sw_params(pcm, params);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	map->start_threshold = params->start_threshold;
 | 
						map->start_threshold = params->start_threshold;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* HACK: don't auto-start in the slave PCM */
 | 
						/* HACK: don't auto-start in the slave PCM */
 | 
				
			||||||
| 
						 | 
					@ -317,9 +320,9 @@ snd_pcm_mmap_emul_mmap_commit(snd_pcm_t *pcm, snd_pcm_uframes_t offset,
 | 
				
			||||||
	mmap_emul_t *map = pcm->private_data;
 | 
						mmap_emul_t *map = pcm->private_data;
 | 
				
			||||||
	snd_pcm_t *slave = map->gen.slave;
 | 
						snd_pcm_t *slave = map->gen.slave;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						snd_pcm_mmap_appl_forward(pcm, size);
 | 
				
			||||||
	if (!map->mmap_emul)
 | 
						if (!map->mmap_emul)
 | 
				
			||||||
		return snd_pcm_mmap_commit(slave, offset, size);
 | 
							return snd_pcm_mmap_commit(slave, offset, size);
 | 
				
			||||||
	snd_pcm_mmap_appl_forward(pcm, size);
 | 
					 | 
				
			||||||
	if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
 | 
						if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
 | 
				
			||||||
		sync_slave_write(pcm);
 | 
							sync_slave_write(pcm);
 | 
				
			||||||
	return size;
 | 
						return size;
 | 
				
			||||||
| 
						 | 
					@ -332,10 +335,7 @@ static snd_pcm_sframes_t snd_pcm_mmap_emul_avail_update(snd_pcm_t *pcm)
 | 
				
			||||||
	snd_pcm_sframes_t avail;
 | 
						snd_pcm_sframes_t avail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	avail = snd_pcm_avail_update(slave);
 | 
						avail = snd_pcm_avail_update(slave);
 | 
				
			||||||
	if (!map->mmap_emul)
 | 
						if (!map->mmap_emul || pcm->stream == SND_PCM_STREAM_PLAYBACK)
 | 
				
			||||||
		return avail;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
 | 
					 | 
				
			||||||
		map->hw_ptr = *slave->hw.ptr;
 | 
							map->hw_ptr = *slave->hw.ptr;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		sync_slave_read(pcm);
 | 
							sync_slave_read(pcm);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue