VirtualBox

Changeset 1071 in vbox for trunk


Ignore:
Timestamp:
Feb 27, 2007 11:00:14 AM (18 years ago)
Author:
vboxsync
Message:

fix Vista crash if sound is enabled; made audio LogRel consistent; winmm was never used, show dsound instead

Location:
trunk/src/VBox
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/alsaaudio.c

    r787 r1071  
    293293        alsa_logerr2 (err, typ, "Failed to open `%s':\n", pcm_name);
    294294#else
    295         LogRel(("Audio/ALSA: Failed to open '%s' as %s\n", pcm_name, typ));
     295        LogRel(("ALSA: Failed to open '%s' as %s\n", pcm_name, typ));
    296296#endif
    297297        return -1;
     
    303303        alsa_logerr2 (err, typ, "Failed to initialize hardware parameters\n");
    304304#else
    305         LogRel(("Audio/ALSA: Failed to initialize hardware parameters\n"));
     305        LogRel(("ALSA: Failed to initialize hardware parameters\n"));
    306306#endif
    307307        goto err;
     
    317317        alsa_logerr2 (err, typ, "Failed to set access type\n");
    318318#else
    319         LogRel(("Audio/ALSA: Failed to set access type\n"));
     319        LogRel(("ALSA: Failed to set access type\n"));
    320320#endif
    321321        goto err;
     
    327327        alsa_logerr2 (err, typ, "Failed to set format %d\n", req->fmt);
    328328#else
    329         LogRel(("Audio/ALSA: Failed to set format %d\n", req->fmt));
     329        LogRel(("ALSA: Failed to set format %d\n", req->fmt));
    330330#endif
    331331        goto err;
     
    337337        alsa_logerr2 (err, typ, "Failed to set frequency %d\n", req->freq);
    338338#else
    339         LogRel(("Audio/ALSA: Failed to set frequency %dHz\n", req->freq));
     339        LogRel(("ALSA: Failed to set frequency %dHz\n", req->freq));
    340340#endif
    341341        goto err;
     
    352352                      req->nchannels);
    353353#else
    354         LogRel(("Audio/ALSA: Failed to set number of channels to %d\n", req->nchannels));
     354        LogRel(("ALSA: Failed to set number of channels to %d\n", req->nchannels));
    355355#endif
    356356        goto err;
     
    363363                      nchannels);
    364364#else
    365         LogRel(("Audio/ALSA: Cannot handle obtained number of channels (%d)\n", nchannels));
     365        LogRel(("ALSA: Cannot handle obtained number of channels (%d)\n", nchannels));
    366366#endif
    367367        goto err;
     
    390390                                  req->period_size);
    391391#else
    392                     LogRel(("Audio/ALSA: Failed to set period time %d\n", req->period_size));
     392                    LogRel(("ALSA: Failed to set period time %d\n", req->period_size));
    393393#endif
    394394                    goto err;
     
    409409                              req->buffer_size);
    410410#else
    411                 LogRel(("Audio/ALSA: Failed to set buffer time %d\n", req->buffer_size));
     411                LogRel(("ALSA: Failed to set buffer time %d\n", req->buffer_size));
    412412#endif
    413413                goto err;
     
    435435                        );
    436436#else
    437                     LogRel(("Audio/ALSA: Could not get minimal period size for %s\n", typ));
     437                    LogRel(("ALSA: Could not get minimal period size for %s\n", typ));
    438438#endif
    439439                }
     
    474474                                  period_size);
    475475#else
    476                     LogRel(("Audio/ALSA: Failed to set period size %d (%s)\n",
     476                    LogRel(("ALSA: Failed to set period size %d (%s)\n",
    477477                            period_size, snd_strerror(err)));
    478478#endif
     
    497497                             typ);
    498498#else
    499                 LogRel(("Audio/ALSA: Could not get minimal buffer size for %s\n", typ));
     499                LogRel(("ALSA: Could not get minimal buffer size for %s\n", typ));
    500500#endif
    501501            }
     
    527527                              buffer_size);
    528528#else
    529                 LogRel(("Audio/ALSA: Failed to set buffer size %d (%s)\n",
     529                LogRel(("ALSA: Failed to set buffer size %d (%s)\n",
    530530                        buffer_size, snd_strerror(err)));
    531531#endif
     
    543543        alsa_logerr2 (err, typ, "Failed to apply audio parameters\n");
    544544#else
    545         LogRel(("Audio/ALSA: Failed to apply audio parameters\n"));
     545        LogRel(("ALSA: Failed to apply audio parameters\n"));
    546546#endif
    547547        goto err;
     
    553553        alsa_logerr2 (err, typ, "Failed to get buffer size\n");
    554554#else
    555         LogRel(("Audio/ALSA: Failed to get buffer size\n"));
     555        LogRel(("ALSA: Failed to get buffer size\n"));
    556556#endif
    557557        goto err;
     
    559559
    560560#ifdef VBOX
    561     LogRel(("Audio/ALSA: %s frequency %dHz, period size %d, buffer size %d\n",
     561    LogRel(("ALSA: %s frequency %dHz, period size %d, buffer size %d\n",
    562562             typ, req->freq, period_size, obt_buffer_size));
    563563#endif
  • trunk/src/VBox/Devices/Audio/audio.c

    r366 r1071  
    15331533    }
    15341534
     1535    LogRel(("Audio: Trying driver '%s'.\n", drvname));
     1536
    15351537    if (drvname) {
    15361538        int found = 0;
     
    15521554        for (i = 0; !done && i < sizeof (drvtab) / sizeof (drvtab[0]); i++) {
    15531555            if (drvtab[i]->can_be_default) {
     1556                LogRel(("Audio: Initialization of driver '%s' failed, trying '%s'.\n",
     1557                       drvname, drvtab[i]->name));
     1558                drvname = drvtab[i]->name;
    15541559                done = !audio_driver_init (s, drvtab[i]);
    15551560            }
     
    15631568        }
    15641569        else {
     1570            LogRel(("Audio: Initialization of driver '%s' failed, using NULL driver.\n", drvname));
    15651571            dolog ("warning: Using timer based audio emulation\n");
    15661572        }
     
    17711777void AUD_set_record_source (audrecsource_t *ars, audrecsource_t *als)
    17721778{
    1773     LogRel(("AUDIO: set_record_source ars=%d als=%d (not implemented)\n", *ars, *als));
     1779    LogRel(("Audio: set_record_source ars=%d als=%d (not implemented)\n", *ars, *als));
    17741780}
    17751781
     
    18621868    if (VBOX_FAILURE (rc))
    18631869        return rc;
    1864 
    1865     LogRel(("Using Audio driver '%s'\n", drvname));
    18661870
    18671871    rc = AUD_init (pDrvIns, drvname);
  • trunk/src/VBox/Devices/Audio/dsound_template.h

    r1 r1071  
    199199    }
    200200
     201#ifdef DSBTYPE_IN
     202    if (!s->dsound_capture)
     203        return -1;
     204#endif
     205
    201206    memset (&bd, 0, sizeof (bd));
    202207    bd.dwSize = sizeof (bd);
  • trunk/src/VBox/Devices/Audio/dsoundaudio.c

    r366 r1071  
    232232
    233233    AUD_log (AUDIO_CAP, "Reason: %s\n", str);
     234#ifdef VBOX
     235    LogRel(("DSound: Reason: %s\n", str));
     236#endif
    234237}
    235238
     
    538541
    539542    if (FAILED (hr)) {
     543#ifndef VBOX
    540544        dsound_logerr (hr, "Could not set cooperative level for window %p\n",
    541545                       hwnd);
     546#else
     547        LogRel(("DSound: Could not set cooperative level for window %p\n", hwnd));
     548        dsound_log_hresult(hr);
     549#endif
    542550        return -1;
    543551    }
     
    565573        );
    566574    if (FAILED (hr)) {
     575#ifndef VBOX
    567576        dsound_logerr (hr, "Could not create primary playback buffer\n");
     577#else
     578        LogRel(("DSound: Could not create primary playback buffer\n"));
     579        dsound_log_hresult(hr);
     580#endif
    568581        return -1;
    569582    }
     
    571584    hr = IDirectSoundBuffer_SetFormat (s->dsound_primary_buffer, &wfx);
    572585    if (FAILED (hr)) {
     586#ifndef VBOX
    573587        dsound_logerr (hr, "Could not set primary playback buffer format\n");
     588#else
     589        LogRel(("DSound: Could not set primary playback buffer format\n"));
     590        dsound_log_hresult(hr);
     591#endif
    574592    }
    575593
     
    581599        );
    582600    if (FAILED (hr)) {
     601#ifndef VBOX
    583602        dsound_logerr (hr, "Could not get primary playback buffer format\n");
     603#else
     604        LogRel(("DSound: Could not get primary playback buffer format\n"));
     605        dsound_log_hresult(hr);
     606#endif
    584607        goto fail0;
    585608    }
     
    9831006    hr = CoInitializeEx (NULL, COINIT_MULTITHREADED);
    9841007    if (FAILED (hr)) {
     1008#ifndef VBOX
    9851009        dsound_logerr (hr, "Could not initialize COM\n");
     1010#else
     1011        LogRel(("DSound: Could not initialize COM\n"));
     1012        dsound_log_hresult(hr);
     1013#endif
    9861014        return NULL;
    9871015    }
     
    9951023        );
    9961024    if (FAILED (hr)) {
     1025#ifndef VBOX
    9971026        dsound_logerr (hr, "Could not create DirectSound instance\n");
     1027#else
     1028        LogRel(("DSound: Could not create DirectSound instance\n"));
     1029        dsound_log_hresult(hr);
     1030#endif
    9981031        return NULL;
    9991032    }
     
    10011034    hr = IDirectSound_Initialize (s->dsound, NULL);
    10021035    if (FAILED (hr)) {
     1036#ifndef VBOX
    10031037        dsound_logerr (hr, "Could not initialize DirectSound\n");
     1038#else
     1039        LogRel(("DSound: Could not initialize DirectSound\n"));
     1040        dsound_log_hresult(hr);
     1041#endif
    10041042
    10051043        hr = IDirectSound_Release (s->dsound);
     
    10191057        );
    10201058    if (FAILED (hr)) {
     1059#ifndef VBOX
    10211060        dsound_logerr (hr, "Could not create DirectSoundCapture instance\n");
     1061#else
     1062        LogRel(("DSound: Could not create DirectSoundCapture instance\n"));
     1063        dsound_log_hresult(hr);
     1064#endif
    10221065    }
    10231066    else {
    10241067        hr = IDirectSoundCapture_Initialize (s->dsound_capture, NULL);
    10251068        if (FAILED (hr)) {
     1069#ifndef VBOX
    10261070            dsound_logerr (hr, "Could not initialize DirectSoundCapture\n");
     1071#else
     1072            LogRel(("DSound: Could not initialize DirectSoundCapture\n"));
     1073            dsound_log_hresult(hr);
     1074#endif
    10271075
    10281076            hr = IDirectSoundCapture_Release (s->dsound_capture);
  • trunk/src/VBox/Devices/Audio/ossaudio.c

    r366 r1071  
    227227        oss_logerr2 (errno, typ, "Failed to open `%s'\n", dspname);
    228228#else
    229         LogRel(("Audio/OSS: Failed to open %s for %s (%s)\n",
     229        LogRel(("OSS: Failed to open %s for %s (%s)\n",
    230230                 dspname, typ, strerror(errno)));
    231231#endif
     
    234234
    235235#ifdef VBOX
    236     LogRel(("Audio/OSS: Successfully opened %s for %s\n", dspname, typ));
     236    LogRel(("OSS: Successfully opened %s for %s\n", dspname, typ));
    237237#endif
    238238
     
    245245        oss_logerr2 (errno, typ, "Failed to set sample size %d\n", req->fmt);
    246246#else
    247         LogRel(("Audio/OSS: Failed to set sample size %d (%s)\n",
     247        LogRel(("OSS: Failed to set sample size %d (%s)\n",
    248248                 req->fmt, strerror(errno)));
    249249#endif
     
    256256                     req->nchannels);
    257257#else
    258         LogRel(("Audio/OSS: Failed to set nchannels=%d (%s)\n",
     258        LogRel(("OSS: Failed to set nchannels=%d (%s)\n",
    259259                 req->nchannels, strerror(errno)));
    260260#endif
     
    266266        oss_logerr2 (errno, typ, "Failed to set frequency %d\n", req->freq);
    267267#else
    268         LogRel(("Audio/OSS: Failed to set freq=%dHZ\n", req->freq, strerror(errno)));
     268        LogRel(("OSS: Failed to set freq=%dHZ\n", req->freq, strerror(errno)));
    269269#endif
    270270        goto err;
     
    275275        oss_logerr2 (errno, typ, "Failed to set non-blocking mode\n");
    276276#else
    277         LogRel(("Audio/OSS: Failed to set non-blocking mode (%s)\n", strerror(errno)));
     277        LogRel(("OSS: Failed to set non-blocking mode (%s)\n", strerror(errno)));
    278278#endif
    279279        goto err;
     
    286286                     req->nfrags, req->fragsize);
    287287#else
    288         LogRel(("Audio/OSS: Failed to set buffer_length=%d,%d (%s)\n",
     288        LogRel(("OSS: Failed to set buffer_length=%d,%d (%s)\n",
    289289                req->nfrags, req->fragsize, strerror(errno)));
    290290#endif
     
    296296        oss_logerr2 (errno, typ, "Failed to get buffer length\n");
    297297#else
    298         LogRel(("Audio/OSS: Failed to get buffer length (%s)\n", strerror(errno)));
     298        LogRel(("OSS: Failed to get buffer length (%s)\n", strerror(errno)));
    299299#endif
    300300        goto err;
     
    327327    oss_anal_close (&fd);
    328328#ifdef VBOX
    329     LogRel(("Audio/OSS: Closed %s for %s\n",
     329    LogRel(("OSS: Closed %s for %s\n",
    330330            in ? conf.devpath_in : conf.devpath_out, in ? "ADC" : "DAC"));
    331331#endif
     
    482482    oss_anal_close (&oss->fd);
    483483#ifdef VBOX
    484     LogRel(("Audio/OSS: Closed %s for DAC\n", conf.devpath_out));
     484    LogRel(("OSS: Closed %s for DAC\n", conf.devpath_out));
    485485#endif
    486486
     
    530530        oss_anal_close (&fd);
    531531#ifdef VBOX
    532     LogRel(("Audio/OSS: Closed %s for DAC\n", conf.devpath_out));
     532    LogRel(("OSS: Closed %s for DAC\n", conf.devpath_out));
    533533#endif
    534534        return -1;
     
    611611            oss_anal_close (&fd);
    612612#ifdef VBOX
    613     LogRel(("Audio/OSS: Closed %s for DAC\n", conf.devpath_out));
     613    LogRel(("OSS: Closed %s for DAC\n", conf.devpath_out));
    614614#endif
    615615            return -1;
     
    687687        oss_anal_close (&fd);
    688688#ifdef VBOX
    689     LogRel(("Audio/OSS: Closed %s for ADC\n", conf.devpath_in));
     689    LogRel(("OSS: Closed %s for ADC\n", conf.devpath_in));
    690690#endif
    691691        return -1;
     
    713713        oss_anal_close (&fd);
    714714#ifdef VBOX
    715     LogRel(("Audio/OSS: Closed %s for ADC\n", conf.devpath_in));
     715    LogRel(("OSS: Closed %s for ADC\n", conf.devpath_in));
    716716#endif
    717717        return -1;
     
    728728    oss_anal_close (&oss->fd);
    729729#ifdef VBOX
    730     LogRel(("Audio/OSS: Closed %s for ADC\n", conf.devpath_in));
     730    LogRel(("OSS: Closed %s for ADC\n", conf.devpath_in));
    731731#endif
    732732
  • trunk/src/VBox/Main/AudioAdapterImpl.cpp

    r1 r1071  
    225225
    226226#ifdef __WIN__
     227#ifdef VBOX_WITH_WINMM
    227228            case AudioDriverType_WINMMAudioDriver:
    228229            {
     
    231232                break;
    232233            }
     234#endif
    233235            case AudioDriverType_DSOUNDAudioDriver:
    234236            {
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r1015 r1071  
    53015301            }
    53025302#ifdef __WIN__
     5303#ifdef VBOX_WITH_WINMM
    53035304            case AudioDriverType_WINMMAudioDriver:
    53045305            {
     
    53065307                break;
    53075308            }
     5309#endif
    53085310            case AudioDriverType_DSOUNDAudioDriver:
    53095311            {
     
    53115313                break;
    53125314            }
    5313 #endif /* !__LINUX__ */
     5315#endif /* __WIN__ */
    53145316#ifdef __LINUX__
    53155317            case AudioDriverType_OSSAudioDriver:
  • trunk/src/VBox/Main/MachineImpl.cpp

    r1015 r1071  
    38273827#ifdef __WIN__
    38283828        else if (driver == L"winmm")
     3829#ifdef VBOX_WITH_WINMM
    38293830            audioDriver = AudioDriverType_WINMMAudioDriver;
     3831#else
     3832            // fall back to dsound
     3833            audioDriver = AudioDriverType_DSOUNDAudioDriver;
     3834#endif
    38303835        else if (driver == L"dsound")
    38313836            audioDriver = AudioDriverType_DSOUNDAudioDriver;
     
    55825587#ifdef __WIN__
    55835588            case AudioDriverType_WINMMAudioDriver:
     5589#ifdef VBOX_WITH_WINMM
    55845590            {
    55855591                CFGLDRSetString (adapterNode, "driver", "winmm");
    55865592                break;
    55875593            }
     5594#endif
    55885595            case AudioDriverType_DSOUNDAudioDriver:
    55895596            {
     
    55925599            }
    55935600#endif /* __WIN__ */
     5601            case AudioDriverType_ALSAAudioDriver:
    55945602#ifdef VBOX_WITH_ALSA
    5595             case AudioDriverType_ALSAAudioDriver:
    55965603            {
    55975604                CFGLDRSetString (adapterNode, "driver", "alsa");
    55985605                break;
    55995606            }
    5600 #else
    5601             /* fall back to OSS */
    5602             case AudioDriverType_ALSAAudioDriver:
    56035607#endif
    56045608#ifdef __LINUX__
  • trunk/src/VBox/Main/Makefile

    r1041 r1071  
    111111ifdef VBOX_WITH_ALSA
    112112VBoxSVC_DEFS += VBOX_WITH_ALSA
     113endif
     114ifdef VBOX_WITH_WINMM
     115VBoxSVC_DEFS += VBOX_WITH_WINMM
    113116endif
    114117ifdef VBOX_WITHOUT_LINUX_COMPILER_H
     
    219222VBoxC_DEFS += VBOX_WITH_ALSA
    220223endif
     224ifdef VBOX_WITH_WINMM
     225VBoxC_DEFS += VBOX_WITH_WINMM
     226endif
    221227VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0400
    222228VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette