Changeset 339 for GPL/branches/uniaud32-2.0/lib32/sound.c
- Timestamp:
- Apr 5, 2008, 10:09:19 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-2.0/lib32/sound.c
r332 r339 809 809 pHandle->doublesamplesize = samplesize * 2; 810 810 pHandle->doublesamplesize *= pHwParams->ulNumChannels; 811 periodbytes = pHwParams->ulPeriodSize; 812 periodsize = bytes_to_samples(periodbytes); 811 // periodbytes = pHwParams->ulPeriodSize; 812 // periodsize = bytes_to_samples(periodbytes); 813 periodsize = pHwParams->ulPeriodSize; 814 periodbytes = samples_to_bytes(periodsize); 813 815 // checking number of channels 814 816 815 printk("channels: %i, period size: %i\n",pHwParams->ulNumChannels, periodbytes);817 printk("channels: %i, period bytes: %i\n",pHwParams->ulNumChannels, periodbytes); 816 818 _snd_pcm_hw_params_any(¶ms); 817 819 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_HW_REFINE, (ULONG)__Stack32ToFlat(¶ms)); … … 926 928 periodbytes = maxperiodbytes; 927 929 } 928 929 930 minperiodsize = hw_param_interval((¶ms), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min; 930 931 maxperiodsize = hw_param_interval((¶ms), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->max; … … 936 937 periodsize = maxperiodsize; 937 938 } 938 939 939 if(samples_to_bytes(periodsize) < periodbytes) { 940 940 periodbytes = samples_to_bytes(periodsize); … … 944 944 periodsize = bytes_to_samples(periodbytes); 945 945 } 946 947 946 //make sure period size is a whole fraction of the buffer size 948 947 bufsize = hw_param_interval((¶ms), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->max; … … 992 991 _snd_pcm_hw_param_set(¶ms, SNDRV_PCM_HW_PARAM_RATE, 993 992 pHwParams->ulSampleRate, 0); 994 #if 0995 993 _snd_pcm_hw_param_set(¶ms, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 996 994 periodsize, 0); … … 1003 1001 _snd_pcm_hw_param_set(¶ms, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1004 1002 periodbytes*nrperiods, 0); 1005 #endif 1003 1006 1004 //#ifdef DEBUG_PK 1007 1005 printk("Hardware parameters: sample rate %i, data type %i, channels %i, period size %i, periods %i\n", … … 1009 1007 //#endif 1010 1008 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_HW_PARAMS, (ULONG)__Stack32ToFlat(¶ms)); 1011 if (ret == -77 && fTryAgain == FALSE) 1009 printk("OSS32_WaveSetHwParams return %d after SNDRV_PCM_IOCTL_HW_PARAMS ioctl", ret); 1010 if (ret == -77 && fTryAgain == FALSE) 1012 1011 { 1013 1012 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_PREPARE, 0);
Note:
See TracChangeset
for help on using the changeset viewer.