Ignore:
Timestamp:
Apr 21, 2008, 11:54:49 AM (17 years ago)
Author:
Paul Smedley
Message:

IRQ patch from Pavel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-2.0/lib32/sound.c

    r344 r352  
    778778    BOOL                fTryAgain = FALSE;
    779779    ULONG ulMinRate, ulMaxRate;
    780     struct snd_pcm_info      *pcminfo = NULL;
    781780
    782781#ifdef DEBUG
     
    803802        return OSSERR_INVALID_PARAMETER;
    804803    }
    805 
    806     // Get pcminfo so that we have the device & mixer name so we can do chipset specific hacks
    807     pcminfo = (struct snd_pcm_info *)kmalloc(sizeof(struct snd_pcm_info)+sizeof(struct snd_pcm_hw_params), GFP_KERNEL);
    808     //set operation to non-blocking
    809     pHandle->file.f_flags = O_NONBLOCK;
    810    
    811     ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_INFO, (ULONG)pcminfo);
    812 
    813804tryagain:
    814805    //set operation to non-blocking
     
    930921    minperiodbytes = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_PERIOD_BYTES)->min;
    931922    maxperiodbytes = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_PERIOD_BYTES)->max;
     923
    932924    if(periodbytes < minperiodbytes) {
    933925        periodbytes = minperiodbytes;
     
    955947    //make sure period size is a whole fraction of the buffer size
    956948    bufsize = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->max;
     949
     950#if 0
    957951    if(periodsize) {
    958952        nrperiods = bufsize/periodbytes;
     
    964958        return OSSERR_INVALID_PARAMETER;
    965959    }
     960#else
     961    nrperiods = 3;
     962#endif
    966963    //check nr of periods against lower and upper boundaries
    967964    minnrperiods = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_PERIODS)->min;
     
    10121009
    10131010//#ifdef DEBUG_PK
    1014     printk("Hardware parameters: sample rate %i, data type %i, channels %i, period size %i, nrperiods %i\n",
    1015              pHwParams->ulSampleRate, pHwParams->ulDataType, pHwParams->ulNumChannels, periodsize, nrperiods);
     1011    printk("Hardware parameters: sample rate %i, data type %i, channels %i, period bytes %i, period size %i, nrperiods %i\n",
     1012             pHwParams->ulSampleRate, pHwParams->ulDataType, pHwParams->ulNumChannels, periodbytes, periodsize, nrperiods);
    10161013//#endif
    10171014    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_HW_PARAMS, (ULONG)__Stack32ToFlat(&params));
Note: See TracChangeset for help on using the changeset viewer.