Changeset 484


Ignore:
Timestamp:
May 8, 2010, 6:36:24 AM (15 years ago)
Author:
David Azarewicz
Message:

Fix for recording hang

Location:
GPL/trunk
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/core/sgbuf.c

    r479 r484  
    1919 *
    2020 */
    21 
    2221#ifdef TARGET_OS2
    2322#include <sound/core.h>
    2423#endif
     24#include <sound/config.h>
    2525#include <linux/slab.h>
    2626#include <linux/mm.h>
     
    2828#include <sound/memalloc.h>
    2929#include <proto.h>
     30
     31#ifdef CONFIG_SND_DMA_SGBUF
    3032
    3133/* table entries are align to 32 */
     
    206208        return NULL;
    207209}
     210#endif
  • GPL/trunk/drv32/dispatch.c

    r479 r484  
    9595    ULONG ctl_id;
    9696
    97 #ifdef DEBUG
    98     printk("StratIOCtl %d\n", rp->Function);
    99 #endif
    10097    if (rp->Category != CAT_IOCTL_OSS32)
    10198    {
     
    105102    }
    106103
     104#ifdef DEBUG
     105    printk("StratIOCtl 0x%x\n", rp->Function);
     106#endif
    107107//    printk("cmd: %x, len: %i, pack: %x\n",rp->Function, rp->ParmLength, rp->ParmPacket);
    108108    // work with Parm Packet
     
    394394            ctl_id = id & 0x0000FFFF;
    395395
    396             //                printk("put ID %i\n",id);
    397396            GetUniaudControlValuePut(card_id, ctl_id,(void*)*pData);
    398397        } break;
  • GPL/trunk/drv32/parse.c

    r479 r484  
    3838#include "parse.h"         // NUM_DEVICES
    3939#include <string.h>
     40
     41#ifdef DEBUG
     42#define COMM_DEBUG
     43#endif
    4044
    4145// True if the /V parameter was specified
  • GPL/trunk/lib32/debug.c

    r479 r484  
    3434#define SIGNIFICANT_FIELD       0x0007
    3535
    36 //#define COMM_DEBUG
    37 
    3836BOOL  fLineTerminate=TRUE;
    3937int   DebugLevel = 1;
     
    147145
    148146#ifdef DEBUG
     147#define COMM_DEBUG
    149148//------------------------- StringOut --------------------------//
    150149
  • GPL/trunk/lib32/sound.c

    r479 r484  
    10141014            minperiodsize = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min;
    10151015            maxperiodsize = hw_param_interval((&params), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->max;
     1016                dprintf(("Period size min=%lx max=%lx", minperiodsize, maxperiodsize));
    10161017            if(minperiodsize > maxperiodsize) {
    10171018                //ALSA doesn't like the period size; try suggested one
     
    10231024            }
    10241025        }
    1025         dprintf(("Error second time.. Bailing"));
     1026        dprintf(("Error %ld second time.. Bailing", ret));
    10261027        return UNIXToOSSError(ret);
    10271028    }
     
    10911092    pHandle->file.f_flags = O_NONBLOCK;
    10921093
    1093     //first check how much room is left in the circular dma buffer
    1094     //this is done to make sure we don't block inside ALSA while trying to write
    1095     //more data than fits in the internal dma buffer.
    1096     ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_STATUS, (ULONG)__Stack32ToFlat(&status));
    1097 
    1098     if(ret) {
    1099         DebugInt3();
    1100         return UNIXToOSSError(ret);
    1101     }
    1102 
    1103     size1 = size;
    1104 
    1105     size = min(size, samples_to_bytes(status.avail));
    1106 
    1107 #ifdef DEBUG_PK
    1108     if (size1 != size)
    1109         printk("requested size [%d] less then available [%d]\n", size1, size);
    1110 #endif
    1111 
    1112     CountWv++;
    1113 
    1114 #ifdef DEBUG
    1115     printk("OSS32_WaveAddBuffer N:%d hw %x app %x avail %x, orig size: %x, size %x\n",CountWv, samples_to_bytes(status.hw_ptr), samples_to_bytes(status.appl_ptr), samples_to_bytes(status.avail), size1, size);
    1116 #endif
    1117 
    1118     if (size == 0)
    1119     {
    1120 #ifdef DEBUG_PK
    1121         printk("OSS32_WaveAddBuffer: no room left in hardware buffer!!\n");
    1122         printk("state = %i\n",status.state);
    1123         printk("avail = %i\n",status.avail);
    1124         printk("size req = %i\n",size1);
    1125 #endif
    1126         *pTransferred = 0;
    1127         return OSSERR_BUFFER_FULL;
    1128     }
    1129 
     1094        /* get the status of the circular dma buffer */
     1095        ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_STATUS, (ULONG)__Stack32ToFlat(&status));
     1096
     1097        if(ret) {
     1098                DebugInt3();
     1099                return UNIXToOSSError(ret);
     1100        }
     1101
     1102        CountWv++;
    11301103    transferred = 0;
    11311104    *pTransferred = 0;
     
    11341107    {
    11351108    case SNDRV_MINOR_PCM_PLAYBACK:
    1136         // size should be aligned to channels number * samplesize  //PS+++ what is it and why?!?!?!
    1137         j = 10;            // 10 try if error
    1138         while (size && j && ret)
    1139         {
    1140                for (i=0; i < 1000; i++)
    1141                {
    1142                      ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_STATUS, (ULONG)__Stack32ToFlat(&status));
    1143                      // If here any state and have free buffer to any byte
    1144                      if ((status.state != SNDRV_PCM_STATE_XRUN ) && samples_to_bytes(status.avail) )
    1145                          break;
    1146                      if (i > 998)
    1147                      {
    1148 //                         printk("timeout stat %x avail:%d hw:%d app:%d\n",status.state,samples_to_bytes(status.avail),samples_to_bytes(status.hw_ptr), samples_to_bytes(status.appl_ptr));
    1149                          ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_PREPARE, 0);
    1150                      }
    1151                }
    1152 
    1153                if (ret1 < 0)
    1154                {
    1155 //                   printk("Status Error ret1:%i trans: %i need %d tot:%d\n",ret1,transferred, size,size1);
    1156                    break;     // We have any global error, don't try more
    1157                }
    1158 
    1159                ret = pHandle->file.f_op->write(&pHandle->file, (char *)buffer, size, &pHandle->file.f_pos);
    1160 
    1161                if (ret < 0 )
    1162                {  // We have any error, don't try more
    1163                   j--;
    1164                   if ( ret != -11 )
    1165                       ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_PREPARE, 0);
    1166 //                  printk("Error ret:%i ret1:%i trans: %d need %d tot:%d\n",ret,ret1,transferred, size,size1);
    1167                   continue;
    1168                }
    1169                if (ret == 0)  continue;
    1170                transferred += ret;
    1171 //               printk("written: now: %d, trans: %d need %d tot:%d\n", ret, transferred, size,size1);
    1172                buffer += ret;
    1173                if (size > ret)
    1174                   size   -= ret;
    1175                else
    1176                   size = 0;
    1177         }
     1109
     1110                //first check how much room is left in the circular dma buffer
     1111                //this is done to make sure we don't block inside ALSA while trying to write
     1112                //more data than fits in the internal dma buffer.
     1113            size1 = size;
     1114            size = min(size, samples_to_bytes(status.avail));
     1115
     1116#ifdef DEBUG
     1117                //printk("OSS32_WaveAddBuffer N:%d hw=%x app=%x avail=%x req size=%x size=%x\n",
     1118                //      CountWv, samples_to_bytes(status.hw_ptr), samples_to_bytes(status.appl_ptr), samples_to_bytes(status.avail), size1, size);
     1119#endif
     1120
     1121            if (size == 0) {
     1122#ifdef DEBUG_PK
     1123                printk("OSS32_WaveAddBuffer: no room left in hardware buffer!!\n");
     1124            printk("state = %i\n",status.state);
     1125                printk("avail = %i\n",status.avail);
     1126                printk("size req = %i\n",size1);
     1127#endif
     1128                *pTransferred = 0;
     1129            return OSSERR_BUFFER_FULL;
     1130            }
     1131
     1132                // size should be aligned to channels number * samplesize  //PS+++ what is it and why?!?!?!
     1133                j = 10;            // 10 try if error
     1134                while (size && j && ret)
     1135                {
     1136                        for (i=0; i < 1000; i++)
     1137                        {
     1138                                ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_STATUS, (ULONG)__Stack32ToFlat(&status));
     1139                                // If here any state and have free buffer to any byte
     1140                                if ((status.state != SNDRV_PCM_STATE_XRUN ) && samples_to_bytes(status.avail) ) break;
     1141                                if (i > 998) {
     1142                                        // printk("timeout stat %x avail:%d hw:%d app:%d\n",status.state,samples_to_bytes(status.avail),samples_to_bytes(status.hw_ptr), samples_to_bytes(status.appl_ptr));
     1143                                        ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_PREPARE, 0);
     1144                                }
     1145                        }
     1146
     1147                        if (ret1 < 0) {
     1148                                // printk("Status Error ret1:%i trans: %i need %d tot:%d\n",ret1,transferred, size,size1);
     1149                                break;     // We have any global error, don't try more
     1150                        }
     1151
     1152                        ret = pHandle->file.f_op->write(&pHandle->file, (char *)buffer, size, &pHandle->file.f_pos);
     1153
     1154                        if (ret < 0 ) {  // We have any error, don't try more
     1155                                j--;
     1156                                if ( ret != -11 )
     1157                                ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_PREPARE, 0);
     1158                                // printk("Error ret:%i ret1:%i trans: %d need %d tot:%d\n",ret,ret1,transferred, size,size1);
     1159                                continue;
     1160                        }
     1161                        if (ret == 0)  continue;
     1162                        transferred += ret;
     1163                        // printk("written: now: %d, trans: %d need %d tot:%d\n", ret, transferred, size,size1);
     1164                        buffer += ret;
     1165                        if (size > ret)
     1166                                size   -= ret;
     1167                        else
     1168                                size = 0;
     1169                }
    11781170        break;
    11791171    case SNDRV_MINOR_PCM_CAPTURE:
     1172#ifdef DEBUG
     1173                //printk("OSS32_WaveAddBuffer N:%d state=%x hw=%x app=%x avail=%x size=%x\n",
     1174                //      CountWv, status.state, samples_to_bytes(status.hw_ptr), samples_to_bytes(status.appl_ptr), samples_to_bytes(status.avail), size);
     1175#endif
     1176//              Need to handle overrun condition when reading
     1177//              if (status.state == SNDRV_PCM_STATE_XRUN) {
     1178//                  *pTransferred = 0;
     1179//                      return OSSERR_BUFFER_FULL;
     1180//              }
    11801181        transferred = pHandle->file.f_op->read(&pHandle->file, (char *)buffer, size, &pHandle->file.f_pos);
    1181 //        printk("readed %i bytes\n", transferred);
     1182                if (transferred < 0) {
     1183                    *pTransferred = 0;
     1184                        return OSSERR_BUFFER_FULL;
     1185                }
    11821186        break;
    11831187    default:
     
    11891193    *pTransferred = transferred;
    11901194    prev_size = transferred;
    1191     if (*pTransferred < size1)
    1192     {
    1193         printk("warning: transferred [%d] less than requested [%d]\n", *pTransferred, size1);
     1195//    if (*pTransferred < size1)
     1196//    {
     1197//        printk("warning: transferred [%d] less than requested [%d]\n", *pTransferred, size1);
    11941198//        ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_PREPARE, 0);
    1195     }
     1199//    }
    11961200
    11971201    return OSSERR_SUCCESS;
     
    12911295    }
    12921296
    1293     dprintf(("OSS32_WaveGetHwPtr: %lx", samples_to_bytes(status.appl_ptr)));
    12941297    *pPosition = samples_to_bytes(status.appl_ptr);  //return new hardware position
    12951298    return OSSERR_SUCCESS;
  • GPL/trunk/lib32/soundmixer.c

    r479 r484  
    376376    int                   ret, idx, lVol, rVol = 0, idxMute, cnt;
    377377
    378     dprintf(("OSS32_MixSetVolume line=%d\n", line));
     378    //dprintf(("OSS32_MixSetVolume line=%d\n", line));
    379379    if(pHandle == NULL || pHandle->magic != MAGIC_MIXER_ALSA32) {
    380380        printk("Invalid handle in OSS32_MixSetVolume\n");
     
    512512    }
    513513
    514     printk("OSS32_MixSetVolume of %s streamid %X to (%d,%d)(%d,%d) caps %d\n",
    515            pHandle->pids[idx].name,
    516            (ULONG)pHandle, GET_VOLUME_L(volume),
    517            GET_VOLUME_R(volume), lVol, rVol, pElemInfo->value.integer.max);
     514        printk("OSS32_MixSetVolume of %s streamid %X to (%d,%d)(%d,%d) caps %d\n",
     515                pHandle->pids[idx].name, (ULONG)pHandle,
     516                GET_VOLUME_L(volume), GET_VOLUME_R(volume), lVol, rVol, pElemInfo->value.integer.max);
    518517
    519518    // looking for more, then one opened streams to prevent of muting active stream
  • GPL/trunk/uniaud.inc

    r479 r484  
    1313# ex RC3  GA  FIXPACK2 beta_47
    1414# Comment out to avoid a fixpack line in bldlevel
    15 FIXPACK = SVN r478
     15FIXPACK = SVN r484
    1616
    1717# ALSA BUILD VERSION
Note: See TracChangeset for help on using the changeset viewer.