}
snd_pcm_hw_params_set_period_size_near(pcm, hw, frag_size, 0);
}
snd_pcm_hw_params_set_period_size_near(pcm, hw, frag_size, 0);
err = snd_pcm_hw_params(pcm, hw);
if (err < 0) {
Con_Printf("ALSA: unable to install hw params\n");
err = snd_pcm_hw_params(pcm, hw);
if (err < 0) {
Con_Printf("ALSA: unable to install hw params\n");
shm->samples=buffer_size*shm->channels; // mono samples in buffer
shm->speed=rate;
shm->buffer=(unsigned char*)mmap_areas->addr;
shm->samples=buffer_size*shm->channels; // mono samples in buffer
shm->speed=rate;
shm->buffer=(unsigned char*)mmap_areas->addr;
Con_Printf("%5d samples\n", shm->samples);
Con_Printf("%5d samplepos\n", shm->samplepos);
Con_Printf("%5d samplebits\n", shm->samplebits);
Con_Printf("%5d samples\n", shm->samples);
Con_Printf("%5d samplepos\n", shm->samplepos);
Con_Printf("%5d samplebits\n", shm->samplebits);
Con_Printf("%5d speed\n", shm->speed);
Con_Printf("0x%x dma buffer\n", (int)shm->buffer);
Con_Printf("%5d total_channels\n", total_channels);
Con_Printf("%5d speed\n", shm->speed);
Con_Printf("0x%x dma buffer\n", (int)shm->buffer);
Con_Printf("%5d total_channels\n", total_channels);