ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/PDL-Audio/sndlib/audio.c
(Generate patch)

Comparing PDL-Audio/sndlib/audio.c (file contents):
Revision 1.1 by root, Tue Dec 28 01:05:16 2004 UTC vs.
Revision 1.2 by root, Tue Dec 28 01:29:52 2004 UTC

1392 audio_type[i] = NORMAL_CARD; 1392 audio_type[i] = NORMAL_CARD;
1393 } 1393 }
1394 num_mixers = MAX_MIXERS; 1394 num_mixers = MAX_MIXERS;
1395 num_dsps = MAX_DSPS; 1395 num_dsps = MAX_DSPS;
1396#ifdef NEW_OSS 1396#ifdef NEW_OSS
1397 fd = open(DAC_NAME,O_WRONLY,0); 1397 fd = open(DAC_NAME,O_WRONLY|O_NONBLOCK,0);
1398 if (fd == -1) fd = open(SYNTH_NAME,O_RDONLY,0); 1398 if (fd == -1) fd = open(SYNTH_NAME,O_RDONLY|O_NONBLOCK,0);
1399 if (fd == -1) fd = open(MIXER_NAME,O_RDONLY,0); 1399 if (fd == -1) fd = open(MIXER_NAME,O_RDONLY|O_NONBLOCK,0);
1400 if (fd != -1) 1400 if (fd != -1)
1401 { 1401 {
1402 status = ioctl(fd,OSS_GETVERSION,&ignored); 1402 status = ioctl(fd,OSS_GETVERSION,&ignored);
1403 new_oss_running = (status == 0); 1403 new_oss_running = (status == 0);
1404 if (new_oss_running) 1404 if (new_oss_running)
1441 * find volume field, if none, go on, else read current volume 1441 * find volume field, if none, go on, else read current volume
1442 * open next unchecked dsp, try to set volume, read current, if different we found a match -- set and go on. 1442 * open next unchecked dsp, try to set volume, read current, if different we found a match -- set and go on.
1443 * if no change, move to next dsp and try again, if no more dsps, quit (checking for null case as before) 1443 * if no change, move to next dsp and try again, if no more dsps, quit (checking for null case as before)
1444 */ 1444 */
1445 sprintf(dname,"%s%d",MIXER_NAME,nmix); 1445 sprintf(dname,"%s%d",MIXER_NAME,nmix);
1446 md = open(dname,O_RDWR,0); 1446 md = open(dname,O_RDWR|O_NONBLOCK,0);
1447 if (md == -1) 1447 if (md == -1)
1448 { 1448 {
1449 if (errno == EBUSY) 1449 if (errno == EBUSY)
1450 { 1450 {
1451 fprintf(stderr,"%s is busy: can't access it",dname); 1451 fprintf(stderr,"%s is busy: can't access it",dname);
1453 continue; 1453 continue;
1454 } 1454 }
1455 else break; 1455 else break;
1456 } 1456 }
1457 sprintf(dname,"%s%d",DAC_NAME,ndsp); 1457 sprintf(dname,"%s%d",DAC_NAME,ndsp);
1458 fd = open(dname,O_RDWR,0); 1458 fd = open(dname,O_RDWR|O_NONBLOCK,0);
1459 if (fd == -1) fd = open(dname,O_RDONLY,0); 1459 if (fd == -1) fd = open(dname,O_RDONLY|O_NONBLOCK,0);
1460 if (fd == -1) fd = open(dname,O_WRONLY,0); /* some output devices need this */ 1460 if (fd == -1) fd = open(dname,O_WRONLY|O_NONBLOCK,0); /* some output devices need this */
1461 if (fd == -1) 1461 if (fd == -1)
1462 { 1462 {
1463 close(md); 1463 close(md);
1464 if (errno == EBUSY) /* in linux /usr/include/asm/errno.h */ 1464 if (errno == EBUSY) /* in linux /usr/include/asm/errno.h */
1465 { 1465 {
1549 close(fd); 1549 close(fd);
1550 close(md); 1550 close(md);
1551 } 1551 }
1552 if (sound_cards == 0) 1552 if (sound_cards == 0)
1553 { 1553 {
1554 fd = open(DAC_NAME,O_WRONLY,0); 1554 fd = open(DAC_NAME,O_WRONLY|O_NONBLOCK,0);
1555 if (fd != -1) 1555 if (fd != -1)
1556 { 1556 {
1557 sound_cards = 1; 1557 sound_cards = 1;
1558 audio_dsp[0] = 0; 1558 audio_dsp[0] = 0;
1559 audio_type[0] = NORMAL_CARD; 1559 audio_type[0] = NORMAL_CARD;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines