Hack45.Tweak Skype by Editing config.xml


Hack 45. Tweak Skype by Editing config.xml

config.xml is where Skype stores many of its configuration settings, and by editing it directly, you can have greater control over how Skype works.

Works with: all versions of Skype.

A word of caution. Hacking around with Skype's config.xml file can cause problems, especially if you tinker with settings not discussed in this hack. Skype, however, has the ability to rebuild a defaultbut validconfig.xml file when it encounters a problem with the existing config.xml file. This is the case even if you rename or delete config.xmlSkype simply builds a new one. Under such circumstances, Skype tries to restore as many of your personal settings and preferences in the new config.xml as possible, but it's always wise to make a backup of your current config.xml before you make any changes. That way, if things go wrong, you can restore the old version or copy across selected settings from the old to the new. You have been warned!

Always stop Skype from running (by right-clicking on Skype in the system tray and choosing Quit) before making any changes to config.xml (or shared.xml), because even though your editor may tell you it has saved your updated version of config.xml, you may find that Skype ignores your changes and they are missing when you reopen config.xml. The procedure for editing any of Skype's configuration files should go like this: quit Skype (that is, stop it from running), edit (or delete) the configuration file, save the changes, and restart Skype.


You can find config.xml on all platforms, though the extent to which you can edit Skype on each varies. In terms of the opportunities for tweaking, the platform order, from the greatest to the least extent, goes like this: Windows, Linux, Mac OS X, and Pocket PC. Typically, you can find config.xml in these locations on each platform:


Windows

 C:\Documents and Settings\Username\Application Data\Skype\Skypename\config.xml 


Linux

 /home/Username/.Skype/Skypename/config.xml 


Mac OS X

 /Users/Username/Library/Application Support/Skype/Skypename/config.xml 


Pocket PC

 \Application Data\Skype\Skypename\config.xml 

Username is your login name for the machine and Skypename is the name you use to log into Skype.

If you cannot find config.xml (or shared.xml) it might not be because it is missing. Rather, on some platforms, files of this type are treated as "hidden" by the application you are using to search for them.

You can fix this problem on Windows Explorer by selecting Tools Folder Options… View Advanced Settings, and clicking on the "Show hidden files and folders radio button. Alternatively, to find config.xml without having to enable "Show hidden files and folders," enter %appdata%\Skype\Skype logon name\ in the Windows Explorer address bar and it will display all files, regardless of whether they're hidden.

Mac OS X Finder displays all file types by default, but you may want to display the .xml file extension of config.xml (select Preferences Advanced, and check "Show all file extensions).

Most Linux file browsers have a similar option to show hidden files and folders. As such a wide choice of file browsers is available for Linux, look at the help file for your favorite file browser to find how to display hidden files and folders.


There is another file, shared.xml, from which Skype obtains configuration information that is common to all users of Skype on the same Windows machine, to all instances of Skype running in the same user session for Linux and Mac OS X, and to only one instance of Skype on Pocket PC, as Pocket PC supports neither multiple user sessions nor multiple running instances of Skype. You also can edit this file to tweak how Skype behaves, but the scope for tweaking is far more limited than for config.xml. You typically can find shared.xml in these locations on each platform:


Windows (version 1.3 and before)

 C:\Documents and Settings\All Users\Application Data\Skype\shared.xml 


Windows (version 1.4 and after)

 C:\Documents and Settings\Username\Application Data\Skype\shared.xml 


Linux

 /home/Username/.Skype/shared.xml 


Mac OS X

 /Users/Username/Library/Application Support/Skype/shared.xml 


Pocket PC

 \Application Data\Skype\shared.xml 

4.4.1. config.xml Deconstructed

config.xml (and shared.xml) are what's known as Extensible Markup Language (XML) documents. XML files are human-readable text files that are made up of tags (named identifiers) that demark elements (items of data) that are organized in the structure of a tree (a collection of tags laid out in a root and branch fashion). Now that's a mouthful! However, it's all rather plain and easy if we look at an examplein this case, a fragment of config.xml:

 <?xml version="1.0" ?> <config version="1.0" serial="414" timestamp="1123702750.6">    <Lib>       <Call>          <IncomingPolicy>everyone</IncomingPolicy>          <MicVolume>255</MicVolume>          <SkypeInPolicy>everyone</SkypeInPolicy>       </Call>       <CentralStorage>          <LastBackoff>0</LastBackoff>          <LastFailure>0</LastFailure>                             .                             .                             .                             . </config> 

The first line tells any application that uses this file that it is an XML file. From then onward, data is stored in a hierarchical fashion, with individual data elements and groups of elements always bracketed between two matching tags. Tags that have no data element are the exception and look like this: <NoDataTag attrib="value"/>. For tags with a data element, there's always an opening tagfor example, <Call>and a corresponding closing tagin this example, </Call>. Whatever you do, don't break this matched tag structure. Other than that, XML files are easy to edit. In fact, XML was specifically designed to be both easy to understand and easy to edit for a human, not just for a machine.

This hack deals with only a subset of the whole config.xml file, as it isolates only those tags that contain configuration data that does something useful from the perspective of a Skype user. Table 4-2 summarizes the tags we'll hack in this chapter. You can download a more complete table of config.xml tags and their meanings from the book's web site, http://www.oreilly.com/catalog/SkypeHacks/index.html.

Table 4-2. Subset of config.xml tags used in this hack

Tag

Parent tag

Description

Platform

Default

Values

<AGC>

<Call>

<General>

Automatic gain control

W

1

0,1

<AEC>

<General>

Automatic echo correction

W

1

0,1

<EC>

<Call>

Echo correction

P

1

0,1

<MicVolume>

<Call>

Microphone volume control

WLMP

0255

<FriendsPopup>

<Calls> and <Messages>

Pop-up notification from friends

W

1

0,1

<OthersPopup>

<Calls> and <Messages>

Pop-up notification from others

W

1

0,1


Key: W = Windows, L = Linux, M = Mac OS X, P = Pocket PC

4.4.2. Editing config.xml

XML files are text files. However, you can encode them in different character sets; specifically, wide character sets (ones with more than 256 characters in them). This may cause problems on different platforms and with different versions of Skype. One way to avoid this is to look at the encoding of your existing (working) config.xml file. If you always save your modified version of config.xml (or shared.xml) using the same encoding, encoding won't be a problem.

As a general rule, the default text editor on your platform should be up to the job of editing and saving config.xml (and shared.xml) in a format that Skype will recognize. Here are some suggestions, by platform (in all cases, make sure you save files in plain-text format without any formatting information of any sort).


Windows

Notepad or WordPad. Perhaps the fastest way to edit config.xml on Windows is to right-click on it in Windows Explorer and choose Edit (or highlight config.xml and then choose File Edit from the menu). That will immediately open Linux

Emacs or Vim.


Mac OS X

Vi and Emacs.

4.4.3. Tweaks

A number of tweaks are available to the Skype user who is willing to delve into config.xml and shared.xml and hack away. There are two motivations for doing so. First, some tweaks fix something that is broken with Skype. Second, some tweaks add functionality to Skype or otherwise enhance or improve it. Both are covered in the tweaks that follow, which are prefixed with "Fix" or "Enhancement" to help you distinguish between the two.

4.4.3.1. config.xml tweaks.

Fix (Windows): degraded sound and/or broken speech

Find the automatic gain control tag, <AGC>, and set its value to 0. There should be two entries for <AGC>, one under the parent tag <Call> and the other under <General>; if either is missing, add it. When you're done, both<AGC> enTRies should be set to 0, and your config.xml file should look something like this:

 <?xml version="1.0"?> <config version="1.0" serial="327" timestamp="1125399449.34">     <Lib>         <Call>                          <AGC>0</AGC>             <IncomingPolicy>everyone</IncomingPolicy>             <MicVolume>173</MicVolume>              <SkypeInPolicy>everyone</SkypeInPolicy>         </Call>     .     .     .     </Lib>     .     .     .     <General>         <AEC>1</AEC>                  <AGC>0</AGC>         <AdvancedFaF>0</AdvancedFaF>         <AutoAudioSettingsAdjust>1</AutoAudioSettingsAdjust>     .     .     .     </General>     .     .     . </config> 


Fix (Windows): others cannot hear me

Select Skype Tools Options… Sound Devices, uncheck the "Let Skype adjust my device settings checkbox, and save. Find the microphone volume control tag, <MicVolume>. The valid range of values for this element is between 0 (off) and 255 (maximum). Try adjusting this value upward and downward, each time calling echo123 to test the result. After a little trial and error, hopefully you will find a microphone volume setting that enables others to hear you properly.


Fix (Windows and Pocket PC): echo

Find the automatic echo correction tag, <AEC>, on Windows (<EC> on Pocket PC), and try toggling its value between 0 and 1, each time testing the effect by calling the echo123 service. On Pocket PC, you can also toggle this setting using the user interface (select Skype Tools Options…).


Enhancement (Windows): disable pop ups

Pop-up notifications from Skype can be an irritation, particularly if you're in the throes of something important, like a video game! To disable pop ups, set both <FriendsPopup> and <OthersPopup> to 0; that is, set <FriendsPopup>0</FriendsPopup> and <OthersPopup>0</OthersPopup>. Now your config.xml file should look something like this:

 <?xml version="1.0"?> <config version="1.0" serial="327" timestamp="1125399449.34">     .     .     .     <UI>         <Calls>             <AllowMultiCalls>0</AllowMultiCalls>             <FriendsAutoAnswer>0</FriendsAutoAnswer>                          <FriendsPopup>0</FriendsPopup>             <OthersAutoAnswer>0</OthersAutoAnswer>                          <OthersPopup>0</OthersPopup>             <PopupOnAll>0</PopupOnAll>         </Calls>     .     .     .         <Messages>             <AuthPopup>1</AuthPopup>             <CafeMode>0</CafeMode>             <DisplayCallInfo>0</DisplayCallInfo>             <DisplayCallLogLimit>0</DisplayCallLogLimit>              <FriendsFlash>1</FriendsFlash>                          <FriendsPopup>0</FriendsPopup>             <ImChatStyle>0</ImChatStyle>             <OthersFlash>1</OthersFlash>                          <OthersPopup>0</OthersPopup>             <PopupOnAll>0</PopupOnAll>             <ShowTime>1</ShowTime>         </Messages>     .     .     .     </UI> </config> 

4.4.3.2. shared.xml tweaks.

Enhancement (all platforms): refresh Skype super-node list

Refreshing your list of super nodes will change the way in which your Skype client interacts with the Skype network. It may change how calls are routed and have an impact on how many relays (hops from Skype client to Skype client) you have. Having a new and different super-node list sometimes improves how Skype runs. To refresh your super-node list, simply rename or delete shared.xml. The next time Skype starts it will build shared.xml, and your super-node list, anew.

4.4.4. See Also

  • O'Reilly (http://www.oreilly.com/) has published a comprehensive range of books on XML, from beginner to expert level. Particularly noteworthy for someone new to XML is Learning XML, Second Edition (2003).

  • "Eliminate Echo and Noise" [Hack #39] also uses some config.xml tweaks.




Skype Hacks
Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service
ISBN: 0596101899
EAN: 2147483647
Year: 2005
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net