Changeset 267


Ignore:
Timestamp:
Nov 8, 2007, 4:47:51 AM (18 years ago)
Author:
Brendan Oakley
Message:

Fix HDA buffering in Uniaud32, from Pavel

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/pci/hda/hda_intel.c

    r130 r267  
    256256
    257257struct azx_dev {
    258         u32 *bdl;                       /* virtual address of the BDL */
     258#ifdef TARGET_OS2
     259        volatile u32 *bdl;                      /* virtual address of the BDL */
    259260        dma_addr_t bdl_addr;            /* physical address of the BDL */
    260         u32 *posbuf;                    /* position buffer pointer */
     261        volatile u32 *posbuf;                   /* position buffer pointer */
     262#else /* !TARGET_OS2 */
     263        u32 *bdl;               /* virtual address of the BDL */
     264        dma_addr_t bdl_addr;    /* physical address of the BDL */
     265        u32 *posbuf;            /* position buffer pointer */
     266#endif /* !TARGET_OS2 */
    261267
    262268        unsigned int bufsize;           /* size of the play buffer in bytes */
     
    265271        unsigned int fifo_size;         /* FIFO size */
    266272
    267         void __iomem *sd_addr;          /* stream descriptor pointer */
     273#ifdef TARGET_OS2
     274        volatile void __iomem *sd_addr;         /* stream descriptor pointer */
     275#else /* !TARGET_OS2 */
     276        void __iomem *sd_addr;  /* stream descriptor pointer */
     277#endif /* !TARGET_OS2 */
    268278
    269279        u32 sd_int_sta_mask;            /* stream int status mask */
     
    283293/* CORB/RIRB */
    284294struct azx_rb {
     295#ifdef TARGET_OS2
     296        volatile u32 *buf;              /* CORB/RIRB buffer
     297#else /* !TARGET_OS2 */
    285298        u32 *buf;               /* CORB/RIRB buffer
     299#endif /* !TARGET_OS2 */
    286300                                 * Each CORB entry is 4byte, RIRB is 8byte
    287301                                 */
     
    307321        /* pci resources */
    308322        unsigned long addr;
     323#ifdef TARGET_OS2
     324        volatile void __iomem *remap_addr;
     325#else /* !TARGET_OS2 */
    309326        void __iomem *remap_addr;
     327#endif /* !TARGET_OS2 */
    310328        int irq;
    311329
     
    880898static void azx_setup_periods(struct azx_dev *azx_dev)
    881899{
     900#ifdef TARGET_OS2
     901        volatile u32 *bdl = azx_dev->bdl;
     902#else /* !TARGET_OS2 */
    882903        u32 *bdl = azx_dev->bdl;
     904#endif /* !TARGET_OS2 */
    883905        dma_addr_t dma_addr = azx_dev->substream->runtime->dma_addr;
    884906        int idx;
     
    11961218            cmd == SNDRV_PCM_TRIGGER_SUSPEND ||
    11971219            cmd == SNDRV_PCM_TRIGGER_STOP) {
     1220#ifndef TARGET_OS2
    11981221                int timeout = 5000;
     1222#else /* TARGET_OS2 */
     1223                int timeout = 100000;
     1224#endif /* TARGET_OS2 */
    11991225                while (azx_sd_readb(azx_dev, SD_CTL) & SD_CTL_DMA_START && --timeout)
    12001226                        ;
     
    14821508                pci_disable_msi(chip->pci);
    14831509        if (chip->remap_addr)
     1510#ifdef TARGET_OS2
     1511                iounmap((void *)chip->remap_addr);
     1512#else /* !TARGET_OS2 */
    14841513                iounmap(chip->remap_addr);
     1514#endif /* !TARGET_OS2 */
    14851515
    14861516        if (chip->bdl.area)
  • GPL/trunk/lib32/sound.c

    r130 r267  
    10721072    int                 ret, align, size1, ret1;
    10731073    LONG                transferred;
    1074     ULONG               position;
     1074    ULONG               position,i;
    10751075    char                *buf;
    10761076    int toret = 0;
     
    11401140        while(TRUE) {
    11411141        again:
     1142            for ( i=0; i < 10000; i++)
     1143            {
     1144            ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_STATUS, (ULONG)__Stack32ToFlat(&status));
     1145            if ( status.state != SNDRV_PCM_STATE_XRUN ) break;
     1146            }
     1147            if ( i > 9998 )
     1148            {
     1149                printk("timeout stat %x avail:%i:%i \n",status.state,samples_to_bytes(status.avail),status.avail);
     1150                ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_PREPARE, 0);
     1151                ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_STATUS, (ULONG)__Stack32ToFlat(&status));
     1152            }
    11421153            ret = pHandle->file.f_op->write(&pHandle->file, (char *)buffer, size, &pHandle->file.f_pos);
    11431154            if(ret < 0) {
     
    11531164                    printk("OSS32_WaveAddBuffer failed on partial transfer %x %i; ret = %i\n", buffer, size, ret);
    11541165                    *pTransferred = transferred;
    1155                     if (toret)
     1166                    if (toret > 4)
    11561167                        return OSSERR_SUCCESS; /* avoid infinite loop */
    1157                     toret = 1;
     1168                    toret++;
    11581169                    goto again;
    11591170                }
Note: See TracChangeset for help on using the changeset viewer.