Changeset 3214 in vbox
- Timestamp:
- Jun 21, 2007 3:00:08 PM (17 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r2981 r3214 1586 1586 { 1587 1587 PCIAC97LinkState *pData = PDMINS2DATA(pDevIns, PCIAC97LinkState *); 1588 AC97LinkState *s = &pData->ac97; 1588 1589 int rc; 1589 1590 … … 1593 1594 * Initialize data (most of it anyway). 1594 1595 */ 1595 pData->ac97.pDevIns= pDevIns;1596 s->pDevIns = pDevIns; 1596 1597 /* IBase */ 1597 pData->ac97.IBase.pfnQueryInterface= ichac97QueryInterface;1598 s->IBase.pfnQueryInterface = ichac97QueryInterface; 1598 1599 1599 1600 /* PCI Device */ … … 1665 1666 * Attach driver. 1666 1667 */ 1667 rc = PDMDevHlpDriverAttach (pDevIns, 0, & pData->ac97.IBase,1668 & pData->ac97.pDrvBase, "Audio Driver Port");1668 rc = PDMDevHlpDriverAttach (pDevIns, 0, &s->IBase, 1669 &s->pDrvBase, "Audio Driver Port"); 1669 1670 if (rc == VERR_PDM_NO_ATTACHED_DRIVER) 1670 1671 Log (("ac97: No attached driver!\n")); … … 1675 1676 } 1676 1677 1677 AUD_register_card ("ICH0", & pData->ac97.card);1678 AUD_register_card ("ICH0", &s->card); 1678 1679 1679 1680 ac97Reset(pDevIns); 1680 1681 1681 /**1682 * @todo We should probably display a message box. And perhaps we should1683 * select the noaudio driver instead.1684 */1685 1682 #ifndef __DARWIN__ /* coreaudio doesn't supply these. */ 1686 if (! pData->ac97.voice_pi)1683 if (!s->voice_pi) 1687 1684 LogRel(("AC97: WARNING: Unable to open PCM IN!\n")); 1688 if (! pData->ac97.voice_mc)1685 if (!s->voice_mc) 1689 1686 LogRel(("AC97: WARNING: Unable to open PCM MC!\n")); 1690 1687 #endif 1691 if (! pData->ac97.voice_po)1688 if (!s->voice_po) 1692 1689 LogRel(("AC97: WARNING: Unable to open PCM OUT!\n")); 1693 1690 1694 #ifdef __DARWIN__ /* coreaudio doesn't supply all, only bitch if we don't get anything. */ 1695 if (!pData->ac97.voice_pi && !pData->ac97.voice_po && !pData->ac97.voice_mc) 1696 #else 1697 if (!pData->ac97.voice_pi || !pData->ac97.voice_po || !pData->ac97.voice_mc) 1698 #endif 1699 VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), false, 1700 "HostAudioNotResponding", 1701 N_("Some audio devices could not be opened. Guest applications " 1702 "generating audio output or depending on audio input may hang. " 1703 "Make sure your host audio device is working properly. Check " 1704 "the logfile for error messages of the audio subsystem.")); 1691 if (!s->voice_pi && !s->voice_po && !s->voice_mc) 1692 { 1693 /* Was not able initialize *any* voice. Select the NULL audio driver instead */ 1694 AUD_close_in (&s->card, s->voice_pi); 1695 AUD_close_out (&s->card, s->voice_po); 1696 AUD_close_in (&s->card, s->voice_mc); 1697 s->voice_po = NULL; 1698 s->voice_pi = NULL; 1699 s->voice_mc = NULL; 1700 AUD_init_null(); 1701 ac97Reset(pDevIns); 1702 1703 PDMDevHlpVMSetRuntimeError(pDevIns, false, "HostAudioNotResponding", 1704 N_("No audio devices could not be opened. Selecting the NULL audio backend " 1705 "with the consequence that no sound is audible.")); 1706 } 1707 #ifndef __DARWIN__ 1708 else if (!s->voice_pi || !s->voice_po || !s->voice_mc) 1709 { 1710 char szMissingVoices[128]; 1711 size_t len = 0; 1712 bool fComma = false; 1713 if (!s->voice_pi) 1714 { 1715 len = RTStrPrintf(szMissingVoices, sizeof(szMissingVoices), "PCM_in"); 1716 fComma = true; 1717 } 1718 if (!s->voice_po) 1719 { 1720 len = RTStrPrintf(szMissingVoices + len, sizeof(szMissingVoices)-len, "%sPCM_out", 1721 fComma ? ", " : ""); 1722 fComma = true; 1723 } 1724 if (!s->voice_mc) 1725 { 1726 len = RTStrPrintf(szMissingVoices + len, sizeof(szMissingVoices)-len, "%sPCM_mic", 1727 fComma ? ", " : ""); 1728 } 1729 1730 PDMDevHlpVMSetRuntimeError(pDevIns, false, "HostAudioNotResponding", 1731 N_("Some audio devices (%s) could not be opened. Guest applications generating audio " 1732 "output or depending on audio input may hang. Make sure your host audio device " 1733 "is working properly. Check the logfile for error messages of the audio " 1734 "subsystem."), szMissingVoices); 1735 } 1736 #endif 1705 1737 1706 1738 return VINF_SUCCESS; -
trunk/src/VBox/Devices/Audio/audio.c
r2980 r3214 1599 1599 TMTimerSet (s->ts, TMTimerGet (s->ts) + conf.period.ticks); 1600 1600 return VINF_SUCCESS; 1601 } 1602 1603 int AUD_init_null(void) 1604 { 1605 AudioState *s = &glob_audio_state; 1606 1607 return audio_driver_init (s, &no_audio_driver); 1601 1608 } 1602 1609 -
trunk/src/VBox/Devices/Audio/audio.h
r1636 r3214 162 162 void AUD_set_record_source (audrecsource_t *ars, audrecsource_t *als); 163 163 164 int AUD_init_null(void); 165 164 166 static inline void *advance (void *p, int incr) 165 167 {
Note:
See TracChangeset
for help on using the changeset viewer.

