WineHQ
WineHQ

4.5. Environment variables

4.5.1. WINEDEBUG=[channels]

Wine isn't perfect, and many Windows applications still don't run without bugs under Wine (but then, a lot of programs don't run without bugs under native Windows either!). To make it easier for people to track down the causes behind each bug, Wine provides a number of debug channels that you can tap into.

Each debug channel, when activated, will trigger logging messages to be displayed to the console where you invoked wine. From there you can redirect the messages to a file and examine it at your leisure. But be forewarned! Some debug channels can generate incredible volumes of log messages. Among the most prolific offenders are relay which spits out a log message every time a win32 function is called, win which tracks windows message passing, and of course all which is an alias for every single debug channel that exists. For a complex application, your debug logs can easily top 1 MB and higher. A relay trace can often generate more than 10 MB of log messages, depending on how long you run the application. (You'll want to check out RelayExclude registry key to modify what the relay trace reports). Logging does slow down Wine quite a bit, so don't use WINEDEBUG unless you really do want log files.

Within each debug channel, you can further specify a message class, to filter out the different severities of errors. The four message classes are: trace, fixme, warn, err.

To turn on a debug channel, use the form class+channel. To turn it off, use class-channel. To list more than one channel in the same WINEDEBUG option, separate them with commas. For example, to request warn class messages in the heap debug channel, you could invoke wine like this:

$ WINEDEBUG=warn+heap wine program_name
        

If you leave off the message class, wine will display messages from all four classes for that channel:

$ WINEDEBUG=heap wine program_name
        

If you wanted to see log messages for everything except the relay channel, you might do something like this:

$ WINEDEBUG=+all,-relay wine program_name
        

Here is a list of the debug channels and classes in Wine. More channels will be added to (or subtracted from) later versions.

Table 4-1. Debug Channels

acceladpcmadvapianimateaspi
atomavicapavifilebidibitblt
bitmapcabinetcapicaretcdrom
cfgmgr32classclipboardclippingcombo
comboexcommcommctrlcommdlgcomputername
consolecrtdllcryptcursescursor
d3dd3d_shaderd3d_surfacedatetimedc
ddemlddrawddraw_fpsddraw_geomddraw_tex
debugstrdevenumdialogdinputdll
dmadmbanddmcomposdmfiledmfiledat
dmimedmloaderdmscriptdmstyledmsynth
dmusicdosfsdosmemdplaydplayx
dpnhpastdriverdsounddsound3dedit
enhmetafileenvironeventeventlogexec
filefixupfontfpsg711
gdiglobalglugraphicsheader
heaphookhotkeyicmpicon
imagehlpimagelistimmintint21
int31ioipaddressiphlpapijack
joystickkeykeyboardlistboxlistview
loaddlllocalmapimcimcianim
mciavimcicdamcimidimciwavemdi
menumenubuildermessagemetafilemidi
mmauxmmiommsysmmtimemodule
monthcalmpeg3mprmsacmmsdmo
msgmshtmlmsimsimg32msisys
msrle32msvcrtmsvideomswsocknativefont
netapi32netbiosnlsnonclientntdll
odbcoleoledlgolerelayopengl
pagerpalettepidlpowermgntprint
processprofileprogresspropsheetpsapi
psdrvqcapquartzrasrebar
regregionrelayresourcerichedit
rundll32sblasterscrollsehselector
serversetupapishdocvwshellshlctrl
snmpapisnoopsoundstaticstatusbar
storagestressstringsyscolorsystem
tabtapetapitasktext
threadthunktidtimertoolbar
toolhelptooltipstrackbartreeviewttydrv
twaintypelibuninstallerupdownurlmon
uxthemevervirtualvxdwave
wc_fontwinwin32winebootwinecfg
wineconsolewine_d3dwinevdmwingwinhelp
wininetwinmmwinsockwinspoolwintab
wintab32wnetx11drvx11settingsxdnd
xrandrxrenderxvidmode  

For more details about debug channels, check out the The Wine Developer's Guide.

4.5.2. WINEDLLOVERRIDES=[DLL Overrides]

It's not always possible to run an application on builtin DLL's. Sometimes native DLL's simply work better. Altough these DLL overrides can be set using winecfg you might want to use the WINEDLLOVERRIDES environment variable to set them.

For example, if you wanted wine to use native ole32.dll, oleaut32.dll and rpcrt4 you could run wine like this:

$ WINEDLLOVERRIDES="ole32,oleaut32,rpcrt4=n" wine program_name
        

For more information about DLL overrides, please refer to the DLL overrides section of this guide.

4.5.3. OSS Audio Driver Settings

If you are using the OSS audio driver and you have multiple devices, (i.e. /dev/dsp*, /dev/mixer*) you can specify which one you want to use with the following environment variables:

  • AUDIODEV=[audio device]

  • MIXERDEV=[mixer device]

  • MIDIDEV=[MIDI device]

As an example:

$ AUDIODEV=/dev/dsp4 MIXERDEV=/dev/mixer1 MIDIDEV=/dev/midi3 wine program_name