Changeset 484
- Timestamp:
- May 8, 2010, 6:36:24 AM (15 years ago)
- Location:
- GPL/trunk
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/core/sgbuf.c
r479 r484 19 19 * 20 20 */ 21 22 21 #ifdef TARGET_OS2 23 22 #include <sound/core.h> 24 23 #endif 24 #include <sound/config.h> 25 25 #include <linux/slab.h> 26 26 #include <linux/mm.h> … … 28 28 #include <sound/memalloc.h> 29 29 #include <proto.h> 30 31 #ifdef CONFIG_SND_DMA_SGBUF 30 32 31 33 /* table entries are align to 32 */ … … 206 208 return NULL; 207 209 } 210 #endif -
GPL/trunk/drv32/dispatch.c
r479 r484 95 95 ULONG ctl_id; 96 96 97 #ifdef DEBUG98 printk("StratIOCtl %d\n", rp->Function);99 #endif100 97 if (rp->Category != CAT_IOCTL_OSS32) 101 98 { … … 105 102 } 106 103 104 #ifdef DEBUG 105 printk("StratIOCtl 0x%x\n", rp->Function); 106 #endif 107 107 // printk("cmd: %x, len: %i, pack: %x\n",rp->Function, rp->ParmLength, rp->ParmPacket); 108 108 // work with Parm Packet … … 394 394 ctl_id = id & 0x0000FFFF; 395 395 396 // printk("put ID %i\n",id);397 396 GetUniaudControlValuePut(card_id, ctl_id,(void*)*pData); 398 397 } break; -
GPL/trunk/drv32/parse.c
r479 r484 38 38 #include "parse.h" // NUM_DEVICES 39 39 #include <string.h> 40 41 #ifdef DEBUG 42 #define COMM_DEBUG 43 #endif 40 44 41 45 // True if the /V parameter was specified -
GPL/trunk/lib32/debug.c
r479 r484 34 34 #define SIGNIFICANT_FIELD 0x0007 35 35 36 //#define COMM_DEBUG37 38 36 BOOL fLineTerminate=TRUE; 39 37 int DebugLevel = 1; … … 147 145 148 146 #ifdef DEBUG 147 #define COMM_DEBUG 149 148 //------------------------- StringOut --------------------------// 150 149 -
GPL/trunk/lib32/sound.c
r479 r484 1014 1014 minperiodsize = hw_param_interval((¶ms), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min; 1015 1015 maxperiodsize = hw_param_interval((¶ms), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->max; 1016 dprintf(("Period size min=%lx max=%lx", minperiodsize, maxperiodsize)); 1016 1017 if(minperiodsize > maxperiodsize) { 1017 1018 //ALSA doesn't like the period size; try suggested one … … 1023 1024 } 1024 1025 } 1025 dprintf(("Error second time.. Bailing"));1026 dprintf(("Error %ld second time.. Bailing", ret)); 1026 1027 return UNIXToOSSError(ret); 1027 1028 } … … 1091 1092 pHandle->file.f_flags = O_NONBLOCK; 1092 1093 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++; 1130 1103 transferred = 0; 1131 1104 *pTransferred = 0; … … 1134 1107 { 1135 1108 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 } 1178 1170 break; 1179 1171 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 // } 1180 1181 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 } 1182 1186 break; 1183 1187 default: … … 1189 1193 *pTransferred = transferred; 1190 1194 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); 1194 1198 // ret1 = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_PREPARE, 0); 1195 }1199 // } 1196 1200 1197 1201 return OSSERR_SUCCESS; … … 1291 1295 } 1292 1296 1293 dprintf(("OSS32_WaveGetHwPtr: %lx", samples_to_bytes(status.appl_ptr)));1294 1297 *pPosition = samples_to_bytes(status.appl_ptr); //return new hardware position 1295 1298 return OSSERR_SUCCESS; -
GPL/trunk/lib32/soundmixer.c
r479 r484 376 376 int ret, idx, lVol, rVol = 0, idxMute, cnt; 377 377 378 dprintf(("OSS32_MixSetVolume line=%d\n", line));378 //dprintf(("OSS32_MixSetVolume line=%d\n", line)); 379 379 if(pHandle == NULL || pHandle->magic != MAGIC_MIXER_ALSA32) { 380 380 printk("Invalid handle in OSS32_MixSetVolume\n"); … … 512 512 } 513 513 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); 518 517 519 518 // looking for more, then one opened streams to prevent of muting active stream -
GPL/trunk/uniaud.inc
r479 r484 13 13 # ex RC3 GA FIXPACK2 beta_47 14 14 # Comment out to avoid a fixpack line in bldlevel 15 FIXPACK = SVN r4 7815 FIXPACK = SVN r484 16 16 17 17 # ALSA BUILD VERSION
Note:
See TracChangeset
for help on using the changeset viewer.