https://wiki.archlinux.org/api.php?action=feedcontributions&user=Ly50247&feedformat=atomArchWiki - User contributions [en]2024-03-29T10:47:30ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=User:Ly50247&diff=235364User:Ly502472012-11-14T14:03:55Z<p>Ly50247: </p>
<hr />
<div>Linux lover<br />
<br />
blog: [http://ly50247.diandian.com/ ly50247]<br />
<br />
googlecode: [http://code.google.com/p/ly50247/ ly50247]<br />
<br />
email: ly50247 at 126 dot com</div>Ly50247https://wiki.archlinux.org/index.php?title=Chromium&diff=227956Chromium2012-10-10T14:06:20Z<p>Ly50247: /* Flash Player */</p>
<hr />
<div>[[es:Chromium]]<br />
[[fr:chromium]]<br />
[[it:Chromium]]<br />
[[zh-CN:Chromium]]<br />
[[Category:Web Browser]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|General information, installation and troubleshooting for Chromium.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Chromium Tips and Tweaks}}<br />
{{Article summary wiki|Browser Plugins}}<br />
{{Article summary wiki|Firefox}}<br />
{{Article summary wiki|Opera}}<br />
{{Article summary end}}<br />
<br />
[[Wikipedia:Chromium (web browser)|Chromium]] is an open source graphical web browser from Google, based on the [[Wikipedia:WebKit|WebKit]] rendering engine.<br />
<br />
== Installation ==<br />
Chromium can be [[Pacman|installed]] with the package {{Pkg|chromium}}, available in the [[official repositories]].<br />
<br />
In the [[AUR]] you can also find:<br />
* {{AUR|chromium-dev}} - a development version of the Chromium browser.<br />
* {{AUR|chromium-update}} - an update. script for Chromium nighly builds, pre-compiled on the Chromium buildbot server.<br />
* {{AUR|chromium-browser-bin}} - a binary version of the latest Chromium build.<br />
<br />
{{Note|Compiling {{AUR|chromium-dev}} takes at least as long as compiling the Linux kernel.}}<br />
<br />
Various versions of the modified Google Chrome browser can be found in the [[AUR]]:<br />
* {{AUR|google-chrome}}<br />
* {{AUR|google-chrome-beta}}<br />
* {{AUR|google-chrome-dev}}<br />
<br />
See these [https://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome two] [http://news.softpedia.com/news/Google-Chrome-vs-Chromium-Understanding-Stable-Beta-Dev-Releases-and-Version-No-140060.shtml articles] for an explanation of the differences between Stable/Beta/Dev, as well as Chromium vs. Chrome and the version numbers.<br />
<br />
== Configuration ==<br />
<br />
=== File associations ===<br />
<br />
Unlike [[Firefox]], Chromium does not maintain its own database of mimetype-to-application associations. Instead, it relies on [[Xdg-open|xdg-open]] to open files and other mime types, for example, [[Wikipedia:Magnet URI scheme|magnet links]].<br />
<br />
There are exceptions to this rule though. In the case of ''mailto'' URIs, Chromium calls out to {{ic|xdg-email}} which is similar to {{ic|xdg-open}}. Other protocol handlers may have equivalent scripts so check {{ic|/usr/bin/xdg*}}. <br />
<br />
The behaviour of {{ic|xdg-*}} tools is managed automatically in environments such as [[GNOME]], [[KDE]], [[Xfce]] or [[LXDE]], but does not work in others. Usually this behaviour can be fixed by tricking them into thinking that they are operating in one of the supported desktop environments. Depending on your environment one may work and another will not so trying each is recommended. You can set the desktop environment with the following variable:<br />
export DE=INSERT_DE_HERE<br />
<br />
where the recognised desktop environments are: '''gnome''', '''kde''', '''xfce''' and '''lxde'''. For the variable to be always set, put it somewhere like {{ic|~/.xinitrc}} or {{ic|~/.bashrc}}.<br />
<br />
An alternative is to edit the {{ic|xdg-open}} or {{ic|xdg-email}} scripts and '''hard-code''' a useful DE. At the bottom of the file you will see something like this:<br />
{{hc|/usr/bin/xdg-open|<nowiki><br />
detectDE<br />
<br />
if [ x"$DE" = x"" ]; then<br />
DE=generic<br />
fi<br />
<br />
DEBUG 2 "Selected DE $DE"<br />
<br />
# if BROWSER variable is not set, check some well known browsers instead<br />
if [ x"$BROWSER" = x"" ]; then<br />
BROWSER=links2:elinks:links:lynx:w3m<br />
if [ -n "$DISPLAY" ]; then<br />
BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER<br />
fi<br />
fi<br />
<br />
case "$DE" in<br />
kde)<br />
open_kde "$url"<br />
;;<br />
<br />
gnome*)<br />
open_gnome "$url"<br />
;;<br />
<br />
mate)<br />
open_mate "$url"<br />
;;<br />
<br />
xfce)<br />
open_xfce "$url"<br />
;;<br />
<br />
lxde)<br />
open_lxde "$url"<br />
;;<br />
<br />
generic)<br />
open_generic "$url"<br />
;;<br />
<br />
*)<br />
exit_failure_operation_impossible "no method available for opening '$url'"<br />
;;<br />
esac</nowiki><br />
}}<br />
<br />
change the third line: {{ic|DE&#61;generic}} to one of the supported desktop environments (e.g. {{ic|DE&#61;gnome}}). <br />
<br />
{{Note|These changes are lost when any of the utilities are upgraded.}}<br />
<br />
An approach which is less useful is to place the required application in the default browser list:<br />
<br />
BROWSER=links2:links:lynx:w3m<br />
if [ -n "$DISPLAY" ]; then<br />
BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER<br />
fi<br />
<br />
{{ic|xdg-open}} and {{ic|xdg-email}} fall back to this list of browsers and will use the first that they find to attempt to open the URI. You could add the name of the application to the beginning of the list. However there is no guarantee that the application will be called correctly to meet your needs, e.g. your mail client will open but it will not correctly receive the ''mailto'' address. Also it will only work for one application.<br />
<br />
A fourth option is to make a softlink from your preferred application to one of the names on the browser list. This approach has the same problems as the previous work around. For more discussion on these ideas see [https://bbs.archlinux.org/viewtopic.php?id=81282&p=1 this forum thread].<br />
<br />
=== Font Rendering ===<br />
Chromium is now supposed to use the settings in {{ic|~/.fonts.conf}}, though you may have to edit it manually (see [[Font_Configuration#Basic_settings|Font Configuration]]). If the fonts are still rendered badly, you can use Xft settings [[X resources|as suggested here]]. Create {{ic|~/.Xresources}} if it does not exist and add in:<br />
{{hc|~/.Xresources|<br />
...<br />
! Xft settings ---------------------------------------------------------------<br />
Xft.dpi: 96<br />
Xft.antialias: true<br />
Xft.rgba: rgb<br />
Xft.hinting: true<br />
Xft.hintstyle: hintslight<br />
...<br />
}}<br />
<br />
Then update the X Resources database using:<br />
<br />
{{bc|xrdb -merge ~/.Xresources}}<br />
<br />
{{Note|These settings will affect any application that uses X Resources for font settings; one example is [[Rxvt-unicode|rxvt-unicode]].}}<br />
<br />
==== Non-Latin characters ====<br />
Install needed fonts to correctly display Chinese, Japanese, Korean characters. For examples of recommended fonts for various languages see [[Fonts#Font_packages|Font Packages]].<br />
<br />
=== Default browser ===<br />
The simplest way to make Chromium the default browser is to set variable {{Ic|<nowiki>$BROWSER=chromium</nowiki>}} in {{ic|~/.profile}}<br />
if [ -n "$DISPLAY" ]; then<br />
BROWSER=chromium<br />
fi<br />
<br />
To test if this was applied successfully, try to open an URL with {{ic|xdg-open}} as follows:<br />
$ xdg-open http://google.com/<br />
If everything went well, either a new tab inside Chromium, or a new window would open and display the Google homepage, depending on your settings.<br />
<br />
Another option, when using {{AUR|mimeo}}, is to associate "http://" links with Chromium:<br />
{{hc|~/.config/mimeo.conf|<nowiki><br />
/usr/bin/chromium<br />
^http://<br />
</nowiki>}}<br />
<br />
If all of that still does not get it working, you can try adding the following to the {{ic|[Added Associations]}} list in {{ic|~/.local/share/applications/mimeapps.list}}:<br />
x-scheme-handler/http=chromium.desktop<br />
<br />
For more info, see [[Xdg-open]].<br />
<br />
=== Flash Player ===<br />
The Adobe Flash plugin can be [[Pacman|installed]] with the package {{Pkg|flashplugin}}, available in the official repositories. <br />
<br />
While the classic Flash plugin will not be updated for Linux, Chromium can use the Flash plugin from Google Chrome (that uses the new Pepper API). This plugin is available in the [[AUR]] with the {{AUR|chromium-pepper-flash}} or {{AUR|chromium-pepper-flash-stable}} packages. <br />
<br />
{{Note|Make sure to enable the Flash plugin with location {{ic|/usr/lib/PepperFlash/libpepflashplayer.so}} in {{ic|chrome://plugins}} and disable the plugin with location {{ic|/usr/lib/mozilla/plugins/libflashplayer.so}}.}}<br />
<br />
=== Open PDF files inside Chromium ===<br />
<br />
There are multiple ways of enabling PDF support in Chromium that are detailed below. <br />
<br />
==== Using Google Chrome's libpdf ====<br />
<br />
'''libpdf''' is Google's own implementation of a PDF renderer. While compatible, it is currently only part of Chrome releases, not Chromium ones.<br />
<br />
The easiest way to add it to the latter is using one of the packages provided in the [[AUR]]:<br />
* {{AUR|chromium-stable-libpdf}} for the stable version of the browser.<br />
* {{AUR|chromium-libpdf}} for a development version that installs to {{ic|/usr/lib/chromium}} (such as {{AUR|chromium-dev}}).<br />
* {{AUR|chromium-browser-libpdf}} for a development version that installs to {{ic|/opt/chromium-browser}} (such as {{AUR|chromium-browser-bin}}).<br />
<br />
To do it manually, download a Google Chrome release that corresponds to the version of Chromium you use:<br />
<br />
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_i386.deb<br />
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-unstable_current_i386.deb<br />
<br />
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb<br />
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb<br />
<br />
Extract the deb file with<br />
$ ar vx <deb-file><br />
<br />
Extract LZMA archive with<br />
$ tar -xJf <lzma-file><br />
<br />
Move {{ic|libpdf.so}} from {{ic|opt/google/chrome/}} to the appropriate directory as stated above. A change of its file permissions and ownership may be necessary (the permission of {{ic|libpdf.so}} should be 755).<br />
<br />
To verify that the installation went correctly: start Chromium, open ''about:plugins'' and check if "Chrome PDF Viewer" is available (it may need to be enabled).<br />
<br />
{{Note|As a new version of Chromium will not update {{ic|libpdf.so}}, it may become incompatible. Thus and with respect to possible security fixes it is advisable to update both at the same time.}}<br />
<br />
==== Using mozplugger ====<br />
[http://mozplugger.mozdev.org/ mozplugger] is a general purpose Firefox plugin that allows the user to embed and launch their favourite application to handle the various different types of media. It can also be used in Chromium to handle PDF files using Evince or Okular, for example.<br />
<br />
mozplugger plugin can be [[Pacman|installed]] with the package {{AUR|mozplugger-chromium}}, available in the [[AUR]]. <br />
<br />
To set the application you wish to use to view PDF files, follow the instructions on the [[Firefox_Tweaks#Viewing_PDF.2FPS_inside_Firefox|Firefox Tweaks]] page.<br />
<br />
==== Using the KParts plugin ====<br />
[http://www.unix-ag.uni-kl.de/~fischer/kpartsplugin/ The KParts plugin] is a plugin that uses KDE's KPart technology to embed different file viewers in the browser, such as PDFs (using Okular), archives (using Ark), ODF (using Calligra Words), etc.<br />
<br />
The KParts plugin can be installed with the package {{Pkg|kpartsplugin}}, available in the official repositories.<br />
<br />
=== Certificates ===<br />
<br />
Chromium uses [[Nss|NSS]] for the certificate management. Certificates can be managed (including added) by going to ''Settings'', clicking the ''Show advanced settings..'' link and then ''Manage Certificates''.<br />
<br />
== Tips and Tricks ==<br />
{{Box||See the main article: [[Chromium Tips and Tweaks]]|#E5E5FF|#FCFCFC}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Proxy Settings ===<br />
There have been many situations in which proxy settings do not work properly, especially if set through the KDE interface. A good method as of now is to use Chromium's command-line options, like {{ic|--proxy-pac-url}} and {{ic|--proxy-server}}, to set your proxy.<br />
<br />
=== Default profile ===<br />
If you cannot get your default profile when you try to run Chromium and get a similar error instead:<br />
{{bc|<br />
$ chromium<br />
[2630:2630:485325611:FATAL:chrome/browser/browser_main.cc(755)] Check failed: profile. <br />
Cannot get default profile. Trace/breakpoint trap<br />
}}<br />
<br />
you have to set the correct owner of the directory {{ic|~/.config/chromium}} as following:<br />
$ sudo chown -R yourusername:yourusergroup /home/yourusername/.config/chromium<br />
<br />
=== WebGL ===<br />
<br />
Sometimes, Chromium will disable WebGL with certain graphics card configurations. This can generally be remedied by typing {{ic|about:flags}} into the URL bar and enabling the WebGL flag. You may also enable WebGL by passing the command line flag {{ic|--enable-webgl}} to Chromium in the terminal.<br />
<br />
There is also the possibility that your graphics card has been blacklisted by Chromium. To override this, pass the flag {{ic|--ignore-gpu-blacklist}} when starting Chromium, alternatively, go to {{ic|about:flags}} and enable ''Override software rendering list''.<br />
<br />
== See Also ==<br />
* [http://www.chromium.org/Home Chromium Homepage]<br />
* [http://googlechromereleases.blogspot.com Google Chrome Release Notes]<br />
* [https://chrome.google.com/webstore/category/home Chrome Web Store]<br />
* [[Wikipedia: Chromium_(web_browser)#Differences_from_Google_Chrome|Differences between Chromium and Google Chrome]]<br />
* [http://peter.sh/experiments/chromium-command-line-switches/ List of Chromium command-line switches]</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System&diff=137288Open Sound System2011-04-14T10:28:22Z<p>Ly50247: /* {{Codeline|ossvol}} troubleshooting */</p>
<hr />
<div>[[Category:Sound (English)]]<br />
[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|OSS}}<br />
<br />
This article will show you how to install and configure the '''O'''pen '''S'''ound '''S'''ystem (OSS) on you computer.<br />
<br />
The [http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] is an alternative sound architecture for Unix-like and POSIX-compatible systems. OSS version 3 was the original sound system for Linux and is in the kernel but was superceded by ALSA in 2002 when OSS version 4 became proprietary software. OSSv4 became free software again in 2007 when [http://www.opensound.com/ 4Front Technologies] released its source code and provided it under the GPL license.<br />
<br />
== Comparisons with ALSA ==<br />
<br />
Some advantages and disadvantages compared to using the Advanced Linux Sound Architecture.<br />
<br />
=== OSS Advantages (users) ===<br />
<br />
* Control for each application sound volume.<br />
* Some legacy cards are supported better (e.g. Creative X-Fi).<br />
* Initial response time in sound applications is usually better.<br />
* Better support for applications that use the OSS API. Many applications still use this API, and do not require an emulation layer like ALSA uses.<br />
<br />
=== OSS Advantages (developers) ===<br />
<br />
* Cleaner and easier to use API, and better API [http://manuals.opensound.com/developer documentation].<br />
* Support for drivers in userspace.<br />
* Accesibility. OSS runs on BSDs and Solaris.<br />
* Portability. OSS is [http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf easier] to port to other operating systems.<br />
<br />
=== ALSA Advantages ===<br />
<br />
* Better support for USB audio devices. With OSS output is experimental, input is not implemented.<br />
* Support for Bluetooth audio devices.<br />
* Support for AC'97 and HDAudio dial-up soft-modems such as Si3055.<br />
* Better support for MIDI devices. With OSS you'll have to use a software synthesizer such as Timidity or Fluidsynth.<br />
* Support for suspend. OSS and associated programs will need to be closed first.<br />
* Better support for jack detection. On some HD motherboards users will need to turn down the speaker volume when plugging in their earphones.<br />
<br />
== Install ==<br />
<br />
Install OSS by running:<br />
<br />
# pacman -S oss<br />
<br />
This will install the OSS files and run the OSS install script that will temporarily disable the ALSA modules, and install the OSS kernel modules. Since ALSA is enabled by default in the boot scripts, you need to disable it for it not to conflict with OSS when booting. You can do this by editing {{Filename|rc.conf}} and adding:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
Then add OSS to the daemon array:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
If your user is not part of the audio group, add your user by:<br />
<br />
# gpasswd -a username audio<br />
<br />
Then start OSS by:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
In the case OSS is not able to detect your card when starting it, run:<br />
<br />
# ossdetect -v<br />
<br />
Then {{Codeline|soundoff && soundon}} to reactivate it.<br />
<br />
== Testing ==<br />
<br />
Beware the default volume is very loud, avoid using earphones and physically lower the volume of your speakers (if possible) before running the test.<br />
<br />
'''Test OSS by running:'''<br />
<br />
$ osstest<br />
<br />
You should be able to hear music during the test process. If there is no audio, try to adjust the volume or refer to the troubleshooting section.<br />
<br />
If you want to hear sounds from more than one application simultaneously, you need vmix, OSS's software mixer. <br />
<br />
'''Check that vmix is enabled by running:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
You should see a line like 'vmix0-enable ON|OFF (currently ON)'. If you don't see any lines beginning with 'vmix', it probably means that vmix hasn't been attached to your sound device. To attach vmix, issue the command<br />
<br />
$ vmixctl attach device<br />
<br />
where ''device'' is your sound device, eg., /dev/oss/oss_envy240/pcm0 .<br />
<br />
To avoid having to issue this command manually in the future, you can add it to /usr/lib/oss/soundon.user, as suggested at http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output .<br />
<br />
If you get "Device or resource busy" error, you need to add "vmix_no_autoattach=1" in /usr/lib/oss/conf/osscore.conf, and then reboot. <br />
<br />
'''See which devices are detected by running:'''<br />
<br />
$ ossinfo<br />
<br />
You should be able to see your devices listed under Device objects or Audio Devices. If the device that you want to use is not at the top on Audio devices or Device objects sections, /usr/lib/oss/etc/installed_drivers needs to be edited. The driver for the device that needs to be used should be at the very top. A soundoff, soundon is probably required. If this does not work, comment all drivers listed that are not your preferred device.<br />
<br />
== Volume Control ==<br />
<br />
To control the volume of various devices, mixers levels will need to be set. The command line mixer is called {{Codeline|ossmix}}. It's very like the BSD audio mixer (mixerctl). The graphical mixer is called {{Codeline|ossxmix}} and will require {{Package Official|gtk2}} to be installed.<br />
<br />
The basic <tt>ossxmix</tt> controls:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# One tab for each sound card<br />
# The vmix (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.<br />
# These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.<br />
# Application vmix mixer controls and sound meters. If the application isn't actively playing a sound it will be labeled pcm08, pcm09..., when the application is playing the application name will be shown.<br />
<br />
=== Color Definitions ===<br />
<br />
For high definition (HD) audio, {{Codeline|ossxmix}} will color jack configurations by their pre-defined jack colors:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
=== Saving Mixer Levels ===<br />
<br />
Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, as root:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} can be used to write mixer levels to a file with the {{Codeline|-f}} switch and restore by the {{Codeline|-L}} switch.<br />
<br />
=== Other Mixers ===<br />
<br />
Other mixers that have support for OSS:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS support is being developed.<br />
<br />
==Configuring Applications for OSS==<br />
<br />
===Skype===<br />
<br />
The <tt>skype</tt> package only includes support for ALSA. To get an OSS-capable Skype, install the <tt>skype-oss</tt> package:<br />
<br />
# pacman -S skype-oss<br />
<br />
If you are using x86_64, you can get the [http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss] package from AUR.<br />
<br />
===Wine===<br />
<br />
* Run <tt>winecfg</tt>.<br />
<br />
$ winecfg<br />
<br />
* Go to the <tt>Audio</tt> tab.<br />
<br />
* Select <tt>OSS Driver</tt>.<br />
<br />
===Gajim===<br />
By default Gajim uses {{Codeline|aplay -q}} to play a sound. To change this go in Advanced Settings and search for the {{Codeline|soundplayer}} variable. The ossplay program included in the oss package is a good replacement: {{Codeline|ossplay -qq}}<br />
<br />
===MOC===<br />
<br />
To use MOC with OSS v4.1 you must change OSSMixerDevice to {{Filename|/dev/ossmix}} in your config (located in {{Filename|"$HOME"/.moc}}).<br />
And now MOC should work with OSS v4.1.<br />
Or you can compile moc-svn package from AUR (it has support for the new vmix).<br />
For issues with the interface try changing the OSSMixerChannel; press 'w' in mocp (change to sofware mixer).<br />
<br />
===Applications that use Gstreamer===<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
{{Note|For some applications (e.g. Rhythmbox, Totem) the gstreamer-properties have no effect, as they rely on "musicaudiosink" instead of "audiosink" (which is modified by gstreamer-properties). Workaround: Set audiosink with gstreamer-properties and use gconf-editor to copy the value of "/system/gstreamer/0.10/default/audiosink" to "musicaudiosink" (at the same location) }}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
===Firefox >=3.5===<br />
<br />
Firefox 3.5 introduces the <video> and <audio> tag support and can play ogg media out of the box. However, it currently can't be compiled with ALSA and OSS support at the same time. So you need to install the xulrunner-oss package from [community].<br />
<br />
1. Stop firefox.<br />
2. Install xulrunner-oss package from [community].<br />
3. Start firefox.<br />
<br />
===Mplayer===<br />
<br />
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: {{Codeline|mplayer -ao oss /some/file/to/play.mkv}} If you don't want to bother typing it over and over again add "ao=oss" to your config file. ({{Filename|"$HOME"/.mplayer/config}})<br />
<br />
===Music Player Daemon===<br />
<br />
MPD is configured through /etc/mpd.conf or ~/.mpdconf. Check both of these files, looking for something that looks like:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
If you find an uncommented (the lines do not begin with #'s) ALSA configuration like the one above, comment all of it out, or delete it, and add the following:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|I had to put this configuration in my ~/.mpdconf for it to work properly, but it ought to work in /etc/mpd.conf as well.}}<br />
Further configuration might not be necessary for all users. However, if you experience issues (in that MPD doesn't work properly after it's been restarted), or if you like having specific (i.e. more user-configured, less auto-configured) config files, the audio output for OSS can be more specifically configured as follows: First, run:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
Look for the line that says something similar to {{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}. Take note of what your <SOME_CARD_IDENTIFIER> is, and add bolded lines to your OSS audio output in your mpd config file:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
===Other applications===<br />
<br />
* If you can't get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.<br />
* Search OSS specific packages by using {{Codeline|pacman -Ss -- -oss}} and [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| in AUR].<br />
<br />
==Troubleshooting==<br />
<br />
===Troubleshooting HDAudio devices===<br />
<br />
====Understanding why problems arise====<br />
<br />
If you have a HDAudio sound device, it's very likely that you will have to adjust some mixer settings before your sound works.<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.<br />
<br />
However, there is a side effect, mainly because the HDAudio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.<br />
<br />
Then, when using HDAudio devices, you often find disorganized mixer controls, that doesn't work at all by default, and you are forced to try every mixer control combination, until it works.<br />
<br />
====How to solve====<br />
<br />
Open <tt>ossxmix</tt> and try to change every mixer control in the ''middle area'', that contains the sound card specific controls, as explained in the previous "[[OSS#Volume Control|Volume Control]]" section.<br />
<br />
You'll probably want to setup a program to record/play continously in the background (e.g. {{Codeline|ossrecord - | ossplay -}} for recording or {{Codeline|osstest -lV}} for playing), while changing mixer settings in ossxmix in the foreground.<br />
<br />
* Raise every volume control slider.<br />
* In each option box, try to change the selected option, trying all the possible combinations.<br />
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.<br />
<br />
Please note again that you do '''not''' need to change any controls in the ''top area'' nor in the ''bottom area'', as they are virtual <tt>vmix</tt>-related mixer controls.<br />
<br />
* Editing {{Filename|/usr/lib/oss/conf/oss_hdaudio.conf}} uncommenting and changing ''hdaudio_noskip=0'' to a value from 0-7 can give you more jack options in ossxmix<br />
I had to edit mine to ''hdaudio_noskip=7'' for my sub/rear speaker to work on my laptop, restart oss for the changes to take effect {{Codeline|/etc/rc.d/oss restart}}<br />
<br />
===MMS sound cracking in totem===<br />
If your stream sounds with cracks or strange noise in totem like it did with me then you could try to play it with another backend like ffmpeg (mplayer). That "fixed" the issue for me. This will not fix the issue that somehow pops up in gstreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in mplayer is simple:<br />
# mplayer mmsh://yourstreamurl<br />
<br />
===Microphone playing through output channels===<br />
<br />
OSS by default plays back the microphone through the speakers. To disable this in ossxmix find the misc section. Check off every "input-mix-mute" to disable this.<br />
<br />
===Troubleshooting other issues===<br />
<br />
* If you get distorted sound, try lowering some volume control sliders.<br />
<br />
* If you need to change the default sound card, look at [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].<br />
<br />
* If you have another issues, try searching or asking for help at the [http://www.4front-tech.com/forum 4front forums].<br />
<br />
==Tips and tricks==<br />
<br />
===Using multimedia keys with OSS===<br />
An easy way to mute/unmute and increase/decrease the volume is to use the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} script] available in [[AUR]].<br />
<br />
Once you installed it try to toggle the sound:<br />
$ ossvol -t<br />
<br />
Type {{Codeline|ossvol -h}} for the other commands.<br />
<br />
If you don't know how to assign commands to your multimedia keys, see [[Extra Keyboard Keys]].<br />
<br />
==={{Codeline|ossvol}} troubleshooting===<br />
If you get an error like:<br />
Bad mixer control name(987) 'vol'<br />
you need to edit the script ({{Filename|/usr/bin/ossvol}}) and change the value of the {{Codeline|CHANNEL}} variable which is at the beginning of the script. For example mine is {{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.<br />
<br />
*'''Note''' if you are using xbindkeys for your multimedia keys adding this<br />
<br />
"if ossmix misc.speaker-mute|grep OFF;then ossmix misc.speaker-mute on;else ossmix misc.speaker-mute off;fi;"<br />
toggle the sound<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume<br />
<br />
===Changing the Sample Rate===<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
===Changing the Default Sound Output===<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
===Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB===<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
===A simple systray applet===<br />
Want a applet to control volume like in GNOME? From [http://bbs.archlinux.org/viewtopic.php?id=77440 here] I got a usable [http://pastebin.furver.se/0xflchkfz/ one]. <br />
<br />
Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt this] script and rename whatever you want, e.g.: ossvolctl. run the following command:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
===Start ossxmix docked to systray on startup===<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
===Record sound output from a program===<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
===Suspend and Hibernation===<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
===ALSA emulation===<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
====Instructions====<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
===Settings for specific driver===<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
==Experimental packages==<br />
<br />
===Mercurial repository version===<br />
<br />
There is a [http://aur.archlinux.org/packages.php?ID=21126 oss-mercurial package] in AUR. This package compiles and installs the latest OSS development version direcly from the Mercurial repository.<br />
<br />
You can try this package if you want to contribute code to OSS or if only a very recent change in OSS code introduced support to your sound device.<br />
<br />
If you want oss to take care of your flash sound (as well as the sound in Adobe-Air applications) you will need to install libflashsupport:<br />
<br />
# pacman -S libflashsupport</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System&diff=137287Open Sound System2011-04-14T10:27:15Z<p>Ly50247: /* {{Codeline|ossvol}} troubleshooting */</p>
<hr />
<div>[[Category:Sound (English)]]<br />
[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|OSS}}<br />
<br />
This article will show you how to install and configure the '''O'''pen '''S'''ound '''S'''ystem (OSS) on you computer.<br />
<br />
The [http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] is an alternative sound architecture for Unix-like and POSIX-compatible systems. OSS version 3 was the original sound system for Linux and is in the kernel but was superceded by ALSA in 2002 when OSS version 4 became proprietary software. OSSv4 became free software again in 2007 when [http://www.opensound.com/ 4Front Technologies] released its source code and provided it under the GPL license.<br />
<br />
== Comparisons with ALSA ==<br />
<br />
Some advantages and disadvantages compared to using the Advanced Linux Sound Architecture.<br />
<br />
=== OSS Advantages (users) ===<br />
<br />
* Control for each application sound volume.<br />
* Some legacy cards are supported better (e.g. Creative X-Fi).<br />
* Initial response time in sound applications is usually better.<br />
* Better support for applications that use the OSS API. Many applications still use this API, and do not require an emulation layer like ALSA uses.<br />
<br />
=== OSS Advantages (developers) ===<br />
<br />
* Cleaner and easier to use API, and better API [http://manuals.opensound.com/developer documentation].<br />
* Support for drivers in userspace.<br />
* Accesibility. OSS runs on BSDs and Solaris.<br />
* Portability. OSS is [http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf easier] to port to other operating systems.<br />
<br />
=== ALSA Advantages ===<br />
<br />
* Better support for USB audio devices. With OSS output is experimental, input is not implemented.<br />
* Support for Bluetooth audio devices.<br />
* Support for AC'97 and HDAudio dial-up soft-modems such as Si3055.<br />
* Better support for MIDI devices. With OSS you'll have to use a software synthesizer such as Timidity or Fluidsynth.<br />
* Support for suspend. OSS and associated programs will need to be closed first.<br />
* Better support for jack detection. On some HD motherboards users will need to turn down the speaker volume when plugging in their earphones.<br />
<br />
== Install ==<br />
<br />
Install OSS by running:<br />
<br />
# pacman -S oss<br />
<br />
This will install the OSS files and run the OSS install script that will temporarily disable the ALSA modules, and install the OSS kernel modules. Since ALSA is enabled by default in the boot scripts, you need to disable it for it not to conflict with OSS when booting. You can do this by editing {{Filename|rc.conf}} and adding:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
Then add OSS to the daemon array:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
If your user is not part of the audio group, add your user by:<br />
<br />
# gpasswd -a username audio<br />
<br />
Then start OSS by:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
In the case OSS is not able to detect your card when starting it, run:<br />
<br />
# ossdetect -v<br />
<br />
Then {{Codeline|soundoff && soundon}} to reactivate it.<br />
<br />
== Testing ==<br />
<br />
Beware the default volume is very loud, avoid using earphones and physically lower the volume of your speakers (if possible) before running the test.<br />
<br />
'''Test OSS by running:'''<br />
<br />
$ osstest<br />
<br />
You should be able to hear music during the test process. If there is no audio, try to adjust the volume or refer to the troubleshooting section.<br />
<br />
If you want to hear sounds from more than one application simultaneously, you need vmix, OSS's software mixer. <br />
<br />
'''Check that vmix is enabled by running:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
You should see a line like 'vmix0-enable ON|OFF (currently ON)'. If you don't see any lines beginning with 'vmix', it probably means that vmix hasn't been attached to your sound device. To attach vmix, issue the command<br />
<br />
$ vmixctl attach device<br />
<br />
where ''device'' is your sound device, eg., /dev/oss/oss_envy240/pcm0 .<br />
<br />
To avoid having to issue this command manually in the future, you can add it to /usr/lib/oss/soundon.user, as suggested at http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output .<br />
<br />
If you get "Device or resource busy" error, you need to add "vmix_no_autoattach=1" in /usr/lib/oss/conf/osscore.conf, and then reboot. <br />
<br />
'''See which devices are detected by running:'''<br />
<br />
$ ossinfo<br />
<br />
You should be able to see your devices listed under Device objects or Audio Devices. If the device that you want to use is not at the top on Audio devices or Device objects sections, /usr/lib/oss/etc/installed_drivers needs to be edited. The driver for the device that needs to be used should be at the very top. A soundoff, soundon is probably required. If this does not work, comment all drivers listed that are not your preferred device.<br />
<br />
== Volume Control ==<br />
<br />
To control the volume of various devices, mixers levels will need to be set. The command line mixer is called {{Codeline|ossmix}}. It's very like the BSD audio mixer (mixerctl). The graphical mixer is called {{Codeline|ossxmix}} and will require {{Package Official|gtk2}} to be installed.<br />
<br />
The basic <tt>ossxmix</tt> controls:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# One tab for each sound card<br />
# The vmix (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.<br />
# These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.<br />
# Application vmix mixer controls and sound meters. If the application isn't actively playing a sound it will be labeled pcm08, pcm09..., when the application is playing the application name will be shown.<br />
<br />
=== Color Definitions ===<br />
<br />
For high definition (HD) audio, {{Codeline|ossxmix}} will color jack configurations by their pre-defined jack colors:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
=== Saving Mixer Levels ===<br />
<br />
Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, as root:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} can be used to write mixer levels to a file with the {{Codeline|-f}} switch and restore by the {{Codeline|-L}} switch.<br />
<br />
=== Other Mixers ===<br />
<br />
Other mixers that have support for OSS:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS support is being developed.<br />
<br />
==Configuring Applications for OSS==<br />
<br />
===Skype===<br />
<br />
The <tt>skype</tt> package only includes support for ALSA. To get an OSS-capable Skype, install the <tt>skype-oss</tt> package:<br />
<br />
# pacman -S skype-oss<br />
<br />
If you are using x86_64, you can get the [http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss] package from AUR.<br />
<br />
===Wine===<br />
<br />
* Run <tt>winecfg</tt>.<br />
<br />
$ winecfg<br />
<br />
* Go to the <tt>Audio</tt> tab.<br />
<br />
* Select <tt>OSS Driver</tt>.<br />
<br />
===Gajim===<br />
By default Gajim uses {{Codeline|aplay -q}} to play a sound. To change this go in Advanced Settings and search for the {{Codeline|soundplayer}} variable. The ossplay program included in the oss package is a good replacement: {{Codeline|ossplay -qq}}<br />
<br />
===MOC===<br />
<br />
To use MOC with OSS v4.1 you must change OSSMixerDevice to {{Filename|/dev/ossmix}} in your config (located in {{Filename|"$HOME"/.moc}}).<br />
And now MOC should work with OSS v4.1.<br />
Or you can compile moc-svn package from AUR (it has support for the new vmix).<br />
For issues with the interface try changing the OSSMixerChannel; press 'w' in mocp (change to sofware mixer).<br />
<br />
===Applications that use Gstreamer===<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
{{Note|For some applications (e.g. Rhythmbox, Totem) the gstreamer-properties have no effect, as they rely on "musicaudiosink" instead of "audiosink" (which is modified by gstreamer-properties). Workaround: Set audiosink with gstreamer-properties and use gconf-editor to copy the value of "/system/gstreamer/0.10/default/audiosink" to "musicaudiosink" (at the same location) }}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
===Firefox >=3.5===<br />
<br />
Firefox 3.5 introduces the <video> and <audio> tag support and can play ogg media out of the box. However, it currently can't be compiled with ALSA and OSS support at the same time. So you need to install the xulrunner-oss package from [community].<br />
<br />
1. Stop firefox.<br />
2. Install xulrunner-oss package from [community].<br />
3. Start firefox.<br />
<br />
===Mplayer===<br />
<br />
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: {{Codeline|mplayer -ao oss /some/file/to/play.mkv}} If you don't want to bother typing it over and over again add "ao=oss" to your config file. ({{Filename|"$HOME"/.mplayer/config}})<br />
<br />
===Music Player Daemon===<br />
<br />
MPD is configured through /etc/mpd.conf or ~/.mpdconf. Check both of these files, looking for something that looks like:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
If you find an uncommented (the lines do not begin with #'s) ALSA configuration like the one above, comment all of it out, or delete it, and add the following:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|I had to put this configuration in my ~/.mpdconf for it to work properly, but it ought to work in /etc/mpd.conf as well.}}<br />
Further configuration might not be necessary for all users. However, if you experience issues (in that MPD doesn't work properly after it's been restarted), or if you like having specific (i.e. more user-configured, less auto-configured) config files, the audio output for OSS can be more specifically configured as follows: First, run:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
Look for the line that says something similar to {{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}. Take note of what your <SOME_CARD_IDENTIFIER> is, and add bolded lines to your OSS audio output in your mpd config file:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
===Other applications===<br />
<br />
* If you can't get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.<br />
* Search OSS specific packages by using {{Codeline|pacman -Ss -- -oss}} and [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| in AUR].<br />
<br />
==Troubleshooting==<br />
<br />
===Troubleshooting HDAudio devices===<br />
<br />
====Understanding why problems arise====<br />
<br />
If you have a HDAudio sound device, it's very likely that you will have to adjust some mixer settings before your sound works.<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.<br />
<br />
However, there is a side effect, mainly because the HDAudio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.<br />
<br />
Then, when using HDAudio devices, you often find disorganized mixer controls, that doesn't work at all by default, and you are forced to try every mixer control combination, until it works.<br />
<br />
====How to solve====<br />
<br />
Open <tt>ossxmix</tt> and try to change every mixer control in the ''middle area'', that contains the sound card specific controls, as explained in the previous "[[OSS#Volume Control|Volume Control]]" section.<br />
<br />
You'll probably want to setup a program to record/play continously in the background (e.g. {{Codeline|ossrecord - | ossplay -}} for recording or {{Codeline|osstest -lV}} for playing), while changing mixer settings in ossxmix in the foreground.<br />
<br />
* Raise every volume control slider.<br />
* In each option box, try to change the selected option, trying all the possible combinations.<br />
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.<br />
<br />
Please note again that you do '''not''' need to change any controls in the ''top area'' nor in the ''bottom area'', as they are virtual <tt>vmix</tt>-related mixer controls.<br />
<br />
* Editing {{Filename|/usr/lib/oss/conf/oss_hdaudio.conf}} uncommenting and changing ''hdaudio_noskip=0'' to a value from 0-7 can give you more jack options in ossxmix<br />
I had to edit mine to ''hdaudio_noskip=7'' for my sub/rear speaker to work on my laptop, restart oss for the changes to take effect {{Codeline|/etc/rc.d/oss restart}}<br />
<br />
===MMS sound cracking in totem===<br />
If your stream sounds with cracks or strange noise in totem like it did with me then you could try to play it with another backend like ffmpeg (mplayer). That "fixed" the issue for me. This will not fix the issue that somehow pops up in gstreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in mplayer is simple:<br />
# mplayer mmsh://yourstreamurl<br />
<br />
===Microphone playing through output channels===<br />
<br />
OSS by default plays back the microphone through the speakers. To disable this in ossxmix find the misc section. Check off every "input-mix-mute" to disable this.<br />
<br />
===Troubleshooting other issues===<br />
<br />
* If you get distorted sound, try lowering some volume control sliders.<br />
<br />
* If you need to change the default sound card, look at [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].<br />
<br />
* If you have another issues, try searching or asking for help at the [http://www.4front-tech.com/forum 4front forums].<br />
<br />
==Tips and tricks==<br />
<br />
===Using multimedia keys with OSS===<br />
An easy way to mute/unmute and increase/decrease the volume is to use the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} script] available in [[AUR]].<br />
<br />
Once you installed it try to toggle the sound:<br />
$ ossvol -t<br />
<br />
Type {{Codeline|ossvol -h}} for the other commands.<br />
<br />
If you don't know how to assign commands to your multimedia keys, see [[Extra Keyboard Keys]].<br />
<br />
==={{Codeline|ossvol}} troubleshooting===<br />
If you get an error like:<br />
Bad mixer control name(987) 'vol'<br />
you need to edit the script ({{Filename|/usr/bin/ossvol}}) and change the value of the {{Codeline|CHANNEL}} variable which is at the beginning of the script. For example mine is {{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.<br />
<br />
*'''Note''' if you are using xbindkeys for your multimedia keys adding this<br />
<br />
"if ossmix misc.speaker-mute|grep OFF;then ossmix misc.speaker-mute on;else ossmix misc.speaker-mute off;fi;<br />
toggle the sound<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume<br />
<br />
===Changing the Sample Rate===<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
===Changing the Default Sound Output===<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
===Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB===<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
===A simple systray applet===<br />
Want a applet to control volume like in GNOME? From [http://bbs.archlinux.org/viewtopic.php?id=77440 here] I got a usable [http://pastebin.furver.se/0xflchkfz/ one]. <br />
<br />
Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt this] script and rename whatever you want, e.g.: ossvolctl. run the following command:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
===Start ossxmix docked to systray on startup===<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
===Record sound output from a program===<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
===Suspend and Hibernation===<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
===ALSA emulation===<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
====Instructions====<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
===Settings for specific driver===<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
==Experimental packages==<br />
<br />
===Mercurial repository version===<br />
<br />
There is a [http://aur.archlinux.org/packages.php?ID=21126 oss-mercurial package] in AUR. This package compiles and installs the latest OSS development version direcly from the Mercurial repository.<br />
<br />
You can try this package if you want to contribute code to OSS or if only a very recent change in OSS code introduced support to your sound device.<br />
<br />
If you want oss to take care of your flash sound (as well as the sound in Adobe-Air applications) you will need to install libflashsupport:<br />
<br />
# pacman -S libflashsupport</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System&diff=137286Open Sound System2011-04-14T10:26:45Z<p>Ly50247: /* {{Codeline|ossvol}} troubleshooting */</p>
<hr />
<div>[[Category:Sound (English)]]<br />
[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|OSS}}<br />
<br />
This article will show you how to install and configure the '''O'''pen '''S'''ound '''S'''ystem (OSS) on you computer.<br />
<br />
The [http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] is an alternative sound architecture for Unix-like and POSIX-compatible systems. OSS version 3 was the original sound system for Linux and is in the kernel but was superceded by ALSA in 2002 when OSS version 4 became proprietary software. OSSv4 became free software again in 2007 when [http://www.opensound.com/ 4Front Technologies] released its source code and provided it under the GPL license.<br />
<br />
== Comparisons with ALSA ==<br />
<br />
Some advantages and disadvantages compared to using the Advanced Linux Sound Architecture.<br />
<br />
=== OSS Advantages (users) ===<br />
<br />
* Control for each application sound volume.<br />
* Some legacy cards are supported better (e.g. Creative X-Fi).<br />
* Initial response time in sound applications is usually better.<br />
* Better support for applications that use the OSS API. Many applications still use this API, and do not require an emulation layer like ALSA uses.<br />
<br />
=== OSS Advantages (developers) ===<br />
<br />
* Cleaner and easier to use API, and better API [http://manuals.opensound.com/developer documentation].<br />
* Support for drivers in userspace.<br />
* Accesibility. OSS runs on BSDs and Solaris.<br />
* Portability. OSS is [http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf easier] to port to other operating systems.<br />
<br />
=== ALSA Advantages ===<br />
<br />
* Better support for USB audio devices. With OSS output is experimental, input is not implemented.<br />
* Support for Bluetooth audio devices.<br />
* Support for AC'97 and HDAudio dial-up soft-modems such as Si3055.<br />
* Better support for MIDI devices. With OSS you'll have to use a software synthesizer such as Timidity or Fluidsynth.<br />
* Support for suspend. OSS and associated programs will need to be closed first.<br />
* Better support for jack detection. On some HD motherboards users will need to turn down the speaker volume when plugging in their earphones.<br />
<br />
== Install ==<br />
<br />
Install OSS by running:<br />
<br />
# pacman -S oss<br />
<br />
This will install the OSS files and run the OSS install script that will temporarily disable the ALSA modules, and install the OSS kernel modules. Since ALSA is enabled by default in the boot scripts, you need to disable it for it not to conflict with OSS when booting. You can do this by editing {{Filename|rc.conf}} and adding:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
Then add OSS to the daemon array:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
If your user is not part of the audio group, add your user by:<br />
<br />
# gpasswd -a username audio<br />
<br />
Then start OSS by:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
In the case OSS is not able to detect your card when starting it, run:<br />
<br />
# ossdetect -v<br />
<br />
Then {{Codeline|soundoff && soundon}} to reactivate it.<br />
<br />
== Testing ==<br />
<br />
Beware the default volume is very loud, avoid using earphones and physically lower the volume of your speakers (if possible) before running the test.<br />
<br />
'''Test OSS by running:'''<br />
<br />
$ osstest<br />
<br />
You should be able to hear music during the test process. If there is no audio, try to adjust the volume or refer to the troubleshooting section.<br />
<br />
If you want to hear sounds from more than one application simultaneously, you need vmix, OSS's software mixer. <br />
<br />
'''Check that vmix is enabled by running:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
You should see a line like 'vmix0-enable ON|OFF (currently ON)'. If you don't see any lines beginning with 'vmix', it probably means that vmix hasn't been attached to your sound device. To attach vmix, issue the command<br />
<br />
$ vmixctl attach device<br />
<br />
where ''device'' is your sound device, eg., /dev/oss/oss_envy240/pcm0 .<br />
<br />
To avoid having to issue this command manually in the future, you can add it to /usr/lib/oss/soundon.user, as suggested at http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output .<br />
<br />
If you get "Device or resource busy" error, you need to add "vmix_no_autoattach=1" in /usr/lib/oss/conf/osscore.conf, and then reboot. <br />
<br />
'''See which devices are detected by running:'''<br />
<br />
$ ossinfo<br />
<br />
You should be able to see your devices listed under Device objects or Audio Devices. If the device that you want to use is not at the top on Audio devices or Device objects sections, /usr/lib/oss/etc/installed_drivers needs to be edited. The driver for the device that needs to be used should be at the very top. A soundoff, soundon is probably required. If this does not work, comment all drivers listed that are not your preferred device.<br />
<br />
== Volume Control ==<br />
<br />
To control the volume of various devices, mixers levels will need to be set. The command line mixer is called {{Codeline|ossmix}}. It's very like the BSD audio mixer (mixerctl). The graphical mixer is called {{Codeline|ossxmix}} and will require {{Package Official|gtk2}} to be installed.<br />
<br />
The basic <tt>ossxmix</tt> controls:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# One tab for each sound card<br />
# The vmix (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.<br />
# These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.<br />
# Application vmix mixer controls and sound meters. If the application isn't actively playing a sound it will be labeled pcm08, pcm09..., when the application is playing the application name will be shown.<br />
<br />
=== Color Definitions ===<br />
<br />
For high definition (HD) audio, {{Codeline|ossxmix}} will color jack configurations by their pre-defined jack colors:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
=== Saving Mixer Levels ===<br />
<br />
Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, as root:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} can be used to write mixer levels to a file with the {{Codeline|-f}} switch and restore by the {{Codeline|-L}} switch.<br />
<br />
=== Other Mixers ===<br />
<br />
Other mixers that have support for OSS:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS support is being developed.<br />
<br />
==Configuring Applications for OSS==<br />
<br />
===Skype===<br />
<br />
The <tt>skype</tt> package only includes support for ALSA. To get an OSS-capable Skype, install the <tt>skype-oss</tt> package:<br />
<br />
# pacman -S skype-oss<br />
<br />
If you are using x86_64, you can get the [http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss] package from AUR.<br />
<br />
===Wine===<br />
<br />
* Run <tt>winecfg</tt>.<br />
<br />
$ winecfg<br />
<br />
* Go to the <tt>Audio</tt> tab.<br />
<br />
* Select <tt>OSS Driver</tt>.<br />
<br />
===Gajim===<br />
By default Gajim uses {{Codeline|aplay -q}} to play a sound. To change this go in Advanced Settings and search for the {{Codeline|soundplayer}} variable. The ossplay program included in the oss package is a good replacement: {{Codeline|ossplay -qq}}<br />
<br />
===MOC===<br />
<br />
To use MOC with OSS v4.1 you must change OSSMixerDevice to {{Filename|/dev/ossmix}} in your config (located in {{Filename|"$HOME"/.moc}}).<br />
And now MOC should work with OSS v4.1.<br />
Or you can compile moc-svn package from AUR (it has support for the new vmix).<br />
For issues with the interface try changing the OSSMixerChannel; press 'w' in mocp (change to sofware mixer).<br />
<br />
===Applications that use Gstreamer===<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
{{Note|For some applications (e.g. Rhythmbox, Totem) the gstreamer-properties have no effect, as they rely on "musicaudiosink" instead of "audiosink" (which is modified by gstreamer-properties). Workaround: Set audiosink with gstreamer-properties and use gconf-editor to copy the value of "/system/gstreamer/0.10/default/audiosink" to "musicaudiosink" (at the same location) }}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
===Firefox >=3.5===<br />
<br />
Firefox 3.5 introduces the <video> and <audio> tag support and can play ogg media out of the box. However, it currently can't be compiled with ALSA and OSS support at the same time. So you need to install the xulrunner-oss package from [community].<br />
<br />
1. Stop firefox.<br />
2. Install xulrunner-oss package from [community].<br />
3. Start firefox.<br />
<br />
===Mplayer===<br />
<br />
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: {{Codeline|mplayer -ao oss /some/file/to/play.mkv}} If you don't want to bother typing it over and over again add "ao=oss" to your config file. ({{Filename|"$HOME"/.mplayer/config}})<br />
<br />
===Music Player Daemon===<br />
<br />
MPD is configured through /etc/mpd.conf or ~/.mpdconf. Check both of these files, looking for something that looks like:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
If you find an uncommented (the lines do not begin with #'s) ALSA configuration like the one above, comment all of it out, or delete it, and add the following:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|I had to put this configuration in my ~/.mpdconf for it to work properly, but it ought to work in /etc/mpd.conf as well.}}<br />
Further configuration might not be necessary for all users. However, if you experience issues (in that MPD doesn't work properly after it's been restarted), or if you like having specific (i.e. more user-configured, less auto-configured) config files, the audio output for OSS can be more specifically configured as follows: First, run:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
Look for the line that says something similar to {{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}. Take note of what your <SOME_CARD_IDENTIFIER> is, and add bolded lines to your OSS audio output in your mpd config file:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
===Other applications===<br />
<br />
* If you can't get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.<br />
* Search OSS specific packages by using {{Codeline|pacman -Ss -- -oss}} and [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| in AUR].<br />
<br />
==Troubleshooting==<br />
<br />
===Troubleshooting HDAudio devices===<br />
<br />
====Understanding why problems arise====<br />
<br />
If you have a HDAudio sound device, it's very likely that you will have to adjust some mixer settings before your sound works.<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.<br />
<br />
However, there is a side effect, mainly because the HDAudio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.<br />
<br />
Then, when using HDAudio devices, you often find disorganized mixer controls, that doesn't work at all by default, and you are forced to try every mixer control combination, until it works.<br />
<br />
====How to solve====<br />
<br />
Open <tt>ossxmix</tt> and try to change every mixer control in the ''middle area'', that contains the sound card specific controls, as explained in the previous "[[OSS#Volume Control|Volume Control]]" section.<br />
<br />
You'll probably want to setup a program to record/play continously in the background (e.g. {{Codeline|ossrecord - | ossplay -}} for recording or {{Codeline|osstest -lV}} for playing), while changing mixer settings in ossxmix in the foreground.<br />
<br />
* Raise every volume control slider.<br />
* In each option box, try to change the selected option, trying all the possible combinations.<br />
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.<br />
<br />
Please note again that you do '''not''' need to change any controls in the ''top area'' nor in the ''bottom area'', as they are virtual <tt>vmix</tt>-related mixer controls.<br />
<br />
* Editing {{Filename|/usr/lib/oss/conf/oss_hdaudio.conf}} uncommenting and changing ''hdaudio_noskip=0'' to a value from 0-7 can give you more jack options in ossxmix<br />
I had to edit mine to ''hdaudio_noskip=7'' for my sub/rear speaker to work on my laptop, restart oss for the changes to take effect {{Codeline|/etc/rc.d/oss restart}}<br />
<br />
===MMS sound cracking in totem===<br />
If your stream sounds with cracks or strange noise in totem like it did with me then you could try to play it with another backend like ffmpeg (mplayer). That "fixed" the issue for me. This will not fix the issue that somehow pops up in gstreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in mplayer is simple:<br />
# mplayer mmsh://yourstreamurl<br />
<br />
===Microphone playing through output channels===<br />
<br />
OSS by default plays back the microphone through the speakers. To disable this in ossxmix find the misc section. Check off every "input-mix-mute" to disable this.<br />
<br />
===Troubleshooting other issues===<br />
<br />
* If you get distorted sound, try lowering some volume control sliders.<br />
<br />
* If you need to change the default sound card, look at [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].<br />
<br />
* If you have another issues, try searching or asking for help at the [http://www.4front-tech.com/forum 4front forums].<br />
<br />
==Tips and tricks==<br />
<br />
===Using multimedia keys with OSS===<br />
An easy way to mute/unmute and increase/decrease the volume is to use the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} script] available in [[AUR]].<br />
<br />
Once you installed it try to toggle the sound:<br />
$ ossvol -t<br />
<br />
Type {{Codeline|ossvol -h}} for the other commands.<br />
<br />
If you don't know how to assign commands to your multimedia keys, see [[Extra Keyboard Keys]].<br />
<br />
==={{Codeline|ossvol}} troubleshooting===<br />
If you get an error like:<br />
Bad mixer control name(987) 'vol'<br />
you need to edit the script ({{Filename|/usr/bin/ossvol}}) and change the value of the {{Codeline|CHANNEL}} variable which is at the beginning of the script. For example mine is {{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.<br />
<br />
*'''Note''' if you are using xbindkeys for your multimedia keys adding this<br />
<br />
if ossmix misc.speaker-mute|grep OFF;then ossmix misc.speaker-mute on;else ossmix misc.speaker-mute off;fi;<br />
toggle the sound<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume<br />
<br />
===Changing the Sample Rate===<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
===Changing the Default Sound Output===<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
===Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB===<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
===A simple systray applet===<br />
Want a applet to control volume like in GNOME? From [http://bbs.archlinux.org/viewtopic.php?id=77440 here] I got a usable [http://pastebin.furver.se/0xflchkfz/ one]. <br />
<br />
Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt this] script and rename whatever you want, e.g.: ossvolctl. run the following command:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
===Start ossxmix docked to systray on startup===<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
===Record sound output from a program===<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
===Suspend and Hibernation===<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
===ALSA emulation===<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
====Instructions====<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
===Settings for specific driver===<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
==Experimental packages==<br />
<br />
===Mercurial repository version===<br />
<br />
There is a [http://aur.archlinux.org/packages.php?ID=21126 oss-mercurial package] in AUR. This package compiles and installs the latest OSS development version direcly from the Mercurial repository.<br />
<br />
You can try this package if you want to contribute code to OSS or if only a very recent change in OSS code introduced support to your sound device.<br />
<br />
If you want oss to take care of your flash sound (as well as the sound in Adobe-Air applications) you will need to install libflashsupport:<br />
<br />
# pacman -S libflashsupport</div>Ly50247https://wiki.archlinux.org/index.php?title=List_of_applications&diff=137003List of applications2011-04-12T06:51:12Z<p>Ly50247: /* Graphics and Image Manipulation */</p>
<hr />
<div>[[Category:Other desktop user's resources (English)]] [[Category:General (English)]]<br />
{{i18n|Common Applications}}<br />
{{Article summary start}}<br />
{{Article summary text|Provides a list of common software that may be useful in day-to-day computer use, categorized by task.}}<br />
<!--{{Article summary heading|Languages}}--><br />
<!--{{i18n_entry|English|Common Applications}}--><br />
{{Article summary heading|Related}}<br />
{{Article summary text|[[Lightweight Applications]]}}<br />
{{Article summary end}}<br />
<br />
== Backup programs ==<br />
{{Box||See the article on this subject: [[Backup Programs]]|#E5E5FF|#FCFCFC}}<br />
<br />
* [[Wikipedia:DAR (Disk Archiver)|DAR]] - A full-featured command-line backup tool, short for Disk ARchive<br />
** Architecture(s): i686, x86_64<br />
** Repository: Community<br />
** Description: A full-featured command-line backup tool, short for Disk ARchive<br />
** Upstream URL: http://dar.linux.free.fr/<br />
** License: GPL<br />
** Package name: {{Package Official|dar}}<br />
<br />
* [[Wikipedia:Duplicity (software)|Duplicity]] - A utility for encrypted, bandwidth-efficient backups using the rsync algorithm<br />
** Architecture(s): i686, x86_64<br />
** Repository: Community<br />
** Description: A utility for encrypted, bandwidth-efficient backups using the rsync algorithm<br />
** Upstream URL: http://www.nongnu.org/duplicity/<br />
** License: GPL<br />
** Package name: {{Package Official|duplicity}}<br />
<br />
* Packrat - A simple, modular backup system that uses dar to take full/incremental backups of files and can store them locally, on a remote system via SSH, or on Amazon S3<br />
** Architecture(s): i686, x86_64<br />
** Repository: AUR<br />
** Description: A simple backup system with included modules for SSH, Amazon S3, and MySQL<br />
** Upstream URL: http://www.zeroflux.org/projects<br />
** License: MIT<br />
** Package name: {{Package AUR|packrat}}<br />
<br />
* [[wikipedia:Rsync#Variations|rdiff-backup]] - A utility for local/remote mirroring and incremental backups<br />
** Architecture(s): i686, x86_64<br />
** Repository: Community<br />
** Description: A utility for local/remote mirroring and incremental backups<br />
** Upstream URL: http://www.nongnu.org/rdiff-backup/<br />
** License: GPL<br />
** Package name: {{Package Official|rdiff-backup}}<br />
<br />
* rsnapshot - A remote filesystem snapshot utility<br />
** Architecture(s): i686, x86_64<br />
** Repository: Community<br />
** Description: A remote filesystem snapshot utility<br />
** Upstream URL: http://www.rsnapshot.org/<br />
** License: GPL<br />
** Package name: {{Package Official|rsnapshot}}<br />
<br />
* [[Rsync|rsync]] - A file transfer program to keep remote files in sync<br />
** Architecture(s): i686, x86_64<br />
** Repository: Extra<br />
** Description: A file transfer program to keep remote files in sync<br />
** Upstream URL: http://rsync.samba.org/<br />
** License: GPL3<br />
** Package name: {{Package Official|rsync}}<br />
<br />
* Safekeep - A client/server backup system which enhances the power of rdiff-backup<br />
** Architecture(s): i686, x86_64<br />
** Repository: AUR<br />
** Description: A client/server backup system which enhances the power of rdiff-backup<br />
** Upstream URL: http://safekeep.sourceforge.net/<br />
** License: GPL<br />
** Package name: {{Package AUR|safekeep}}<br />
<br />
== Internet ==<br />
===BitTorrent Clients===<br />
<!--Keep in sync with [[Lightweight Applications]] and use the App template.--><br />
{{Wikipedia|Comparison of BitTorrent clients}}<br />
*{{App|[[aria2]]|Command-line download manager that supports HTTP/HTTPS, FTP, BitTorrent and MetaLink protocols|http://aria2.sourceforge.net/|{{Package Official|aria2}}}}<br />
*{{App|[[Wikipedia:Deluge (software)|Deluge]]|User-friendly BitTorrent client written in Python and wrapped with PyGTK|http://deluge-torrent.org/|{{Package Official|deluge}}}}<br />
*{{App|[[Wikipedia:KTorrent|KTorrent]]|Feature-rich BitTorrent client developed using Qt|http://ktorrent.org/|{{Package Official|ktorrent}}}}<br />
*{{App|[[Wikipedia:MLDonkey|MLDonkey]]|Multi-protocol P2P client supporting BitTorrent|http://mldonkey.sourceforge.net/|{{Package Official|mldonkey}}}}<br />
*{{App|[[Wikipedia:QBittorrent|qBittorrent]]|The closest open source (GNU GPL v2 license) equivalent to µtorrent|http://qbittorrent.sourceforge.net/|{{Package Official|qbittorrent}}}}<br />
*{{App|[[Wikipedia:RTorrent|rTorrent]]|Simple and lightweight ncurses BitTorrent client|http://libtorrent.rakshasa.no/|{{Package Official|rtorrent}}}}<br />
*{{App|[[Wikipedia:Transmission (BitTorrent client)|Transmission]]|Simple and easy-to-use BitTorrent client with (GTK+) GUI and CLI front-ends|http://www.transmissionbt.com/|{{Package Official|transmission}}}}<br />
*{{App|[[Wikipedia:Vuze|Vuze]]|Feature-rich BitTorrent client written in Java (formerly Azureus)|http://www.vuze.com/|{{Package Official|vuze}}}}<br />
<br />
=== Chat Clients ===<br />
==== IRC Clients ====<br />
* {{App|[[Irssi]]|Highly-configurable ncurses-based IRC client|http://www.irssi.org/|{{Package Official|irssi}}}}<br />
* {{App|[[Wikipedia:Konversation|Konversation]]|Qt-based IRC client for the KDE4 desktop|http://konversation.kde.org/|{{Package Official|konversation}}}}<br />
* {{App|[[Wikipedia:KVIrc|KVIrc]]|Qt-based IRC client featuring extensive themes support|http://www.kvirc.net/|{{Package Official|kvirc}}}}<br />
* {{App|[[Wikipedia:WeeChat|WeeChat]]|Modular, lightweight ncurses-based IRC client|http://www.weechat.org/|{{Package Official|weechat}}}}<br />
* {{App|[[Wikipedia:XChat|XChat]]|GTK-based IRC client|http://xchat.org/|{{Package Official|xchat}}}}<br />
<br />
==== Jabber/XMPP Clients ====<br />
* {{App|Freetalk|A console based Jabber client|http://www.gnu.org/software/freetalk/|{{Package Official|freetalk}}}}<br />
* {{App|[[Wikipedia:Gajim|Gajim]]|Jabber client written in PyGTK|http://www.gajim.org/|{{Package Official|gajim}}}}<br />
* {{App|jabber.el|A minimal jabber client for emacs|http://emacs-jabber.sourceforge.net/|{{Package AUR|emacs-jabber}}}}<br />
* {{App|[[Wikipedia:MCabber|MCabber]]|A small Jabber console client, includes features: SSL, PGP, MUC, and UTF8|http://mcabber.com/|{{Package Official|mcabber}}}}<br />
* {{App|[[Wikipedia:Psi (instant messaging client)|Psi]]|A Qt based Jabber client|http://psi-im.org/|{{Package Official|psi}}}}<br />
* {{App|Psi+|Psi+ is an enhanced version of Psi Jabber client.|http://code.google.com/p/psi-dev/|{{Package AUR|psi-plus}}}}<br />
<br />
==== MSN Clients ====<br />
* {{App|[[Wikipedia:AMSN|aMSN]]|MSN client written in Tcl/Tk|http://www.amsn-project.net/|{{Package Official|amsn}}}}<br />
* {{App|[[Wikipedia:Emesene|Emesene]]|A pygtk MSN Messenger client|http://www.emesene.org/|{{Package Official|emesene}}}}<br />
* {{App|Galaxium Messenger|A multi-protocol instant messenger application designed for the GNOME desktop|http://code.google.com/p/galaxium/|{{Package AUR|galaxium}}}}<br />
* {{App|[[Wikipedia:Kmess|KMess]]|KMess is a MSN Messenger client for Linux|http://kmess.org/|{{Package Official|kmess}}}}<br />
* {{App|[[Wikipedia:Mercury Messenger|Mercury]]|Java Based MSN client|http://www.mercury.im/|{{Package Official|mercury}}}}<br />
<br />
==== Multi-Protocol Clients ====<br />
{{Wikipedia|Comparison of instant messaging clients}}<br />
<br />
* {{App|BarnOwl|A console chat client for the AIM, IRC, Jabber, and Zephyr protocols|http://barnowl.mit.edu/|{{Package AUR|barnowl}}}}<br />
* {{App|Carrier|Pidgin fork providing minor GUI enhancements (formerly funpidgin)|http://funpidgin.sourceforge.net/|{{Package AUR|carrier}}}}<br />
* {{App|[[Wikipedia:Centericq|CenterIM]]|Fork of CenterICQ - A text mode menu- and window-driven IM interface|http://www.centerim.org/index.php/Main_Page|{{Package Official|centerim}}}}<br />
* {{App|[[Wikipedia:Empathy (software)|Empathy]]|A GNOME instant messaging client using the Telepathy framework|http://live.gnome.org/Empathy|{{Package Official|empathy}}}}<br />
* {{App|Finch|A ncurses-based messaging client|http://pidgin.im/|{{Package Official|finch}}}}<br />
* {{App|[[Wikipedia:Kopete|Kopete]]|Instant Messenger|http://www.kde.org/|{{Package Official|kopete}}}}<br />
* {{App|[[Pidgin]]|Multi-protocol instant messaging client|http://pidgin.im/|{{Package Official|pidgin}}}}<br />
* {{App|[[Wikipedia:QutIM|qutIM]]|Multiplatform instant messenger|http://qutim.org/|{{Package AUR|qutim}}}}<br />
<br />
===Email clients===<br />
<!--Keep in sync with [[Lightweight Applications]] and use the App template.--><br />
{{Wikipedia|Comparison of e-mail clients}}<br />
====Console====<br />
*{{App|[[Alpine]]|The Apache-licensed PINE (a tool for reading, sending, and managing electronic messages)|http://www.washington.edu/alpine|{{Package Official|alpine}}}}<br />
*{{App|[[Wikipedia:Gnus|Gnus]]|mail, nntp, rss client for Emacs.|http://www.gnus.org/|[[package]]}}<br />
*{{App|[[Wikipedia:mailx|heirloom-mailx]]|A full-featured command-line MUA derived from Berkeley Mail.|http://heirloom.sourceforge.net/mailx.html|{{Package Official|mailx-heirloom}}}}<br />
*{{App|[[mutt]]|Small but very powerful text-based mail client.|http://www.mutt.org/|{{Package Official|mutt}}}}<br />
*{{App|[[Sup]]|A CLI mail client with very fast searching, tagging, threading and gmail like operation.|http://sup.rubyforge.org/|{{Package AUR|sup}}}}<br />
<br />
====X11====<br />
*{{App|[[Wikipedia:Claws Mail|Claws Mail]]|A GTK+ based e-mail client|http://www.claws-mail.org/|{{Package Official|claws-mail}}}}<br />
*{{App|[[Evolution]]|A mature and feature-rich e-mail client used in GNOME by default.|http://projects.gnome.org/evolution/|{{Package Official|evolution}}}}<br />
*{{App|[[Wikipedia:Gnus|Gnus]]|mail, nntp, rss client for Emacs.|http://www.gnus.org/|[[package]]}}<br />
*{{App|[[Wikipedia:Kmail|Kmail]]|A mature and feature-rich e-mail client part of the kde project.|http://kontact.kde.org/kmail/|{{Package Official|kmail}}}}<br />
*{{App|[[Wikipedia:Sylpheed|Sylpheed]]|Lightweight and user-friendly e-mail client (GTK)|http://sylpheed.sraoss.jp/en/|{{Package AUR|sylpheed}}}}<br />
*{{App|[[Thunderbird]]|Mozilla's GTK2-based client.|http://www.mozillamessaging.com/en-US/|{{Package Official|thunderbird}}}}<br />
<br />
===News Aggregators===<br />
* [[Akregator]] - KDE's news aggregator (in kdepim package)<br />
* [[Canto]] - A ncurses RSS aggregator http://codezen.org/canto/<br />
* [[Gnus]] - mail, nntp, rss client for Emacs.<br />
* [[Liferea]] - A GTK desktop news aggregator for online news feeds and weblogs http://liferea.sourceforge.net<br />
* [[Newsbeuter]] - A ncurses RSS aggregator with layout and keybinding similar to mutt. Does not use the traditional 3 panes setup.<br />
* [[Rawdog]] - An "RSS Aggregator Without Delusions Of Grandeur" that parses RSS/CDF/Atom feeds into a static HTML page of articles in date order http://offog.org/code/rawdog.html<br />
* [[Rssowl]] - A powerful java-based RSS reader http://boreal.rssowl.org<br />
* [[BlogBridge]] - Another excellent java-based aggregator http://www.blogbridge.com<br />
* [[Snownews]] - Text mode RSS newsreader.<br />
* [[Thunderbird]] - A mail client from Mozilla which also functions as a pretty nice news aggregator<br />
<br />
=== Web Browsers ===<br />
==== Graphical ====<br />
* [[Arora]] - Cross-platform open source web browser using the [http://webkit.org/ WebKit] rendering engine, built on top of Qt. http://www.arora-browser.org/<br />
* [[Chromium]] - The open-source project behind Google Chrome, a web browser developed by Google that uses the WebKit layout engine and application framework. http://code.google.com/chromium/<br />
* [[Dillo]] - A small, fast graphical web browser built on FLTK http://www.dillo.org/<br />
* [[Epiphany]] - The default GNOME browser, which uses the webkit rendering engine. http://projects.gnome.org/epiphany/<br />
* [[Firefox]] - [https://addons.mozilla.org/firefox/ Extensible] GTK2 browser based on Gecko with fast rendering. http://www.mozilla.com/firefox/<br />
* [[Kazehakase]] - A much lighter, but rather feature-lacking alternative to other browsers (GTK2 and Gecko). http://kazehakase.sourceforge.jp/<br />
* [[Konqueror]] - Qt- and KHTML-based browser. A part of the KDE desktop. http://www.konqueror.org/<br />
* [[Midori]] - Young but promising GTK2/WebKit browser, featherweight with very fast rendering http://www.twotoasts.de/index.php?/pages/midori_summary.html<br />
* [[Opera]] - Highly customizable browser with focuses on an adherence to web rendering standards http://www.opera.com/<br />
* [[uzbl]] - A lightweight webkit browser following the UNIX philosophy - to do one thing and do it well. http://www.uzbl.org/<br />
* [http://aur.archlinux.org/packages.php?ID=6524 Hv3] - A minimalist web browser based on tkhtml3 http://tkhtml.tcl.tk/hv3.html<br />
* [http://aur.archlinux.org/packages.php?O=0&K=vimprobable&do_Search=Go Vimprobable] - A webkit-based web browser which behaves like Vimperator, but without Firefox. http://www.vimprobable.org/<br />
* [http://aur.archlinux.org/packages.php?ID=38684 jumanji] - jumanji provides a minimalistic and space saving interface with vimperator-like keyboard-focused interaction http://pwmt.org/jumanji<br />
<br />
==== Text Based ====<br />
* [[Elinks]] - An advanced and well-established feature-rich text mode web browser. http://elinks.or.cz<br />
* [[links-g]] A text WWW browser, similar to Lynx, with framebuffer and X graphics enabled http://links.twibright.com/<br />
* [[Lynx]] A text browser for the World Wide Web http://lynx.isc.org<br />
* [[w3m]] A pager/text-based WWW browser http://w3m.sourceforge.net/<br />
<br />
=== Microblogging Clients ===<br />
* [[Hotot]] - Hotot, is a lightweight & open source Microblogging Client, coding using Python language and designed for Linux. http://hotot.org<br />
* [[Gwibber]] - Gwibber is an open source microblogging client for Linux. It brings the most popular social networking web services to your desktop and gives you the ability to control how you communicate. http://gwibber.com/<br />
* [[Pino]] - Pino is a simple and fast X11 client for Twitter and Identi.ca. It is compiled to native code, which assures small size and speed, and thanks to use of Vala language it can perfectly integrate into your Gnome or XFCE desktop. http://pino-app.appspot.com/<br />
<br />
== Document Indexers ==<br />
* [[pinot]] - Personal search and metasearch tool http://pinot.berlios.de/<br />
* [[recoll]] - Full text search tool based on Xapian backend http://www.lesbonscomptes.com/recoll/<br />
<br />
== Document Readers ==<br />
*[[ePDFView ]] - A free lightweight PDF document viewer using Poppler and GTK+ libraries. http://trac.emma-soft.com/epdfview/<br />
*[[Evince]] - Document viewer for multiple document formats. Supports pdf, postscript, djvu, tiff and dvi http://projects.gnome.org/evince/<br />
*[[Foxit Reader]] - A small, fast PDF viewer http://www.foxitsoftware.com/pdf/desklinux/<br />
*[[MuPDF]] - lightweight PDF viewer and toolkit written in portable C http://ccxvii.net/mupdf/<br />
*[[Okular]] - PDF viewer for KDE. http://okular.kde.org/<br />
*[[xpdf]] - A viewer for Portable Document Format (PDF) files http://www.foolabs.com/xpdf/<br />
*[[apvlv]] - apvlv is a PDF Viewer Under Linux and its behaviour like Vim. http://code.google.com/p/apvlv/<br />
<br />
== Multimedia ==<br />
=== Audio ===<br />
* [[Amarok]] - A mature Qt-based player known for its plethora of features<br />
* [http://ario-player.sourceforge.net/ Ario] - A GTK2 client for MPD (Music player daemon) inspired by Rhythmbox but much lighter and faster<br />
* [http://www.atunes.org/ aTunes] - An audio-player written in Java<br />
* [[Audacious]] - A Winamp clone like Beep and old XMMS versions<br />
* [http://banshee.fm/ Banshee] - yet another GTK2 iTunes clone, yet more feature-rich and more actively developed.<br />
* [http://www.clementine-player.org/ Clementine] - Amarok 1.4 ported to QT4<br />
* [http://cmus.sourceforge.net/ Cmus] is a very feature-rich ncurses-based music player.<br />
* [http://web.archive.org/web/20080221195932/http://mask.tf.hut.fi/~flu/cplay/ Cplay] is a curses front-end for various audio players.<br />
* [http://deadbeef.sourceforge.net/ DeaDBeeF] - Lightweight and powerful music player made with C and GTK2. [http://bbs.archlinux.org/viewtopic.php?id=96968]<br />
* [[Exaile]] - A GTK2 clone of Amarok<br />
* [[Goggles Music Manager]] - A lightweight music manager and player that automatically categorizes your music files.<br />
* [http://guayadeque.org/ Guayadeque] - A full featured media player that can easily manage large collections and uses the Gstreamer media framework.<br />
* [[Moc]] - A ncurses-based daemon/client style player, designed to be flexible and easy to use.<br />
* [[Music Player Daemon]] - Music player daemon, a lightweight and scalable choice for music management<br />
* [http://www.mpg123.org/ mpg123] - command line audio player.<br />
* [http://mpd.wikia.com/wiki/Client:Ncmpc ncmpc] - An ncurses-based front-end to mpd<br />
* [http://unkart.ovh.org/ncmpcpp/ ncmpcpp] - A clone of ncmpc with some new features written in C++<br />
* [http://www.luga.de/pytone/ PyTone] - An advanced music jukebox with a console interface<br />
* [http://code.google.com/p/quodlibet/ Quod Libet] - an audio player written with pygtk and gstreamer<br />
* [[Rhythmbox]] - A GTK2 clone of iTunes, used by default in GNOME<br />
* [http://sonata.berlios.de/ Sonata] - A pygtk-based client for mpd<br />
* [http://getnightingale.com/ Nightingale] - ([http://getsongbird.com/ Songbird] for linux) an open source clone of iTunes that uses Mozilla technologies as well as Gstreamer and is being developed by the team that made WinAMP<br />
* [http://legacy.xmms2.org/ XMMS] - A skinnable GTK+1 standalone media player similar to winamp<br />
<br />
==== Visualization ====<br />
* [http://projectm.sourceforge.net/ projectM]<br />
<br />
==== Editing ====<br />
* [http://audacity.sourceforge.net/ Audacity]<br />
<br />
=== Graphics and Image Manipulation ===<br />
* [[Blender]]<br />
* [[Dia]]<br />
* [[Gimp]]<br />
* [[imagemagick]]<br />
* [[graphicsmagick]]<br />
* [[Inkscape]]<br />
* [[Krita]]<br />
* [[mtpaint]]<br />
* [[Nathive]]<br />
* [[Shotwell]]<br />
* [[Xara]]<br />
* [[mypaint]]<br />
<br />
===Image Viewers===<br />
<!--Keep in sync with [[Lightweight Applications]] and use the App template.--><br />
{{Wikipedia|Comparison of image viewers}}<br />
*{{App|[[Feh]]|A fast, lightweight image viewer that uses imlib2|http://linuxbrit.co.uk/feh/|{{Package Official|feh}}}}<br />
*{{App|GpicView|A simple and fast image viewer for X. Made by the developers of [[LXDE]]|http://lxde.sourceforge.net/gpicview/|{{Package Official|gpicview}}}}<br />
*{{App|[[Wikipedia:GQview|GQview]]|An image browser that features single click access to view images and move around the directory tree|http://gqview.sourceforge.net/|{{Package Official|gqview}}}}<br />
*{{App|Geeqie|An image browser/viewer fork of GQview. Adds additional functionality such as support for RAW files|http://geeqie.sourceforge.net/|{{Package Official|geeqie}}}}<br />
*{{App|Mirage|PyGTK image viewer featuring support for crop and resize, custom actions and a thumbnail panel|http://mirageiv.berlios.de|{{Package Official|mirage}}}}<br />
*{{App|Ristretto|A fast and lightweight picture-viewer for the Xfce desktop environment|http://goodies.xfce.org/projects/applications/ristretto|{{Package Official|ristretto}}}}<br />
*{{App|QIV|A very small and fast gdk/Imlib image viewer|http://spiegl.de/qiv/|{{Package Official|qiv}}}}<br />
*{{App|Viewnior|Minimalistic GTK2 viewer featuring support for flip, rotate, animations and configurable mouse actions|http://xsisqox.github.com/Viewnior/about.html|{{Package Official|viewnior}}}}<br />
*{{App|Xloadimage|The classic X image viewer|http://web.archive.org/web/19981207030422/http://world.std.com/~jimf/xloadimage.html|{{Package Official|xloadimage}}}}<br />
*{{App|SXIV|Simple X Image Viewer; works well with tiling window managers, uses imlib2|http://github.com/muennich/sxiv|{{Package AUR|sxiv}}}}<br />
<!-- Broken links, need to be turned into App Templates.<br />
* [[Background Setter]]<br />
* [[eog]]<br />
* [[GQview]]<br />
* [[gThumb]]<br />
* [[Quick Image Viewer]]<br />
* [[XnView]]<br />
* [[xv]]<br />
* [[Picasa]]<br />
--><br />
<br />
=== Phone ===<br />
* [[moto4lin]]<br />
<br />
=== Video Players===<br />
* [[mplayer]]<br />
* [[Parole]] A modern media player based on the GStreamer framework http://goodies.xfce.org/projects/applications/parole/<br />
* [[SMPlayer]] is a complete frontend for [[MPlayer]].<br />
* [[VLC]] - A simple multi-platform media player, streamer, and encoder, that handles huge numbers of media formats.<br />
* [[Whaaw! Media Player]] is a lightweight Gstreamer-based audio/video player that can serve as a good alternative to Totem for those who don't like all those GNOME dependencies. http://home.gna.org/whaawmp/<br />
* [[Dragon player]] is a simple video player for KDE 4 developed by Ian Monroe. http://www.dragonplayer.net/<br />
<br />
=== Video Editors ===<br />
* http://www.pitivi.org/ {{Package AUR|pitivi}}<br />
* http://lives.sourceforge.net/ {{Package AUR|lives}}<br />
* http://www.openmovieeditor.org/ {{Package Official|openmovieeditor}}<br />
* http://www.openshotvideo.com/<br />
* http://www.avidemux.org/ {{Package Official|avidemux}}<br />
* http://kdenlive.org/ {{Package Official|kdenlive}}<br />
* http://www.kinodv.org/<br />
* http://cinelerra.org/ {{Package Official|cinelerra-cv}}<br />
<br />
== Note Taking Organizers ==<br />
* [http://aur.archlinux.org/packages.php?ID=19388 glista] with notes support [http://prematureoptimization.org/glista/downloads.php Home page]<br />
* [[hnb]] - A program to organize many kinds of data in one place [http://hnb.sourceforge.net/ Home page] [http://aur.archlinux.org/packages.php?ID=16630 Package]<br />
* [[NoteCase]] - A portable hierarchical note manager, coded in C++ using the GTK+ toolkit [http://notecase.sourceforge.net Home page]<br />
* [[Task]] - A command-line TODO list manager [http://www.beckingham.net/task.html Home page]<br />
* [[tomboy]] - Desktop note-taking application for Linux and Unix [http://www.gnome.org/projects/tomboy/ Home page]<br />
* [[zim]] - A WYSIWYG text editor that aims at bringing the concept of a wiki to the desktop [http://zim-wiki.org/ Home page]<br />
* [[Gnote]] - Gnote is an experimental port of Tomboy to C++ [http://live.gnome.org/Gnote Home page]<br />
* [[Cherrytree]] - A hierarchical note taking application [http://www.giuspen.com/cherrytree/ Home page]<br />
<br />
==Office suites==<br />
* [[Koffice]] - KOffice is a free, integrated office suite for KDE, the K Desktop Environment. http://www.koffice.org/<br />
* [[OpenOffice.org]] - An office suite http://www.OpenOffice.org/<br />
* [http://www.libreoffice.org LibreOffice] - A fork of OpenOffice.org, which integrates various patches<br />
<br />
==Word processors==<br />
*[[Abiword]] - A lightweight fast word processor http://www.abisource.com/<br />
*[[OpenOffice.org Writer]] - A full-featured word processor included in the OpenOffice.org suite<br />
*[http://www.archlinux.org/packages/community/i686/ted/ Ted] - An easy GTK-based rich text processor (with footnote support) http://www.nllgg.nl/Ted/<br />
<br />
== Spreadsheets ==<br />
* [[gnumeric]] - A GNOME Spreadsheet Program http://www.gnome.org/projects/gnumeric<br />
* [[OpenOffice.org Calc]] - A full-featured spreadsheet included in OpenOffice.org suite<br />
<br />
== Security ==<br />
* [[arpwatch]] - arpwatch and arpsnmp network monitoring tools ftp://ftp.ee.lbl.gov/<br />
* [[DenyHosts]] - a script to help thwart ssh server attacks http://denyhosts.sourceforge.net/<br />
* [[fail2ban]] - bans IP that makes too many password failures http://www.fail2ban.org/<br />
* [[Sshguard]] - Same as DenyHosts and fail2ban, only lighter, simpler and written in plain C http://www.sshguard.net/<br />
* [[etherape]] - A graphical network monitor for various OSI layers and protocols http://etherape.sourceforge.net/<br />
* [[iptraf]] - An IP network monitor http://iptraf.seul.org/<br />
* [[logwatch]] - Logwatch is a customizable log analysis system http://www.logwatch.org/<br />
* [[nessus]] - Vulnerability scanner http://www.nessus.org<br />
* [[nmap]] - A command line network exploration tool and security/port scanner http://nmap.org<br />
* [[ntop]] - A network traffic probe based on libcap http://ntop.org<br />
* [[portbunny]] - Extremly fast CLI portscanner http://www.recurity-labs.com/portbunny/index.shtml<br />
* [[snort]] - A lightweight network intrusion detection system http://www.snort.org<br />
* [[swatch]] - The active log file monitoring tool http://swatch.sourceforge.net/<br />
* [[tcpdump]] - A tool for network monitoring and data acquisition http://www.tcpdump.org<br />
* [[wireshark]] - A free network protocol analyzer for Unix/Linux and Windows http://www.wireshark.org/<br />
<br />
== Time Management ==<br />
* [[Calcurse]] - An ncurses calendar and task manager [http://culot.org/calcurse/ Home page]<br />
* [[Orage]] - A GTK+ calendar and task manager often seen integrated with Xfce [http://www.xfce.org/projects/orage/ Home page]<br />
* [[Osmo]] - A GTK+ personal organizer, which includes calendar, tasks manager and address book modules. [http://clayo.org/osmo/ Home page]<br />
* [http://aur.archlinux.org/packages.php?ID=21675 Rachota] - A portable time tracker for personal projects [http://rachota.sourceforge.net/en/ Home page]<br />
* [[Remind]] - A sophisticated calendar and alarm program [http://www.roaringpenguin.com/penguin/open_source_remind.php Home page]<br />
* [[Sunbird]] - The standalone Mozilla calendar application [http://www.mozilla.org/projects/calendar/sunbird/ Home page]<br />
* [[taskcoach]] - A simple open source todo manager to manage personal tasks and todo lists [http://taskcoach.sourceforge.net/ Home page] [http://aur.archlinux.org/packages.php?ID=6005 Package]<br />
* [[When]] - A simple command line personal calendar program [http://www.lightandmatter.com/when/when.html Home page]<br />
* [[Wyrd]] - A text-based front-end to Remind. [http://pessimization.com/software/wyrd/ Home page]<br />
<br />
==Translation and Localisation==<br />
* [[Lokalize]] - the standard [[KDE]] tool for software translation. Available in Extra. [http://userbase.kde.org/Lokalize Home page]<br />
* [[virtaal]] - an editor for translation of both software and other text, based on Translate Toolkit. [http://aur.archlinux.org/packages.php?ID=21709 Available in AUR]. [http://translate.sourceforge.net/wiki/virtaal/index Home page]<br />
** Supported formats: Gettext (.po and .mo), XLIFF (.xlf), TMX, TBX, WordFast TM (.txt), Qt Linguist (.ts), Qt Phrase Book (.qph), OmegaT glossary (.tab and .utf8), ...<br />
** Shows suggestions from [[Apertium]], Google Translate, Microsoft Translator, [[Moses]], http://open-tran.eu, Translation Memories or TM servers<br />
* [[poedit]] - a simple Gettext/po-file translation tool. Available in Community. [http://www.poedit.net/ Home page]<br />
* [[OmegaT]] - "the translation memory tool", a general translators tool which contains a lot of translation memory features<br />
** Supported formats: html, MS Office 2007 XML, OpenDocument format, XLIFF/Okapi, MediaWiki, plain text, TMX, ...<br />
** Shows suggestions from Google Translate<br />
* [[pology]] - a set of Python tools for dealing with Gettext/po-files. See the [http://techbase.kde.org/Localization/Tools/Pology#About home page] for simple installation instructions.<br />
** May be used to translate po-files with [[Apertium]], see http://wiki.apertium.org/wiki/Translating_gettext for instructions. <br />
* [[Apertium]] - a free and open source rule-based machine translation platform. All released language data is [http://aur.archlinux.org/packages.php?K=apertium available in AUR]. [http://apertium.org/ Home page]<br />
** Supported formats: html, MS Office 2007 XML, OpenDocument format, TMX, some MediaWiki support, ... (use [[Pology]] or [[Virtaal]] for po-files)<br />
** See [http://wiki.apertium.org/wiki/Main_Page the wiki] for supported languages<br />
* [[Moses]] - a statistical machine translation tool (language data not included). [http://www.statmt.org/moses/ Home page]<br />
<br />
== Utilities ==<br />
===Arch Package Management===<br />
<!--shouldn't duplicate info from [[AUR Helpers]]--><br />
* {{App|Aurnotify|A tool set to notify the status of your favorite packages from AUR.|To use the aurnotify desklet visit: http://adesklets.sourceforge.net/desklets.html|{{Package AUR|aurnotify}}}}<br />
* {{App|[http://wiki.archlinux.org/index.php/Pacman_Tips#Color_output Pacman-color]|Command-line frontend for libalpm aka pacman with color patch.|http://www.archlinux.org/pacman/|{{Package AUR|pacman-color}}}}<br />
* {{App|Pacman-contrib|Utilities for use with the pacman package manager.|http://www.archlinux.org/pacman/|{{Package Official|pacman-contrib}}}}<br />
* {{App|Pkgtools|A collection of scripts for Arch Linux packages.|Which includes '''pkgfile'''; find what package owns a file. [[http://bbs.archlinux.org/viewtopic.php?pid=384196 Forum topic]]|{{Package Official|pkgtools}}}}<br />
{{Warning|''Powerpill'' development has been officially discontinued: its latest version does not work with ''pacman>&#61;3.5''. See [https://bbs.archlinux.org/viewtopic.php?id&#61;115660].}}<br />
* [[Powerpill]] A wrapper for pacman that speeds up package retrieval by using aria2c for concurrent/segmented downloads. http://xyne.archlinux.ca/old_projects/powerpill<br />
* {{App|[http://wiki.archlinux.org/index.php/AUR_Helpers#slurpy Slurpy]|An AUR search/download/update helper in Python.|http://rsontech.net/projects/slurpy/|{{Package AUR|slurpy}}}}<br />
* {{App|[[TuPac]]|A cached pacman implementation that boosts some pacman operations: faster searches, AND searches, aur support, colored output, system sanity check, frontend friendly and more...|http://sourceforge.net/projects/tupac|{{Package AUR|tupac}}}} <br />
* {{App|[[Yaourt]]|A Pacman frontend with more features and AUR support.|http://www.archlinux.fr/yaourt-en/|{{Package AUR|yaourt}}}}<br />
<br />
Also see [[AUR Helpers]].<br />
<br />
=== Disk Usage Display Programs===<br />
* {{App|[[ncdu]]|A simple ncurses disk usage analyzer.|http://dev.yorhel.nl/ncdu|{{Package Official|ncdu}}}}<br />
* {{App|[[gt5]]|A diff-capable 'du-browser'.|http://gt5.sourceforge.net|{{Package AUR|gt5}}}}<br />
* {{App|[[Baobab]]|Baobab is a C/gtk+ application to analyse disk usage in any Gnome environment.|http://www.marzocca.net/linux/baobab|{{Package AUR|Baobab}}}}<br />
* {{App|[[Filelight]]|Filelight creates an interactive map of concentric, segmented rings that help visualise disk usage on your computer.|http://www.methylblue.com/filelight|{{Package Official|Filelight}}}}<br />
* {{App|[[gdmap]]|Draw map of rectangles where size of rectangle relate to size of file or dir.|http://gdmap.sourceforge.net/|{{Package Official|gdmap}}}}<br />
<br />
=== CD/DVD Burning Tools===<br />
* [[bashburn]] - A lightweight terminal based menu frontend for CD/DVD burning tools.<br />
* [[brasero]] - An application to burn CDs/DVDs for the Gnome Desktop.<br />
* [[gnomebaker]] - A GTK based CD/DVD burning application.<br />
* [[graveman]] - A GTK based CD/DVD burning application.<br />
* [[k3b]] - A feature-rich and easy to handle CD burning application for KDE.<br />
* [[nerolinux]] - A commercial CD/DVD burning tool (requires a valid key).<br />
* [[xcdroast]] - A lightweight CD/DVD burning tool.<br />
* [[xfburn]] - Xfburn is a simple CD/DVD burning tool based on libburnia libraries (xfce).<br />
<br />
===Clipboard Managers===<br />
* [[Parcellite]] - a lightweight yet feature-rich clipboard manager [http://parcellite.sourceforge.net/ Home page]<br />
* [[ClipIt]] - a fork of Parcellite with additional features and bugfixes [http://sourceforge.net/projects/gtkclipit/ Home page]<br />
* [[Glipper]] - Glipper is a clipboardmanager for GNOME with more features and plugin support [http://glipper.sourceforge.net/ Home page]<br />
* [[Anamnesis]] - stores all clipboard history (!) and offers an interface to do a full-text search. Both command line and GUI modes available [http://anamnesis.sourceforge.net/ Home page] | [http://aur.archlinux.org/packages.php?ID=41542 AUR package]<br />
<br />
=== Compression Tools ===<br />
* [[File Roller]] The default archive manager for GNOME.<br />
* [[p7zip]] - A command line port of 7-Zip for POSIX systems, including Linux. http://p7zip.sourceforge.net/ http://www.7-zip.org/<br />
* [[pbzip2]] - A threaded version of the bzip2 utility, can automatically scale up to as many cores as it finds in the system.<br />
* [[Squeeze]] - A featherweight front-end for command line archiving tools. Passworded archives are currently unsupported. http://squeeze.xfce.org/<br />
* [[XArchive]] - A GTK+ front-end for command line archiving tools.<br />
* [[Xarchiver]] - A lightweight, desktop independent front-end for command line archiving tools built with GTK2. http://xarchiver.sourceforge.net/<br />
<br />
=== File Managers ===<br />
* [[Dolphin]] - Default file manager for KDE 4 - http://dolphin.kde.org/<br />
* [[emelFM2]] - File manager that implements a three-pane design - http://emelfm2.net<br />
* [[Konqueror]] - Default file manager for KDE 2 and KDE 3 - http://www.konqueror.org/<br />
* [[Krusader]] - Advanced twin panel (commander style) file manager for KDE - http://www.krusader.org/<br />
* [[Midnight Commander]] - Terminal filemanager/shell that emulates Norton Commander - http://www.midnight-commander.org/<br />
* [[Nautilus]] - Extensible, heavyweight file manager used by default in GNOME with support for custom scripts - http://projects.gnome.org/nautilus/<br />
* [[PCManFM | PCMan File Manager]] - Part of the standard [[LXDE]] DE, a small and efficient graphical file manager - http://pcmanfm.sourceforge.net/<br />
* [[qtfm]] - A small, lightweight filemanager for Linux desktops based on pure Qt - http://www.qtfm.org/<br />
* [[Ranger]] - Ncurses based file manager with vi-like keybindings - https://github.com/hut/ranger<br />
* [[ROX-Filer]] - Small and fast file manager which can optionally manage desktop backgrounds and panels - http://roscidus.com/desktop/ROX-Filer<br />
* [[Thunar]] - [http://goodies.xfce.org/projects/thunar-plugins/start Extensible], medium weight file manager used by default in Xfce with support for plugins - http://thunar.xfce.org/<br />
* [[tuxcmd]] - Windowed file manager with 2 panels side by side similar to popular Total Commander or Midnight Commander file managers - http://tuxcmd.sourceforge.net/description.php<br />
* [[Vifm]] - Ncurses based file manager with vi-like keybindings - http://vifm.sourceforge.net/<br />
* [[Xfe]] - Small and very fast Commander like file manager - http://roland65.free.fr/xfe/<br />
<br />
=== Panels ===<br />
* [[fbpanel]] Lightweight, NETWM compliant desktop panel. [http://fbpanel.sourceforge.net/ Home page] [http://aur.archlinux.org/packages.php?ID=5255 Package]<br />
* [[LXPanel]] Lightweight X11 desktop panel and part of the LXDE DE. [http://lxde.org/ Home page] [http://aur.archlinux.org/packages.php?ID=17813 Package]<br />
* [[PyPanel]] Lightweight panel/taskbar written in Python and C. [http://pypanel.sourceforge.net/ Home page] [http://aur.archlinux.org/packages.php?ID=9118 Package]<br />
* [[Tint]] Simple panel/taskbar developed specifically for Openbox. [http://code.google.com/p/tint2/ Home page] [http://aur.archlinux.org/packages.php?ID=17082 Package]<br />
* [[BMPanel]] Lightweight, NETWM compliant desktop panel. [http://nsf.110mb.com/bmpanel/ Home page] [http://aur.archlinux.org/packages.php?ID=15165 Package]<br />
* [[Xfce4panel]] Default [[Xfce]] panel [http://www.xfce.org/projects/xfce4-panel/ Home page]<br />
<br />
=== System Monitoring ===<br />
*[[adesklet-systemmonitor]] - Modular stackable system monitors for adesklets http://adesklets.sourceforge.net/desklets.html<br />
*[[conky]] - advanced, highly configurable system monitor for X based on torsmo http://conky.sourceforge.net/<br />
*[[gkrellm]] - Simple, flexible system monitor package for GTK2; many plug-ins are available on AUR. http://members.dslextreme.com/users/billw/gkrellm/gkrellm.html<br />
<br />
=== Terminals ===<br />
<!--duplicates [[Terminal Emulator]]--><br />
* [[Aterm]] - An xterm replacement with transparency support http://aterm.sourceforge.net/ <br />
* [[Gnome-Terminal]] - GNOME default (standalone) terminal with support for Unicode and pseudo-transparency<br />
* [[Konsole]] - KDE's default terminal<br />
* [[lxterminal]] - VTE-based terminal emulator and c part of the LXDE DE. http://lxde.org/<br />
* [[Lilyterm]] — Lightweight and plain terminal emulator<br />
* [[mrxvt]] - Tabbed X terminal emulator based on rxvt code http://materm.sourceforge.net/index.html<br />
* [[roxterm]] - Tabbed, VTE-based terminal emulator http://roxterm.sourceforge.net/<br />
* [[rxvt-unicode]] (or urxvt) - A small, fast and customizable terminal which uses ~/.Xdefaults http://software.schmorp.de/pkg/rxvt-unicode.html<br />
* [[sakura]] - terminal emulator based on GTK and VTE. http://www.pleyades.net/david/sakura.php<br />
* [[Terminal]] - Xfce default terminal with support for a colorized prompt and a tabbed interface http://www.xfce.org/projects/terminal/<br />
* [[terminator]] - A terminal emulator supporting multiple resizable terminal panes<br />
* tilda - A terminal based on terminals from shooter games. https://aur.archlinux.org/packages.php?ID=13103<br />
* [[xterm]] - The default of defaults, requires only X<br />
<br />
===Text Editors===<br />
<!--Keep in sync with [[Lightweight Applications]] and use the App template.--><br />
{{Wikipedia|Comparison of text editors}}<br />
====Console====<br />
*{{App|[[Emacs]]|The somewhat intimidating but famously extensible text editor with hundreds of tricks and add-ons|[[project]]|[[package]]}}<br />
<!-- joe --><br />
*{{App|[[nano]]|A console text editor based on pico with on-screen key binding help|http://www.nano-editor.org/|{{Package Official|nano}}}}<br />
*{{App|[[Vim]]|Vi IMproved|http://www.vim.org/|{{Package Official|vim}}}}<br />
<br />
====X11====<br />
*{{App|[[Wikipedia:Acme (text editor)|Acme]]|A minimalist and flexible programming environment by Rob Pike|http://acme.cat-v.org|[[package]]}}<br />
*{{App|[[Beaver]]|An Early AdVanced EditoR|http://www.nongnu.org/beaver/|{{Package Official|beaver}}}}<br />
*{{App|[[Wikipedia:Geany|Geany]]|A text editor using the GTK+ 2 toolkit with basic features of an integrated development environment|http://www.geany.org|{{Package Official|geany}}}}<br />
*{{App|[[Wikipedia:Bluefish (text editor)|Bluefish]]|GTK editor/IDE with an MDI interface, syntax highlighting and support for Python plugins|http://bluefish.openoffice.nl/|{{Package Official|bluefish}}}}<br />
*{{App|Cssed|GTK2 based Cascading Style Sheets (CSS) editor|http://cssed.sourceforge.net/|[[package]]}}<br />
*{{App|Edile|A PyGTK code/scripting editor implemented in one file|http://edile.googlecode.com|{{Package AUR|edile}}}}<br />
*{{App|[[Emacs]]|The somewhat intimidating but famously extensible text editor with hundreds of tricks and add-ons|[[project]]|[[package]]}}<br />
*{{App|[[Gedit]]|Part of the GNOME desktop, but has minimal dependencies: a GTK2 editor with syntax highlighting, automatic indentation, matching brackets, etc., and a number of add-ons to increase functionality|[[project]]|[[package]]}}<br />
*{{App|[[gVim]]|Vi IMproved|http://www.vim.org/|{{Package Official|gvim}}}}<br />
*{{App|[[Kate]]|The KDE Advanced Text Editor. A full-featured programmer's editor, with MDI and a filesystem browser|[[project]]|[[package]]}}<br />
*{{App|[[KWrite]]|(part of the KDE desktop) A lightweight text editor with syntax highlighting.|[[project]]|[[package]]}}<br />
*{{App|[[Leafpad]]|A notepad clone for GTK+ 2.x that emphasizes simplicity|http://tarot.freeshell.org/leafpad/|{{Package Official|leafpad}}}}<br />
*{{App|[[medit]]|medit is a programming and around-programming text editor|http://mooedit.sourceforge.net/|{{Package Official|medit}}}}<br />
*{{App|[[Mousepad]]|A simple text editor for Xfce based on Leafpad|http://foo-projects.org/~benny/xfce/apps.html|{{Package Official|mousepad}}}}<br />
*{{App|[[Wikipedia:PyRoom|PyRoom]]|A great distractionless PyGTK text editor, a clone of the infamous WriteRoom|http://pyroom.org/|{{Package Official|pyroom}}}}<br />
*{{App|[[Wikipedia:Sam (text editor)|Sam]]|A graphical text editor by Rob Pike (still used by Ken Thompson and others)|http://sam.cat-v.org|}}<br />
*{{App|[[Scite]]|A generally useful editor with facilities for building and running programs|http://www.scintilla.org/SciTE.html|[[package]]}}<br />
*{{App|[[Tea]]|a QT based feature rich text editor|[[project]]|{{Package Official|tea}}}}<br />
<br />
=== OCR tools ===<br />
There are several steps to the whole OCR process, the actual OCR engine is only part of this:<br />
# scanning<br />
# document layout analysis<br />
# optical character recognition<br />
# post-processing (formatting, PDF creation)<br />
<br />
==== OCR Engines ====<br />
* [[CuneiForm]] is a command line OCR system originally developed and open sourced by Cognitive technologies. Supported languages: eng, ger, fra, rus, swe, spa, ita, ruseng, ukr, srp, hrv, pol, dan, por, dut, cze, rum, hun, bul, slo, lav, lit, est, tur. Available from [[pacman]]/community. https://launchpad.net/cuneiform-linux <br />
<br />
* [[Tesseract]] is "probably one of the most accurate open source OCR engines available". Available from [[pacman]]/community. http://code.google.com/p/tesseract-ocr/<br />
<br />
* [[GOCR]]/JOCR (http://jocr.sourceforge.net/) is an OCR engine which also supports barcode recognition. Available from [[pacman]]/extra as "gocr". http://www.gnu.org/software/ocrad/<br />
* [[Ocrad]] is an OCR (Optical Character Recognition) program based on a feature extraction method. Available from [[pacman]]/extra. http://www.gnu.org/software/ocrad/<br />
<br />
==== Layout analysers and user interfaces ====<br />
* [[OCRopus]] is an OCR ''platform'', modules exist for document layout analysis, OCR engines (it can use Tesseract or its own engine), natural language modelling, etc. Available from [[AUR]]. http://code.google.com/p/ocropus/<br />
* [[gscan2pdf]] scans, runs Tesseract and creates a PDF all in one go<br />
* [[Kooka]] is a scanner GUI for KDE which supports the OCR engines [[GOCR]], [[Ocrad]] or [[KADMOS]]. Used to be part of kdegraphics4, but dropped out due to lack of development. http://kooka.kde.org/<br />
* [[OCRFeeder]] is a Python GUI for Gnome which performs document analysis and rendition, and can use either [[CuneiForm]], [[GOCR]], [[Ocrad]] or [[Tesseract]] as OCR engines. It can import from PDF or image files, and export to HTML or OpenDocument. Available from [[AUR]]. http://live.gnome.org/OCRFeeder<br />
* [[YAGF]] is a graphical interface for the [[CuneiForm]] text recognition program on the Linux platform. Available from [[AUR]]. http://symmetrica.net/cuneiform-linux/yagf-en.html<br />
<br />
=== Trays ===<br />
* [[Docker]] is a docking application which acts as a system tray.<br />
* [[Stalonetray]] is a stand-alone system tray.<br />
* [[Trayer]] swallows GTK 1.2/2.x application docklets, and KDE docklets.<br />
<br />
==Window managers and desktop environments==<br />
*[[Desktop Environment#List of desktop environments|List of desktop environments]]<br />
*[[Window Manager#List of window managers|List of window managers]]<br />
<br />
==Games==<br />
*[[Games]]<br />
*[[Netbook Games]]<br />
<br />
==See also==<br />
*[http://bbs.archlinux.org/viewtopic.php?id=88515 Arch Linux Forums / LnF Awards 2010] - The best Light & Fast apps of 2010.<br />
*http://linuxappfinder.com/<br />
*http://www.linuxlinks.com/<br />
*http://en.wikipedia.org/wiki/List_of_open_source_software_packages<br />
*http://linuxappfinder.com/alternatives - Windows and OS X Software Alternatives<br />
*http://alternativeto.net/ - find alternatives to popular programs<br />
*http://www.linuxalt.com/ - Linux equivalents of Windows software</div>Ly50247https://wiki.archlinux.org/index.php?title=D-Bus_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=136562D-Bus (简体中文)2011-04-10T01:30:32Z<p>Ly50247: </p>
<hr />
<div>{{i18n|D-Bus}}<br />
==介绍==<br />
D-BUS是一个提供简单的应用程序间互相通讯的途径的消息传递(bus ?)系统,他包含一个可以在全系统(system-wide ?)和各个用户会议(session)之间的守护进程(daemon) 以及 一套函数库来允许程序使用D-Bus。<br />
<br />
==安装==<br />
安装D-BUS<br />
# pacman -S dbus<br />
{{Note|D-Bus 是很大一部分桌面应用程序所必须的,它很有可能已经被你安装了}}<br />
把它加到守护进程队列( DAEMONS array)以便让他在全系统运行:<br />
{{file |name=/etc/rc.conf |content=DAEMONS=(... dbus ...)}}<br />
你如果在安装D-Bus后不想重启,别忘了顺手启动它:<br />
# /etc/rc.d/dbus start<br />
<br />
==配置==<br />
在大多数情况下,不需要配置D-Bus,像gnome,kde这样的桌面环境会自动启动D-Bus,然而有些情况下需要额外的调整(additional tweaks)。<br />
====在没有桌面环境(desktop environment)下使用D-Bus====<br />
如果不想使用桌面环境,但仍旧要运行 需要或者要使用D-Bus 的程序时,你可能需要下面:<br />
{{file |name=~/.xinitrc |content=<br />
# D-Bus<br />
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then<br />
eval "$(dbus-launch --sh-syntax --exit-with-session)"<br />
fi<br />
}}<br />
这是用来启动一个用户会议(session)的D-Bus(和系统分离的 seperate from the system's )<br />
以及 解决出现像下面这样出错提示的办法:<br />
libnotify-Message: Unable to get session bus: Failed to execute dbus-launch to autolaunch D-Bus session<br />
<br />
==疑难解答(Troubleshooting)==<br />
Nothing here yet.<br />
<br />
==另请参阅(See also)==<br />
*[http://www.freedesktop.org/wiki/Software/dbus D-Bus page at freedesktop.org]</div>Ly50247https://wiki.archlinux.org/index.php?title=User:Ly50247&diff=136236User:Ly502472011-04-08T15:01:16Z<p>Ly50247: </p>
<hr />
<div>Linux lover<br />
<br />
blog: [http://ly50247.appspot.com/ ly50247]<br />
<br />
googlecode: [http://code.google.com/p/ly50247/ ly50247]<br />
<br />
email: ly50247 at gmail dot com</div>Ly50247https://wiki.archlinux.org/index.php?title=User:Ly50247&diff=136235User:Ly502472011-04-08T15:00:59Z<p>Ly50247: </p>
<hr />
<div>Linux lover<br />
<br />
blog: [http://ly50247.appspot.com/ ly50247]<br />
googlecode: [http://code.google.com/p/ly50247/ ly50247]<br />
<br />
email: ly50247 at gmail dot com</div>Ly50247https://wiki.archlinux.org/index.php?title=Dwm_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=136173Dwm (简体中文)2011-04-08T02:49:32Z<p>Ly50247: </p>
<hr />
<div>[[Category:HOWTOs (简体中文)]]<br />
{{i18n|dwm}}<br />
[[fr:DWM]]<br />
{{Article summary start|概要}}<br />
{{Article summary text|安装和配置dwm}}<br />
{{Article summary heading|相关内容}}<br />
{{Article summary wiki|dmenu}}<br />
{{Article summary wiki|wmii}}<br />
{{Article summary end}}<br />
{{DISPLAYTITLE:dwm}}<br />
<br />
[http://dwm.suckless.org/ dwm]是[[X]]下的一个动态窗口管理器。它用平铺的、栈式的和全屏的布局方式,借助一些可选的补丁还可以实现其他的布局。布局可以动态得改变,为程序提供最优的环境和性能。dwm特别轻量快速,用C语言编写,被设计的目标是控制在2000行以下的代码。在xrandr和Xinerama支持下可实现multi-head。<br />
<br />
<br />
==安装==<br />
这里建议用[[makepkg]]从[[ABS]]安装。这样你可以在稍后的时间简单地重新配置。如果你只是想安装试用一下的话,简单地安装:<br />
<br />
# pacman -S dwm<br />
<br />
注意这样是不灵活的,因为dwm的配置要通过修改它的源码来实现。所以接下来的文章假定你从源码编译dwm。<br />
<br />
你可能很想同时安装[[dmenu]],一个X下轻量级的动态菜单:<br />
# pacman -S dmenu<br />
<br />
===需求===<br />
你需要用 {{package Official|base-devel}} 里的基本编程工具来编译dwm,并且需要用 {{package Official|abs}} 来获得安装脚本:<br />
# pacman -S base-devel abs<br />
<br />
===用ABS下载安装脚本===<br />
如果需要的包都准备好了,可以用ABS从仓库里获得最新的安装脚本了:<br />
# abs<br />
<br />
然后,把dwm安装脚本从ABS树里拷贝到一个临时目录,例如:<br />
$ cp -r /var/abs/community/dwm ~/dwm<br />
<br />
===编译和安装===<br />
用 {{Codeline|cd}} 进入到编译的目录(上边例子里的{{Filename|~/dwm}}),然后运行:<br />
$ makepkg -i<br />
<br />
这会编译并安装dwm,如果有问题请仔细输出信息。<br />
<br />
{{Tip|如果你以后不更改 ({{filename|~/dwm}}) 目录, 你可以在以后的时间继续用它来对配置文件做进一步的修改。}}<br />
<br />
==配置==<br />
就像上边提到的那样,dwm是在编译时配置的,确切地说就是修改{{Filename|config.h}}和{{Filename|config.mk}}。然而它提供了一个很好的初始配置,对一些有经验的用户,它是很好调整的。<br />
<br />
===方法一:使用 ABS(推荐)===<br />
在这里修改dwm是非常简单的。<br />
<br />
====自定义config.h====<br />
进入[[#安装|安装过程]]中的dwm的源码目录;也就是上边的{{filename|~/dwm}}。里边的{{filename|config.h}} 存放着通常的配置信息。这个文件里的大多数配置都很好理解,但其他的可能比较有个性。关于这些配置的详细信息可以查阅[http://www.suckless.org/dwm/ dwm website]。<br />
<br />
{{note|要确保修改之前保存一份config.h的备份,以防修改中发生错误。}}<br />
<br />
一旦修改完成了,更新[[PKGBUILD]]里的md5sums:<br />
$ makepkg -g >> PKGBUILD<br />
这样会避免因为和官方的config.h文件不一样导致校验值错误。<br />
<br />
现在,编译并重新安装:<br />
$ makepkg -efi<br />
<br />
假定配置是有效的,这条命令会编译和重新安装dwm,如果出问题了,请仔细查看输入内容获得详细信息。<br />
<br />
最后,重启dwm来使用新的配置。<br />
<br />
====注意====<br />
从现在开始,我们不必每次都更新{{filename|config.h}}的md5sums了,因为会很频繁,我们只需要用{{codeline|--skipinteg}}选项来跳过校验。<br />
$ makepkg -efi --skipinteg<br />
<br />
在往dwm的启动脚本里添加几行后,我们可以[[#在不登出和退出程序程序的情况下重启dwm|在不登出和退出程序程序的情况下重启dwm]]。<br />
<br />
===方法二:使用Mercurial(高级)===<br />
上由的dwm是用[http://www.selenic.com/mercurial/wiki/ Mercurial]版本控制系统来维护的,在 [http://hg.suckless.org/dwm suckless.org]。熟悉Mercurial的人会发现用它来维护配置和补丁会更方便。可以参考官方网站[http://www.suckless.org/dwm/customisation/patch_queue.html detailed tutorial]详细教程。<br />
<br />
在从Mercurial的源码编译之前,要修改一下config.mk,不然可能会出错导致X崩溃。这里是要修改的值:<br />
<br />
更改 {{codeline|PREFIX}}:<br />
PREFIX = /usr<br />
X11的头文件目录:<br />
X11INC = /usr/include/X11<br />
和X11库目录:<br />
X11LIB = /usr/lib/X11<br />
<br />
==启动dwm==<br />
可以用{{Codeline|startx}}或者[[SLIM]]登陆管理器来启动dwm,只需要在{{Filename|~/.xinitrc}}添加: <br />
exec dwm<br />
<br />
对于[[GDM]],在{{Filename|~/.Xclients}}添加上述内容,然后在会话菜单里选择”运行XClient脚本”。<br />
<br />
==配置状态条==<br />
dwm使用根窗口名称来显示状态条信息,可以使用{{Codeline|xsetroot -name}}来改变。<br />
<br />
===基本状态条===<br />
这个例子显示[http://en.wikipedia.org/wiki/ISO_8601 ISO 8601]格式的日期。把下边的内容添加到{{filename|~/.xinitrc}}或者{{filename|~/.Xclients}},或者可以从GDM-3的讨论页中获得更多细节:<br />
<pre><br />
while true; do<br />
xsetroot -name "$( date +"%F %R" )"<br />
sleep 1m # Update time every minute<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
这是个笔记本使用的,依赖{{Package Official|acpi}}包来显示电池信息:<br />
<pre><br />
while true ; do<br />
xsetroot -name "$( acpi -b | awk '{ print $3, $4 }' | tr -d ',' )"<br />
sleep 1m<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
这个脚本显示电池剩余电量和充电状态,用awk命令过滤acpi输出的无用信息,然后用tr去除逗号。<br />
<br />
另一个方式是根据电池的状态选择性地输出信息:<br />
<pre><br />
while true; do<br />
batt=$(LC_ALL=C acpi -b)<br />
<br />
case $batt in<br />
*Discharging*)<br />
batt="${batt#* * * }"<br />
batt="${batt%%, *} "<br />
;;<br />
*)<br />
batt=""<br />
;;<br />
esac<br />
<br />
xsetroot -name "$batt$(date +%R)"<br />
<br />
sleep 60<br />
done &<br />
<br />
exec dwm<br />
</pre><br />
<br />
最后,要确保在{{filename|~/.xinitrc}}或者{{filename|~/.Xclients}}里只有一个dwm实例, 所以把整合起来应该像这样:<br />
~/.setbg<br />
autocutsel &<br />
termirssi &<br />
urxvt &<br />
<br />
while true; do<br />
xsetroot -name "$(date +"%F %R")"<br />
sleep 1m # Update time every minute<br />
done &<br />
'''exec dwm'''<br />
<br />
这是另一个显示alsa音量和电池状态的例子。它一直显示到系统退出为止。<br />
<br />
#set statusbar<br />
while true<br />
do<br />
if acpi -a | grep off-line > /dev/null; then<br />
xsetroot -name "Bat. $( acpi -b | awk '{ print $4 " " $5 }' | tr -d ',' ) | Vol. $(amixer get Master | tail -1 | awk '{ print $5}' | tr -d '[]') | $(date +"%a, %b %d %R")"<br />
else<br />
xsetroot -name "Vol. $(amixer get Master | tail -1 | awk '{ print $5}' | tr -d '[]') | $(date +"%a, %b %d %R")"<br />
fi<br />
sleep 1s <br />
done &<br />
<br />
===Conky状态条===<br />
Conky可以使用{{Codeline|xsetroot -name}}来往状态条里输出信息:<br />
conky | while read -r; do xsetroot -name "$REPLY"; done &<br />
exec dwm<br />
<br />
要想这样做,conky需要只往终端里输出文本。这是个应用于dual core CPU的简单conkyrc,显示几个状态信息:<br />
<pre><br />
out_to_console yes<br />
out_to_x no<br />
background no<br />
update_interval 2<br />
total_run_times 0<br />
use_spacer none<br />
<br />
TEXT<br />
$mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}<br />
</pre><br />
<br />
==基本用法==<br />
===使用dmenu===<br />
Dmenu是dwm的一个有用的扩展。它不是一个单独的列表式菜单,而是生成一个可执行文件的列表并根据输入进行自动补全。比起许多程序启动器,它能与dwm更好地整合。<br />
<br />
可以按 {{Keypress|Mod1}} + {{Keypress|P}} 来启动Dmenu({{Keypress|Mod1}} 缺省是 {{Keypress|Alt}} )。当然你也可以按自己的喜好改变它。然后只需要在上边出现的工具条中输入你想运行的程序的前几个字母,也可以按左右箭头在进行选择,按回车键完成。<br />
<br />
更详细的信息请查阅 [[dmenu]].<br />
<br />
===控制窗口===<br />
====将窗口移动到另一个tag====<br />
将当前的活动窗口移到其他的标签页:{{Keypress|Shift}} + {{Keypress|Mod1}} + {{Keypress|x}}, 其中的x是其他的标签页的序号,如果x是5,则表示将当前的活动窗口移到第5号标签页上去。{{Keypress|Mod1}} 缺省是 {{Keypress|Alt}} 键,这个键值可以在config.h中定义。<br />
<br />
====关闭窗口====<br />
关闭当前的活动窗口: {{Keypress|Shift}} + {{Keypress|Mod1}} + {{Keypress|C}}.<br />
<br />
====窗口布局====<br />
dwm缺省工作在平铺模式。当新窗口不断出现在同一个标签页时,窗口会越来越小。所有窗口会占满整个屏幕(除了目录条)。然而还有其他两种模式:浮动和单页模式。浮动模式对非平铺窗口管理器用户来说更熟悉,它允许用户重新按自己需要摆放窗口。单页模式会让一个窗口在最上边。<br />
<br />
要切换到浮动模式,只需要按{{Keypress|Mod1}} + {{Keypress|F}}。{{Keypress|Mod1}}缺省是 {{Keypress|Alt}}。如果你看到标签页右上角有X>这样的标志,就进行了浮动模式。<br />
<br />
切换到单页模式,按 {{Keypress|Mod1}} + {{Keypress|M}}。检查上否在单页模式,你会看到[M]标志(如果当前标签页无窗口),或者[n](n是打开窗口的编号)。<br />
<br />
回来平铺模式,按{{Keypress|Mod1}} + {{Keypress|T}},你会看到 []= 这样的标志。<br />
<br />
===退出dwm===<br />
退出dwm(登出): {{Keypress|Shift}} + {{Keypress|Mod1}} + {{Keypress|Q}}.<br />
<br />
官方关于默认的快捷键的说明: [http://dwm.suckless.org/tutorial dwm tutorial].<br />
<br />
再次说明,快捷键可以根据自己的喜好自由定义,本维基中的快捷键都是指官方默认的快捷键。<br />
<br />
==扩展使用==<br />
<br />
===补丁和增加的窗口布局(tiling modes)===<br />
The official website has a number of [http://www.suckless.org/dwm/patches patches] that can add extra functionality to dwm. Users can easily customize dwm by applying the modifications they like. The [http://www.suckless.org/dwm/patches/bottom_stack.html Bottom Stack] patch provides an additional tiling mode that splits the screen horizontally, as opposed to the default vertically oriented tiling mode. Similarly, bstack horizontal splits the tiles horizontally. <br />
<br />
The [http://dwm.suckless.org/patches/gapless_grid gaplessgrid patch] allows windows to be tiled like a grid.<br />
<br />
====实现为每个标签定制布局====<br />
dwm的缺省行为是将当前选定的布局应用到所有标签上。如果想为每个标签定制布局可以打[http://dwm.suckless.org/patches/pertag pertag]这个补丁。<br />
<br />
===解决模拟终端窗口缝隙问题===<br />
如果你发现模拟终端(例如xterm,Urxvt)的窗口占不满屏幕,这是因为其窗口的大小和字体有关。你可以试图调整字体大小直到恰好合适为止(这也许是很困难的),或者只需要把{{filename|config.h}} 文件中的 {{Codeline|resizehints}} 设置为 False:<br />
static Bool resizehints = False; /* False means respect size hints in tiled resizals */<br />
<br />
这样dwm会忽略所有窗口的改变大小的请求,不只是模拟终端的。这样的缺点是一些模拟终端可能会刷新异常,像显示一些错误的内容。<br />
<br />
====Urxvt====<br />
对于 [[urxvt]] 用户另一个方法是打 [[urxvt#Fix maximized window gaps|hints patch]] 这个补丁然后将dwm改回到默认的选项:<br />
static Bool resizehints = '''True''';<br />
<br />
===在不登出和退出程序程序的情况下重启dwm===<br />
如果你要在在线重启dwm(不关闭它以及其他应用程序),修改启动脚本,并让dwm在一个while循环中运行,像这样:<br />
<pre><br />
while true; do<br />
# Log stderror to a file <br />
dwm 2> ~/.dwm.log<br />
# No error logging<br />
#dwm >/dev/null 2>&1<br />
done<br />
</pre><br />
<br />
这样就可以用Mod-Shift-Q快捷键来实现重启。<br />
<br />
把上边的内容写到一个其他的文件(例如{{Filename|~/bin/startdwm}})是一个好主意。然后在 {{filename|~/.xinitrc}} 文件里添加(exec startdwm)。这样我们可以使用 {{Codeline|killall startdwm}} 来真正地退出X会话,或者绑定到一个方便的快捷键上。<br />
<br />
===把右Alt键作为Mod4(Win键)使用===<br />
当把Mod4(Win键)作为 {{codeline|MODKEY}} 时,你可能希望右Alt键也可以作为Mod4,这样就两个手都可以按到了<br />
<br />
首先,找到右Ctrl键对应的键码:<br />
xmodmap -pke | grep Alt_R<br />
<br />
然后只需要在启动脚本(比如 {{filename|~/.xinitrc}})添加如下内容, 把 ''113'' 换成之前{{codeline|xmodmap}} 的结果:<br />
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L<br />
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group<br />
<br />
现在,右Alt键就和Mod4键一样了。<br />
<br />
===防止鼠标下的程序自动获取焦点===<br />
为了防止鼠标下的程序自动获取焦点,可以注释掉dwm.c中的如下代码:<br />
<pre>[EnterNotify] = enternotify, </pre><br />
<br />
===添加个性的快捷键绑定===<br />
{{filename|config.h}} 文件中的两个地方涉及到创建修改快捷键,一个是"/* */" 注释中,并一个是"static Key keys[] = {"语句中。<br />
<br />
static const char *<keybindname>[] = { "<command>", "<flags>", "<arguments>", NULL };<br />
<br />
<keybindname> 可以是任何东西, <command> <-flags> and <arguments> 也是,但要用双引号括起来。<br />
<br />
{ MODKEY, XK_<key>, spawn, {.v = <keybindname> } },<br />
<br />
这会绑定 Mod+<key> 来执行之前定义的命令。<br />
<br />
{ MODKEY|ShiftMask, XK_<key>, spawn, {.v = <keybindname> } },<br />
<br />
这会绑定 Mod+Shift+<key> ,使用要用Ctrl键是 ControlMask 。<br />
<br />
单个按键像Fn或者多媒体键必须要用16进制数来表示,可以用xev程序来获得。或者查看 /usr/include/X11/XF86keysym.h 中的定义。<br />
<br />
{ 0, 0xff00, spawn, {.v = <keybindname> } },<br />
<br />
这会把0xff00键绑定到<keybindname>。<br />
<br />
===解决Java程序不正常的问题===<br />
<br />
对于使用JRE 6u20的Java程序在dwm中可能表现异常,因为dwm不是Java的一个已知的窗口管理器,这会导致一些像鼠标释放使菜单消失之类的小问题。可以先安装里的 [community] 里的wmname:<br />
# pacman -S wmname<br />
<br />
然后你只需要用wmname来设置一个Java能识别的WM名称:<br />
$ wmname LG3D<br />
<br />
这不是永久的,所以你可以把它写进.xinitrc。<br />
<br />
==资源==<br />
* [http://www.suckless.org/dwm dwm's official website]<br />
* [[dmenu]] - Simple application launcher from the developers of dwm<br />
* The [http://bbs.archlinux.org/viewtopic.php?id=57549/ dwm thread] on the forums<br />
* [http://bbs.archlinux.org/viewtopic.php?id=92895/ Hacking dwm thread]<br />
* Check out the forums' [http://bbs.archlinux.org/viewtopic.php?id=57768/ wallpaper thread] for a selection of dwm wallpapers<br />
* [http://www.xsnake.net/howto/dwm/dwm-eng.php HowTo by Snake]<br />
* [http://0x80.org/blog/?p=72 Moved to dwm]</div>Ly50247https://wiki.archlinux.org/index.php?title=Dwm_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=136172Dwm (简体中文)2011-04-08T02:48:48Z<p>Ly50247: /* 窗口布局 */</p>
<hr />
<div>[[Category:HOWTOs (简体中文)]]<br />
{{i18n|dwm}}<br />
{{translateme}}<br />
[[fr:DWM]]<br />
{{Article summary start|概要}}<br />
{{Article summary text|安装和配置dwm}}<br />
{{Article summary heading|相关内容}}<br />
{{Article summary wiki|dmenu}}<br />
{{Article summary wiki|wmii}}<br />
{{Article summary end}}<br />
{{DISPLAYTITLE:dwm}}<br />
<br />
[http://dwm.suckless.org/ dwm]是[[X]]下的一个动态窗口管理器。它用平铺的、栈式的和全屏的布局方式,借助一些可选的补丁还可以实现其他的布局。布局可以动态得改变,为程序提供最优的环境和性能。dwm特别轻量快速,用C语言编写,被设计的目标是控制在2000行以下的代码。在xrandr和Xinerama支持下可实现multi-head。<br />
<br />
<br />
==安装==<br />
这里建议用[[makepkg]]从[[ABS]]安装。这样你可以在稍后的时间简单地重新配置。如果你只是想安装试用一下的话,简单地安装:<br />
<br />
# pacman -S dwm<br />
<br />
注意这样是不灵活的,因为dwm的配置要通过修改它的源码来实现。所以接下来的文章假定你从源码编译dwm。<br />
<br />
你可能很想同时安装[[dmenu]],一个X下轻量级的动态菜单:<br />
# pacman -S dmenu<br />
<br />
===需求===<br />
你需要用 {{package Official|base-devel}} 里的基本编程工具来编译dwm,并且需要用 {{package Official|abs}} 来获得安装脚本:<br />
# pacman -S base-devel abs<br />
<br />
===用ABS下载安装脚本===<br />
如果需要的包都准备好了,可以用ABS从仓库里获得最新的安装脚本了:<br />
# abs<br />
<br />
然后,把dwm安装脚本从ABS树里拷贝到一个临时目录,例如:<br />
$ cp -r /var/abs/community/dwm ~/dwm<br />
<br />
===编译和安装===<br />
用 {{Codeline|cd}} 进入到编译的目录(上边例子里的{{Filename|~/dwm}}),然后运行:<br />
$ makepkg -i<br />
<br />
这会编译并安装dwm,如果有问题请仔细输出信息。<br />
<br />
{{Tip|如果你以后不更改 ({{filename|~/dwm}}) 目录, 你可以在以后的时间继续用它来对配置文件做进一步的修改。}}<br />
<br />
==配置==<br />
就像上边提到的那样,dwm是在编译时配置的,确切地说就是修改{{Filename|config.h}}和{{Filename|config.mk}}。然而它提供了一个很好的初始配置,对一些有经验的用户,它是很好调整的。<br />
<br />
===方法一:使用 ABS(推荐)===<br />
在这里修改dwm是非常简单的。<br />
<br />
====自定义config.h====<br />
进入[[#安装|安装过程]]中的dwm的源码目录;也就是上边的{{filename|~/dwm}}。里边的{{filename|config.h}} 存放着通常的配置信息。这个文件里的大多数配置都很好理解,但其他的可能比较有个性。关于这些配置的详细信息可以查阅[http://www.suckless.org/dwm/ dwm website]。<br />
<br />
{{note|要确保修改之前保存一份config.h的备份,以防修改中发生错误。}}<br />
<br />
一旦修改完成了,更新[[PKGBUILD]]里的md5sums:<br />
$ makepkg -g >> PKGBUILD<br />
这样会避免因为和官方的config.h文件不一样导致校验值错误。<br />
<br />
现在,编译并重新安装:<br />
$ makepkg -efi<br />
<br />
假定配置是有效的,这条命令会编译和重新安装dwm,如果出问题了,请仔细查看输入内容获得详细信息。<br />
<br />
最后,重启dwm来使用新的配置。<br />
<br />
====注意====<br />
从现在开始,我们不必每次都更新{{filename|config.h}}的md5sums了,因为会很频繁,我们只需要用{{codeline|--skipinteg}}选项来跳过校验。<br />
$ makepkg -efi --skipinteg<br />
<br />
在往dwm的启动脚本里添加几行后,我们可以[[#在不登出和退出程序程序的情况下重启dwm|在不登出和退出程序程序的情况下重启dwm]]。<br />
<br />
===方法二:使用Mercurial(高级)===<br />
上由的dwm是用[http://www.selenic.com/mercurial/wiki/ Mercurial]版本控制系统来维护的,在 [http://hg.suckless.org/dwm suckless.org]。熟悉Mercurial的人会发现用它来维护配置和补丁会更方便。可以参考官方网站[http://www.suckless.org/dwm/customisation/patch_queue.html detailed tutorial]详细教程。<br />
<br />
在从Mercurial的源码编译之前,要修改一下config.mk,不然可能会出错导致X崩溃。这里是要修改的值:<br />
<br />
更改 {{codeline|PREFIX}}:<br />
PREFIX = /usr<br />
X11的头文件目录:<br />
X11INC = /usr/include/X11<br />
和X11库目录:<br />
X11LIB = /usr/lib/X11<br />
<br />
==启动dwm==<br />
可以用{{Codeline|startx}}或者[[SLIM]]登陆管理器来启动dwm,只需要在{{Filename|~/.xinitrc}}添加: <br />
exec dwm<br />
<br />
对于[[GDM]],在{{Filename|~/.Xclients}}添加上述内容,然后在会话菜单里选择”运行XClient脚本”。<br />
<br />
==配置状态条==<br />
dwm使用根窗口名称来显示状态条信息,可以使用{{Codeline|xsetroot -name}}来改变。<br />
<br />
===基本状态条===<br />
这个例子显示[http://en.wikipedia.org/wiki/ISO_8601 ISO 8601]格式的日期。把下边的内容添加到{{filename|~/.xinitrc}}或者{{filename|~/.Xclients}},或者可以从GDM-3的讨论页中获得更多细节:<br />
<pre><br />
while true; do<br />
xsetroot -name "$( date +"%F %R" )"<br />
sleep 1m # Update time every minute<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
这是个笔记本使用的,依赖{{Package Official|acpi}}包来显示电池信息:<br />
<pre><br />
while true ; do<br />
xsetroot -name "$( acpi -b | awk '{ print $3, $4 }' | tr -d ',' )"<br />
sleep 1m<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
这个脚本显示电池剩余电量和充电状态,用awk命令过滤acpi输出的无用信息,然后用tr去除逗号。<br />
<br />
另一个方式是根据电池的状态选择性地输出信息:<br />
<pre><br />
while true; do<br />
batt=$(LC_ALL=C acpi -b)<br />
<br />
case $batt in<br />
*Discharging*)<br />
batt="${batt#* * * }"<br />
batt="${batt%%, *} "<br />
;;<br />
*)<br />
batt=""<br />
;;<br />
esac<br />
<br />
xsetroot -name "$batt$(date +%R)"<br />
<br />
sleep 60<br />
done &<br />
<br />
exec dwm<br />
</pre><br />
<br />
最后,要确保在{{filename|~/.xinitrc}}或者{{filename|~/.Xclients}}里只有一个dwm实例, 所以把整合起来应该像这样:<br />
~/.setbg<br />
autocutsel &<br />
termirssi &<br />
urxvt &<br />
<br />
while true; do<br />
xsetroot -name "$(date +"%F %R")"<br />
sleep 1m # Update time every minute<br />
done &<br />
'''exec dwm'''<br />
<br />
这是另一个显示alsa音量和电池状态的例子。它一直显示到系统退出为止。<br />
<br />
#set statusbar<br />
while true<br />
do<br />
if acpi -a | grep off-line > /dev/null; then<br />
xsetroot -name "Bat. $( acpi -b | awk '{ print $4 " " $5 }' | tr -d ',' ) | Vol. $(amixer get Master | tail -1 | awk '{ print $5}' | tr -d '[]') | $(date +"%a, %b %d %R")"<br />
else<br />
xsetroot -name "Vol. $(amixer get Master | tail -1 | awk '{ print $5}' | tr -d '[]') | $(date +"%a, %b %d %R")"<br />
fi<br />
sleep 1s <br />
done &<br />
<br />
===Conky状态条===<br />
Conky可以使用{{Codeline|xsetroot -name}}来往状态条里输出信息:<br />
conky | while read -r; do xsetroot -name "$REPLY"; done &<br />
exec dwm<br />
<br />
要想这样做,conky需要只往终端里输出文本。这是个应用于dual core CPU的简单conkyrc,显示几个状态信息:<br />
<pre><br />
out_to_console yes<br />
out_to_x no<br />
background no<br />
update_interval 2<br />
total_run_times 0<br />
use_spacer none<br />
<br />
TEXT<br />
$mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}<br />
</pre><br />
<br />
==基本用法==<br />
===使用dmenu===<br />
Dmenu是dwm的一个有用的扩展。它不是一个单独的列表式菜单,而是生成一个可执行文件的列表并根据输入进行自动补全。比起许多程序启动器,它能与dwm更好地整合。<br />
<br />
可以按 {{Keypress|Mod1}} + {{Keypress|P}} 来启动Dmenu({{Keypress|Mod1}} 缺省是 {{Keypress|Alt}} )。当然你也可以按自己的喜好改变它。然后只需要在上边出现的工具条中输入你想运行的程序的前几个字母,也可以按左右箭头在进行选择,按回车键完成。<br />
<br />
更详细的信息请查阅 [[dmenu]].<br />
<br />
===控制窗口===<br />
====将窗口移动到另一个tag====<br />
将当前的活动窗口移到其他的标签页:{{Keypress|Shift}} + {{Keypress|Mod1}} + {{Keypress|x}}, 其中的x是其他的标签页的序号,如果x是5,则表示将当前的活动窗口移到第5号标签页上去。{{Keypress|Mod1}} 缺省是 {{Keypress|Alt}} 键,这个键值可以在config.h中定义。<br />
<br />
====关闭窗口====<br />
关闭当前的活动窗口: {{Keypress|Shift}} + {{Keypress|Mod1}} + {{Keypress|C}}.<br />
<br />
====窗口布局====<br />
dwm缺省工作在平铺模式。当新窗口不断出现在同一个标签页时,窗口会越来越小。所有窗口会占满整个屏幕(除了目录条)。然而还有其他两种模式:浮动和单页模式。浮动模式对非平铺窗口管理器用户来说更熟悉,它允许用户重新按自己需要摆放窗口。单页模式会让一个窗口在最上边。<br />
<br />
要切换到浮动模式,只需要按{{Keypress|Mod1}} + {{Keypress|F}}。{{Keypress|Mod1}}缺省是 {{Keypress|Alt}}。如果你看到标签页右上角有X>这样的标志,就进行了浮动模式。<br />
<br />
切换到单页模式,按 {{Keypress|Mod1}} + {{Keypress|M}}。检查上否在单页模式,你会看到[M]标志(如果当前标签页无窗口),或者[n](n是打开窗口的编号)。<br />
<br />
回来平铺模式,按{{Keypress|Mod1}} + {{Keypress|T}},你会看到 []= 这样的标志。<br />
<br />
===退出dwm===<br />
退出dwm(登出): {{Keypress|Shift}} + {{Keypress|Mod1}} + {{Keypress|Q}}.<br />
<br />
官方关于默认的快捷键的说明: [http://dwm.suckless.org/tutorial dwm tutorial].<br />
<br />
再次说明,快捷键可以根据自己的喜好自由定义,本维基中的快捷键都是指官方默认的快捷键。<br />
<br />
==扩展使用==<br />
<br />
===补丁和增加的窗口布局(tiling modes)===<br />
The official website has a number of [http://www.suckless.org/dwm/patches patches] that can add extra functionality to dwm. Users can easily customize dwm by applying the modifications they like. The [http://www.suckless.org/dwm/patches/bottom_stack.html Bottom Stack] patch provides an additional tiling mode that splits the screen horizontally, as opposed to the default vertically oriented tiling mode. Similarly, bstack horizontal splits the tiles horizontally. <br />
<br />
The [http://dwm.suckless.org/patches/gapless_grid gaplessgrid patch] allows windows to be tiled like a grid.<br />
<br />
====实现为每个标签定制布局====<br />
dwm的缺省行为是将当前选定的布局应用到所有标签上。如果想为每个标签定制布局可以打[http://dwm.suckless.org/patches/pertag pertag]这个补丁。<br />
<br />
===解决模拟终端窗口缝隙问题===<br />
如果你发现模拟终端(例如xterm,Urxvt)的窗口占不满屏幕,这是因为其窗口的大小和字体有关。你可以试图调整字体大小直到恰好合适为止(这也许是很困难的),或者只需要把{{filename|config.h}} 文件中的 {{Codeline|resizehints}} 设置为 False:<br />
static Bool resizehints = False; /* False means respect size hints in tiled resizals */<br />
<br />
这样dwm会忽略所有窗口的改变大小的请求,不只是模拟终端的。这样的缺点是一些模拟终端可能会刷新异常,像显示一些错误的内容。<br />
<br />
====Urxvt====<br />
对于 [[urxvt]] 用户另一个方法是打 [[urxvt#Fix maximized window gaps|hints patch]] 这个补丁然后将dwm改回到默认的选项:<br />
static Bool resizehints = '''True''';<br />
<br />
===在不登出和退出程序程序的情况下重启dwm===<br />
如果你要在在线重启dwm(不关闭它以及其他应用程序),修改启动脚本,并让dwm在一个while循环中运行,像这样:<br />
<pre><br />
while true; do<br />
# Log stderror to a file <br />
dwm 2> ~/.dwm.log<br />
# No error logging<br />
#dwm >/dev/null 2>&1<br />
done<br />
</pre><br />
<br />
这样就可以用Mod-Shift-Q快捷键来实现重启。<br />
<br />
把上边的内容写到一个其他的文件(例如{{Filename|~/bin/startdwm}})是一个好主意。然后在 {{filename|~/.xinitrc}} 文件里添加(exec startdwm)。这样我们可以使用 {{Codeline|killall startdwm}} 来真正地退出X会话,或者绑定到一个方便的快捷键上。<br />
<br />
===把右Alt键作为Mod4(Win键)使用===<br />
当把Mod4(Win键)作为 {{codeline|MODKEY}} 时,你可能希望右Alt键也可以作为Mod4,这样就两个手都可以按到了<br />
<br />
首先,找到右Ctrl键对应的键码:<br />
xmodmap -pke | grep Alt_R<br />
<br />
然后只需要在启动脚本(比如 {{filename|~/.xinitrc}})添加如下内容, 把 ''113'' 换成之前{{codeline|xmodmap}} 的结果:<br />
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L<br />
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group<br />
<br />
现在,右Alt键就和Mod4键一样了。<br />
<br />
===防止鼠标下的程序自动获取焦点===<br />
为了防止鼠标下的程序自动获取焦点,可以注释掉dwm.c中的如下代码:<br />
<pre>[EnterNotify] = enternotify, </pre><br />
<br />
===添加个性的快捷键绑定===<br />
{{filename|config.h}} 文件中的两个地方涉及到创建修改快捷键,一个是"/* */" 注释中,并一个是"static Key keys[] = {"语句中。<br />
<br />
static const char *<keybindname>[] = { "<command>", "<flags>", "<arguments>", NULL };<br />
<br />
<keybindname> 可以是任何东西, <command> <-flags> and <arguments> 也是,但要用双引号括起来。<br />
<br />
{ MODKEY, XK_<key>, spawn, {.v = <keybindname> } },<br />
<br />
这会绑定 Mod+<key> 来执行之前定义的命令。<br />
<br />
{ MODKEY|ShiftMask, XK_<key>, spawn, {.v = <keybindname> } },<br />
<br />
这会绑定 Mod+Shift+<key> ,使用要用Ctrl键是 ControlMask 。<br />
<br />
单个按键像Fn或者多媒体键必须要用16进制数来表示,可以用xev程序来获得。或者查看 /usr/include/X11/XF86keysym.h 中的定义。<br />
<br />
{ 0, 0xff00, spawn, {.v = <keybindname> } },<br />
<br />
这会把0xff00键绑定到<keybindname>。<br />
<br />
===解决Java程序不正常的问题===<br />
<br />
对于使用JRE 6u20的Java程序在dwm中可能表现异常,因为dwm不是Java的一个已知的窗口管理器,这会导致一些像鼠标释放使菜单消失之类的小问题。可以先安装里的 [community] 里的wmname:<br />
# pacman -S wmname<br />
<br />
然后你只需要用wmname来设置一个Java能识别的WM名称:<br />
$ wmname LG3D<br />
<br />
这不是永久的,所以你可以把它写进.xinitrc。<br />
<br />
==资源==<br />
* [http://www.suckless.org/dwm dwm's official website]<br />
* [[dmenu]] - Simple application launcher from the developers of dwm<br />
* The [http://bbs.archlinux.org/viewtopic.php?id=57549/ dwm thread] on the forums<br />
* [http://bbs.archlinux.org/viewtopic.php?id=92895/ Hacking dwm thread]<br />
* Check out the forums' [http://bbs.archlinux.org/viewtopic.php?id=57768/ wallpaper thread] for a selection of dwm wallpapers<br />
* [http://www.xsnake.net/howto/dwm/dwm-eng.php HowTo by Snake]<br />
* [http://0x80.org/blog/?p=72 Moved to dwm]</div>Ly50247https://wiki.archlinux.org/index.php?title=Dwm_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=136126Dwm (简体中文)2011-04-07T13:50:32Z<p>Ly50247: /* 窗口布局 */</p>
<hr />
<div>[[Category:HOWTOs (简体中文)]]<br />
{{i18n|dwm}}<br />
{{translateme}}<br />
[[fr:DWM]]<br />
{{Article summary start|概要}}<br />
{{Article summary text|安装和配置dwm}}<br />
{{Article summary heading|相关内容}}<br />
{{Article summary wiki|dmenu}}<br />
{{Article summary wiki|wmii}}<br />
{{Article summary end}}<br />
{{DISPLAYTITLE:dwm}}<br />
<br />
[http://dwm.suckless.org/ dwm]是[[X]]下的一个动态窗口管理器。它用平铺的、栈式的和全屏的布局方式,借助一些可选的补丁还可以实现其他的布局。布局可以动态得改变,为程序提供最优的环境和性能。dwm特别轻量快速,用C语言编写,被设计的目标是控制在2000行以下的代码。在xrandr和Xinerama支持下可实现multi-head。<br />
<br />
<br />
==安装==<br />
这里建议用[[makepkg]]从[[ABS]]安装。这样你可以在稍后的时间简单地重新配置。如果你只是想安装试用一下的话,简单地安装:<br />
<br />
# pacman -S dwm<br />
<br />
注意这样是不灵活的,因为dwm的配置要通过修改它的源码来实现。所以接下来的文章假定你从源码编译dwm。<br />
<br />
你可能很想同时安装[[dmenu]],一个X下轻量级的动态菜单:<br />
# pacman -S dmenu<br />
<br />
===需求===<br />
你需要用 {{package Official|base-devel}} 里的基本编程工具来编译dwm,并且需要用 {{package Official|abs}} 来获得安装脚本:<br />
# pacman -S base-devel abs<br />
<br />
===用ABS下载安装脚本===<br />
如果需要的包都准备好了,可以用ABS从仓库里获得最新的安装脚本了:<br />
# abs<br />
<br />
然后,把dwm安装脚本从ABS树里拷贝到一个临时目录,例如:<br />
$ cp -r /var/abs/community/dwm ~/dwm<br />
<br />
===编译和安装===<br />
用 {{Codeline|cd}} 进入到编译的目录(上边例子里的{{Filename|~/dwm}}),然后运行:<br />
$ makepkg -i<br />
<br />
这会编译并安装dwm,如果有问题请仔细输出信息。<br />
<br />
{{Tip|如果你以后不更改 ({{filename|~/dwm}}) 目录, 你可以在以后的时间继续用它来对配置文件做进一步的修改。}}<br />
<br />
==配置==<br />
就像上边提到的那样,dwm是在编译时配置的,确切地说就是修改{{Filename|config.h}}和{{Filename|config.mk}}。然而它提供了一个很好的初始配置,对一些有经验的用户,它是很好调整的。<br />
<br />
===方法一:使用 ABS(推荐)===<br />
在这里修改dwm是非常简单的。<br />
<br />
====自定义config.h====<br />
进入[[#安装|安装过程]]中的dwm的源码目录;也就是上边的{{filename|~/dwm}}。里边的{{filename|config.h}} 存放着通常的配置信息。这个文件里的大多数配置都很好理解,但其他的可能比较有个性。关于这些配置的详细信息可以查阅[http://www.suckless.org/dwm/ dwm website]。<br />
<br />
{{note|要确保修改之前保存一份config.h的备份,以防修改中发生错误。}}<br />
<br />
一旦修改完成了,更新[[PKGBUILD]]里的md5sums:<br />
$ makepkg -g >> PKGBUILD<br />
这样会避免因为和官方的config.h文件不一样导致校验值错误。<br />
<br />
现在,编译并重新安装:<br />
$ makepkg -efi<br />
<br />
假定配置是有效的,这条命令会编译和重新安装dwm,如果出问题了,请仔细查看输入内容获得详细信息。<br />
<br />
最后,重启dwm来使用新的配置。<br />
<br />
====注意====<br />
从现在开始,我们不必每次都更新{{filename|config.h}}的md5sums了,因为会很频繁,我们只需要用{{codeline|--skipinteg}}选项来跳过校验。<br />
$ makepkg -efi --skipinteg<br />
<br />
在往dwm的启动脚本里添加几行后,我们可以[[#在不登出和退出程序程序的情况下重启dwm|在不登出和退出程序程序的情况下重启dwm]]。<br />
<br />
===方法二:使用Mercurial(高级)===<br />
上由的dwm是用[http://www.selenic.com/mercurial/wiki/ Mercurial]版本控制系统来维护的,在 [http://hg.suckless.org/dwm suckless.org]。熟悉Mercurial的人会发现用它来维护配置和补丁会更方便。可以参考官方网站[http://www.suckless.org/dwm/customisation/patch_queue.html detailed tutorial]详细教程。<br />
<br />
在从Mercurial的源码编译之前,要修改一下config.mk,不然可能会出错导致X崩溃。这里是要修改的值:<br />
<br />
更改 {{codeline|PREFIX}}:<br />
PREFIX = /usr<br />
X11的头文件目录:<br />
X11INC = /usr/include/X11<br />
和X11库目录:<br />
X11LIB = /usr/lib/X11<br />
<br />
==启动dwm==<br />
可以用{{Codeline|startx}}或者[[SLIM]]登陆管理器来启动dwm,只需要在{{Filename|~/.xinitrc}}添加: <br />
exec dwm<br />
<br />
对于[[GDM]],在{{Filename|~/.Xclients}}添加上述内容,然后在会话菜单里选择”运行XClient脚本”。<br />
<br />
==配置状态条==<br />
dwm使用根窗口名称来显示状态条信息,可以使用{{Codeline|xsetroot -name}}来改变。<br />
<br />
===基本状态条===<br />
这个例子显示[http://en.wikipedia.org/wiki/ISO_8601 ISO 8601]格式的日期。把下边的内容添加到{{filename|~/.xinitrc}}或者{{filename|~/.Xclients}},或者可以从GDM-3的讨论页中获得更多细节:<br />
<pre><br />
while true; do<br />
xsetroot -name "$( date +"%F %R" )"<br />
sleep 1m # Update time every minute<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
这是个笔记本使用的,依赖{{Package Official|acpi}}包来显示电池信息:<br />
<pre><br />
while true ; do<br />
xsetroot -name "$( acpi -b | awk '{ print $3, $4 }' | tr -d ',' )"<br />
sleep 1m<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
这个脚本显示电池剩余电量和充电状态,用awk命令过滤acpi输出的无用信息,然后用tr去除逗号。<br />
<br />
另一个方式是根据电池的状态选择性地输出信息:<br />
<pre><br />
while true; do<br />
batt=$(LC_ALL=C acpi -b)<br />
<br />
case $batt in<br />
*Discharging*)<br />
batt="${batt#* * * }"<br />
batt="${batt%%, *} "<br />
;;<br />
*)<br />
batt=""<br />
;;<br />
esac<br />
<br />
xsetroot -name "$batt$(date +%R)"<br />
<br />
sleep 60<br />
done &<br />
<br />
exec dwm<br />
</pre><br />
<br />
最后,要确保在{{filename|~/.xinitrc}}或者{{filename|~/.Xclients}}里只有一个dwm实例, 所以把整合起来应该像这样:<br />
~/.setbg<br />
autocutsel &<br />
termirssi &<br />
urxvt &<br />
<br />
while true; do<br />
xsetroot -name "$(date +"%F %R")"<br />
sleep 1m # Update time every minute<br />
done &<br />
'''exec dwm'''<br />
<br />
这是另一个显示alsa音量和电池状态的例子。它一直显示到系统退出为止。<br />
<br />
#set statusbar<br />
while true<br />
do<br />
if acpi -a | grep off-line > /dev/null; then<br />
xsetroot -name "Bat. $( acpi -b | awk '{ print $4 " " $5 }' | tr -d ',' ) | Vol. $(amixer get Master | tail -1 | awk '{ print $5}' | tr -d '[]') | $(date +"%a, %b %d %R")"<br />
else<br />
xsetroot -name "Vol. $(amixer get Master | tail -1 | awk '{ print $5}' | tr -d '[]') | $(date +"%a, %b %d %R")"<br />
fi<br />
sleep 1s <br />
done &<br />
<br />
===Conky状态条===<br />
Conky可以使用{{Codeline|xsetroot -name}}来往状态条里输出信息:<br />
conky | while read -r; do xsetroot -name "$REPLY"; done &<br />
exec dwm<br />
<br />
要想这样做,conky需要只往终端里输出文本。这是个应用于dual core CPU的简单conkyrc,显示几个状态信息:<br />
<pre><br />
out_to_console yes<br />
out_to_x no<br />
background no<br />
update_interval 2<br />
total_run_times 0<br />
use_spacer none<br />
<br />
TEXT<br />
$mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}<br />
</pre><br />
<br />
==基本用法==<br />
===使用dmenu===<br />
Dmenu是dwm的一个有用的扩展。它不是一个单独的列表式菜单,而是生成一个可执行文件的列表并根据输入进行自动补全。比起许多程序启动器,它能与dwm更好地整合。<br />
<br />
可以按 {{Keypress|Mod1}} + {{Keypress|P}} 来启动Dmenu({{Keypress|Mod1}} 缺省是 {{Keypress|Alt}} )。当然你也可以按自己的喜好改变它。然后只需要在上边出现的工具条中输入你想运行的程序的前几个字母,也可以按左右箭头在进行选择,按回车键完成。<br />
<br />
更详细的信息请查阅 [[dmenu]].<br />
<br />
===控制窗口===<br />
====将窗口移动到另一个tag====<br />
将当前的活动窗口移到其他的标签页:{{Keypress|Shift}} + {{Keypress|Mod1}} + {{Keypress|x}}, 其中的x是其他的标签页的序号,如果x是5,则表示将当前的活动窗口移到第5号标签页上去。{{Keypress|Mod1}} 缺省是 {{Keypress|Alt}} 键,这个键值可以在config.h中定义。<br />
<br />
====关闭窗口====<br />
关闭当前的活动窗口: {{Keypress|Shift}} + {{Keypress|Mod1}} + {{Keypress|C}}.<br />
<br />
====窗口布局====<br />
dwm缺少工作在平铺模式。当新窗口不断出现在同一个标签页时,窗口会越来越小。所有窗口会占满整个屏幕(除了目录条)。然而还有其他两种模式:浮动和单页模式。浮动模式对非平铺窗口管理器用户来说更熟悉,它允许用户重新按自己需要摆放窗口。单页模式会让一个窗口在最上边。<br />
<br />
要切换到浮动模式,只需要按{{Keypress|Mod1}} + {{Keypress|F}}。{{Keypress|Mod1}}缺省是 {{Keypress|Alt}}。如果你看到标签页右上角有X>这样的标志,就进行了浮动模式。<br />
<br />
切换到单页模式,按 {{Keypress|Mod1}} + {{Keypress|M}}。检查上否在单页模式,你会看到[M]标志(如果当前标签页无窗口),或者[n](n是打开窗口的编号)。<br />
<br />
回来平铺模式,按{{Keypress|Mod1}} + {{Keypress|T}},你会看到 []= 这样的标志。<br />
<br />
===退出dwm===<br />
退出dwm(登出): {{Keypress|Shift}} + {{Keypress|Mod1}} + {{Keypress|Q}}.<br />
<br />
官方关于默认的快捷键的说明: [http://dwm.suckless.org/tutorial dwm tutorial].<br />
<br />
再次说明,快捷键可以根据自己的喜好自由定义,本维基中的快捷键都是指官方默认的快捷键。<br />
<br />
==扩展使用==<br />
<br />
===补丁和增加的窗口布局(tiling modes)===<br />
The official website has a number of [http://www.suckless.org/dwm/patches patches] that can add extra functionality to dwm. Users can easily customize dwm by applying the modifications they like. The [http://www.suckless.org/dwm/patches/bottom_stack.html Bottom Stack] patch provides an additional tiling mode that splits the screen horizontally, as opposed to the default vertically oriented tiling mode. Similarly, bstack horizontal splits the tiles horizontally. <br />
<br />
The [http://dwm.suckless.org/patches/gapless_grid gaplessgrid patch] allows windows to be tiled like a grid.<br />
<br />
====实现为每个标签定制布局====<br />
dwm的缺省行为是将当前选定的布局应用到所有标签上。如果想为每个标签定制布局可以打[http://dwm.suckless.org/patches/pertag pertag]这个补丁。<br />
<br />
===解决模拟终端窗口缝隙问题===<br />
如果你发现模拟终端(例如xterm,Urxvt)的窗口占不满屏幕,这是因为其窗口的大小和字体有关。你可以试图调整字体大小直到恰好合适为止(这也许是很困难的),或者只需要把{{filename|config.h}} 文件中的 {{Codeline|resizehints}} 设置为 False:<br />
static Bool resizehints = False; /* False means respect size hints in tiled resizals */<br />
<br />
这样dwm会忽略所有窗口的改变大小的请求,不只是模拟终端的。这样的缺点是一些模拟终端可能会刷新异常,像显示一些错误的内容。<br />
<br />
====Urxvt====<br />
对于 [[urxvt]] 用户另一个方法是打 [[urxvt#Fix maximized window gaps|hints patch]] 这个补丁然后将dwm改回到默认的选项:<br />
static Bool resizehints = '''True''';<br />
<br />
===在不登出和退出程序程序的情况下重启dwm===<br />
如果你要在在线重启dwm(不关闭它以及其他应用程序),修改启动脚本,并让dwm在一个while循环中运行,像这样:<br />
<pre><br />
while true; do<br />
# Log stderror to a file <br />
dwm 2> ~/.dwm.log<br />
# No error logging<br />
#dwm >/dev/null 2>&1<br />
done<br />
</pre><br />
<br />
这样就可以用Mod-Shift-Q快捷键来实现重启。<br />
<br />
把上边的内容写到一个其他的文件(例如{{Filename|~/bin/startdwm}})是一个好主意。然后在 {{filename|~/.xinitrc}} 文件里添加(exec startdwm)。这样我们可以使用 {{Codeline|killall startdwm}} 来真正地退出X会话,或者绑定到一个方便的快捷键上。<br />
<br />
===把右Alt键作为Mod4(Win键)使用===<br />
当把Mod4(Win键)作为 {{codeline|MODKEY}} 时,你可能希望右Alt键也可以作为Mod4,这样就两个手都可以按到了<br />
<br />
首先,找到右Ctrl键对应的键码:<br />
xmodmap -pke | grep Alt_R<br />
<br />
然后只需要在启动脚本(比如 {{filename|~/.xinitrc}})添加如下内容, 把 ''113'' 换成之前{{codeline|xmodmap}} 的结果:<br />
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L<br />
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group<br />
<br />
现在,右Alt键就和Mod4键一样了。<br />
<br />
===防止鼠标下的程序自动获取焦点===<br />
为了防止鼠标下的程序自动获取焦点,可以注释掉dwm.c中的如下代码:<br />
<pre>[EnterNotify] = enternotify, </pre><br />
<br />
===添加个性的快捷键绑定===<br />
{{filename|config.h}} 文件中的两个地方涉及到创建修改快捷键,一个是"/* */" 注释中,并一个是"static Key keys[] = {"语句中。<br />
<br />
static const char *<keybindname>[] = { "<command>", "<flags>", "<arguments>", NULL };<br />
<br />
<keybindname> 可以是任何东西, <command> <-flags> and <arguments> 也是,但要用双引号括起来。<br />
<br />
{ MODKEY, XK_<key>, spawn, {.v = <keybindname> } },<br />
<br />
这会绑定 Mod+<key> 来执行之前定义的命令。<br />
<br />
{ MODKEY|ShiftMask, XK_<key>, spawn, {.v = <keybindname> } },<br />
<br />
这会绑定 Mod+Shift+<key> ,使用要用Ctrl键是 ControlMask 。<br />
<br />
单个按键像Fn或者多媒体键必须要用16进制数来表示,可以用xev程序来获得。或者查看 /usr/include/X11/XF86keysym.h 中的定义。<br />
<br />
{ 0, 0xff00, spawn, {.v = <keybindname> } },<br />
<br />
这会把0xff00键绑定到<keybindname>。<br />
<br />
===解决Java程序不正常的问题===<br />
<br />
对于使用JRE 6u20的Java程序在dwm中可能表现异常,因为dwm不是Java的一个已知的窗口管理器,这会导致一些像鼠标释放使菜单消失之类的小问题。可以先安装里的 [community] 里的wmname:<br />
# pacman -S wmname<br />
<br />
然后你只需要用wmname来设置一个Java能识别的WM名称:<br />
$ wmname LG3D<br />
<br />
这不是永久的,所以你可以把它写进.xinitrc。<br />
<br />
==资源==<br />
* [http://www.suckless.org/dwm dwm's official website]<br />
* [[dmenu]] - Simple application launcher from the developers of dwm<br />
* The [http://bbs.archlinux.org/viewtopic.php?id=57549/ dwm thread] on the forums<br />
* [http://bbs.archlinux.org/viewtopic.php?id=92895/ Hacking dwm thread]<br />
* Check out the forums' [http://bbs.archlinux.org/viewtopic.php?id=57768/ wallpaper thread] for a selection of dwm wallpapers<br />
* [http://www.xsnake.net/howto/dwm/dwm-eng.php HowTo by Snake]<br />
* [http://0x80.org/blog/?p=72 Moved to dwm]</div>Ly50247https://wiki.archlinux.org/index.php?title=Arch_compared_to_other_distributions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=136125Arch compared to other distributions (简体中文)2011-04-07T13:33:28Z<p>Ly50247: 翻译 Arch 与 Fedora</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
{{i18n|Arch Compared to Other Distributions}}<br />
{{Article summary start|概述}}<br />
{{Article summary text|Arch Linux 和其他流行 GNU/Linux 发行版和BSDs的简明比较。}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch Linux}}<br />
{{Article summary wiki|The Arch Way}}<br />
{{Article summary heading|外部链接}}<br />
{{Article summary link|DistroWatch.com|http://distrowatch.com/}}<br />
{{Article summary end}}<br />
<br />
本文试图将 ArchLinux 和其他流行的 GNU/Linux 发行版和类UNIX系统作一个比较。下面的总结很简洁,但可以帮您决定 Arch Linux 是否符合自己的需求。尽管评论和叙述有一定作用,但亲身体验总是比较发行版的最好方法。<br />
<br />
==基于源码的发行版==<br />
基于源码的发行版是可度便捷的,拥有根据自己的机器架构和使用方案最优地控制和编译整个系统和所有软件的优势,但劣势是要在源码编译上消耗大量时间。Arch 的基础和所有软件包都为i686和x86-64平台编译,从而相比基于i386/i486/i586二进制包的发行版,更充分发挥硬件的性能优势。<br />
<br />
===ArchLinux 与 Gentoo===<br />
Arch Linux 和 Gentoo Linux 都是滚动升级的发行版,在上游软件发布后很短时间就制作完成可用的软件包。Gentoo的包和基本系统是直接从源码根据用户指定的USE标识构建。尽管Arch 基本系统被设计为安装预编译的 i686/x86_64 二进制包,它也提供类 ports 系统来从源码编译软件。这样 Arch 更易于构建和升级,而 Gentoo 更易于完全得定制。Arch 只支持 i686 和 x86_64 ,而 Gentoo 对 x86, ppc, sparc, alpha, amd64, arm, mips, hppa, s390, sh, 和 itanium架构提供官方支持。因为 Gentoo 和 Arch 的安装环境都只包含基本系统,二都都被认为是高度可定制的。Gentoo 用户会从 Arch 的大多数方面感到满意。<br />
<br />
=== Arch 与 Sorcerer/Lunar-Linux/Source Mage ===<br />
Sorcerer/Lunar-Linux/Source Mage (SLS)都是基于源码的发行版,它们最开始的时候都是有联系的。SLS使用一套非常简单的脚本文件来创建包描述,使用一个全局配置文件来配置编译过程,这很像 Arch 的[[Arch Build System]](ABS系统)。SLS工具提供完全依赖检查(包括处理可选特性)和包的跟踪、删除以及升级。SLS不提供二进制的包,但是它能很容易的回滚到以前安装的包。<br />
<br />
安装过程包括从文本和ncurses菜单配置一个简单基本系统,然后重新编译这个基本系统(可选)。和 Arch 一样,它们不提供缺省的WM/DE/DM(窗口管理器,桌面环境,桌面管理器),在安装时也没有安装Xorg。但是它们提供一种很简单的方法来安装可选的几个X server(包括X.Org 6.8或7, XFree86)。<br />
<br />
SLS的历史非常复杂。关于它是最好记录可以在这里找到:[http://wiki.sourcemage.org/SourceMage/History the SourceMage wiki]。<br />
<br />
相关链接:<br />
<br />
[http://lunar-linux.org/ Lunar Linux]<br />
<br />
[http://www.sourcemage.org/ SourceMage]<br />
<br />
[http://sorcerer.berlios.de/ Sorcerer]<br />
<br />
==极简派(Minimalist)==<br />
<br />
极简派发行版和 Arch 有相当的可比性,有一些共同之处。从技术层面都强调简洁的重要性。<br />
<br />
=== Arch 与 LFS ===<br />
LFS(Linux From Scratch), 是最个性化的系统,她不是一个发行版,只以文档形式存在。文档指导用户获得用于构建一个实用 GNU/Linux 系统的最少的基础源码包,以及如何手动编译(包括打补丁和配置编译选项等)。LFS就是这样小巧,并且提供优秀和富指导性的构建基本系统的过程。<br />
<br />
Arch基本系统同样提供这些软件包(为 i686/x86-64 优化),以及BSD风格的启动脚本、一些额外的辅助工具和功能强大的 [[pacman]] 包管理工具。LFS 并不提供在线软件仓库,源码要手动获取、编译和安装(使用 make )。(也存在一些手动的包管理方法,在 LFS 手册有提及。)基于Arch基本系统,社区和开发者提供并管理数以千计可供 pacman 安装的二进制包以及 [[Arch Build System]] 使用的 [[PKGBUILD]] 脚本。Arch 同时也包括 [[makepkg]] 工具用来方便地生成 {{Filename|.pkg.tar.xz}} 格式的软件包,然后可以用 pacman 安装。<br />
<br />
Judd Vinet从源码构建 ArchLinux,并用C写下 [[pacman]] 。历史原因,Arch 有时被人们形容成“带有一个优秀包管理系统的Linux“(Linux, with a nice package manager)。<br />
<br />
===Arch 与 CRUX===<br />
<br />
Arch是单独开发的,而不是基于其他任何 GNU/Linux 发行版。在构建 Arch 之前,Judd Vinet 使用并称赞 CRUX(Per Lidén构建的轻量级发行版)。最初的灵感和CRUX是相同的, Arch从源码构建,之后有了用C写成的 [[pacman]]。它们有着相同的指导原则,比如二者都对硬件架构优化,最小化并符合K.I.S.S原则。二者都有类ports系统,使用*BSD风格的初始化系统,而且像*BSD一样都提供可扩展的最小基本环境。[[pacman]] 是 Arch 的一大特色,它用来管理系统中的二进制包,并能很好地与 [[Arch Build System]] 协同工作。CRUX 用一个社区开发的 prt-get来配合自己的ports系统来处理依赖关系,但包是从源码生成的(尽管 CRUX 基本安装环境是二进制的)。Arch 只提供对 x86-64 和 i686 的官方支持,而 CURUX 有官方支持的i686以及社区开发的 x86-64、ppc 和 ppc64。<br />
<br />
Arch 使用滚动升级系统并提供大量二进制包和 [[Arch User Repository]]。相比之下 CRUX 提供一个缺乏官方支持的 ports 系统和比较逊色的软件仓库。<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?pid=133721#p133721 这个论坛的帖子]陈述了一位用户对这两个发行版的观点。<br />
<br />
===Arch 与 Slackware===<br />
Slackware 和 Arch 很相似,二者都是小巧优雅的发行版。Slackware以约束少和从内核开始的朴素的包著名。Arch 只有在避免出现严重问题或保证顺利打包时才使用补丁。两者都使用BSD 的初始化脚本。Arch 有一个健壮的包管理系统 [[pacman]]。与Slackware的标准工具不同,它可以自己处理依赖关系并提供更自动化的系统升级方式。Slackware用户更倾向于手动处理依赖关系,以尽可能控制自己的系统。Slackware也对预编译的库和依赖提供杰出的支持。Arch 是一个滚动升级的系统,Slackware的发布更为保守,更喜欢提供稳定的软件包。在这个方面,Arch更为“前卫”。Arch 软件仓库提供成千上万的二进制包,而相对之下Slackware的更为逊色。Arch提供 [[Arch Build System]](一个类ports系统)和[[AUR]](用户贡献的数以万计的PKGBUILD)。 Slackware提供一个相似的系统 [http://www.slackbuilds.org slackbuilds.org],它是半官方支持的Slackbuilds(和PKGBUILD相似)仓库。Slackware用户一般会对Arch的多数方面感到满意。<br />
<br />
==Arch 与 其他图形化的发行版==<br />
图形化的发行版之间有许多相同之处,而Arch和他们其中的任何一个都非常的不同。 Arch 是个基于文本和面向命令行的。 如果想真正学习Linux,Arch是个更好的选择。图形化的发行版往往装备有GUI安装器(像Fedora的Anaconda)和GUI的系统配置工具(像Suse的Yast)。特殊的不同之处在下面描述。<br />
<br />
=== Arch 与 Debian GNU/Linux===<br />
<br />
Debian 是一个更大的项目和社区,提供稳定、测试和不稳定分支,包含超过二千的二进制包。Arch不像Debian那样把包分成“-dev”和“-common”,因此Arch的软件仓库看起来更小。Debian 对自由软件更热情。Arch对GNU定义的非自由('non-free')包更显宽容。Debian更注重于稳定性并经过充分测试,而Arch更注重于简洁、小巧和提供最新软件。Arch的包去Debian Stable 和 Testing 中的更新,和 unstable里的差不多。Debian 和 Arch 都提供很好的包管理系统。Arch 滚动升级,而 Debian Stable 采用“固定”的包发行。Debian 支持许多架构,包括alpha, arm, hppa, i386, x86_64, ia64, m68k, mips, mipsel, powerpc, s390 和 sparc,而 Arch 只支持i686 和 x86_64。<br />
Arch 对从源码创建包提供更好的支持,有一个类ports系统。Debian 不提供ports系统,只依靠着包数量庞大的软件仓库。Arch安装环境只提供最小的基本系统,编辑文本文件来配置系统,而Debian的方式更为自动化,另外还提供多种安装方式。Debian使用SysVinit,而Arch使用类*BSD风格init。Arch只在迫不得已时才打补丁。<br />
<br />
=== Arch与 Ubuntu===<br />
<br />
Ubuntu是一个非常流行的基于Debian的发行版,由Canonical公司提供商业支持,而Arch是从源码创建的独立发行版。两个项目有非常不同的目标并面向不同的用户群体。Arch为那些渴望自己用手的用户设计,而Ubuntu提供自动配置好了的系统面向“所有”的用户。如果你想快速安装使用而不作过多修改的话,Ubuntu更适合你。Arch以很小的基本系统提供给用户,很大程序上依靠用户按自己的需求定制。一般来说,开发者和用手能力强更喜欢Arch,尽管很多Arch用户最初用的是Ubuntu后来转而使用Arch。Ubuntu每6个月发行一个新版本,而Arch是滚动升级的。Arch提供类ports包构建系统( [[Arch Build System]])而Ubuntu没有。这两个社区也有不尽相同,Arch社区更小,强烈鼓励用户为Arch奉献一份力量。而相反,Ubuntu社区很大,并能容忍其中许多实际上并未为开发、打包和维护作贡献的用户。<br />
<br />
===Arch 与 Fedora===<br />
<br />
Fedora由社区开发,并由Red Hat提供财力支持,是目前最流行的发行版之一。它是一个很激进的测试的发行版,它的包和工程将被迁移到RHEL,基本一些最终被其他发行版所接受。Arch同样也被认为是有些激进的,尽管它是滚动升级而且不是另一个发行版的测试分支。Fedora以一个庞大社区而骄傲,有很多预编译包和完美的技术支持。Fedora的包是RPM格式的,使用YUM包管理器,并有一个官方的图形界面工具(Packagekit)。 Arch使用[[pacman]]去管理简单的tar包并且不对图形前端提供官方支持。Fedora拒绝包含MP3和一些其他媒体支持因为它只包含自由软件,尽管有第三方的仓库。Arch在这方面限制更少,把选择的权利留给用户。Fedora有图形和文本两种安装环境,提供一个默认包含一些软件的桌面环境,用户以以此为基础进行配置。Archk只提供基于ncurses的最小系统安装环境。Fedora有计划的发行周期,并提供版本升级。Arch滚动升级。Arch更注重简洁、轻量和灵活,而Fedora更注重社区开发和系统级的创新。<br />
Arch有一个ports系统,而Fedora没有。Arch和Fedora有很鼓励社区人员为开发作贡献。Fedora社区在SELinux整合、GCJ编译包(不需要Sun的JRE)和很多上游软件上作出不少贡献。<br />
<br />
===Arch 与 Mandriva===<br />
<br />
Mandriva Linux(前身为 Mandrake Linux)创建于1998年,目标是使GNU/Linux对于每个人都易于使用。它使用基于RPM包,使用urpmi包管理软件。它与Arch的目标用户不尽相同。<br />
<br />
===Arch 与 openSUSE===<br />
openSUSE使用RPM包格式并以YaST2图形化配置工具著名,YaST2对大多数用户提供一站式配置管理(包括包管理)。Arch不提供这样的工具,因为它违背了[[The Arch Way]]。<br />
然而openSUSE大多为认为对新手(或者更喜欢图形界面、自动化配置和开箱即用的用户)更为友好。<br />
<br />
==与BSD系列的对比==<br />
===Arch vs FreeBSD===<br />
BSDs 起源于伯克利Unix. http://www.freebsd.org/about.html 因此Freebsd不是一个Linux发行版. 软件可以使用二进制或通过'ports'从源代码安装。BSD自我宣称它不仅仅是一个作为整体上的系统,并且会确认每个被移植到FreeBSD上的程序是否能工作正常。像Arch一样,软件包差不多是最新的。这大概是Arch最有意思的竞争者,因为它也醉心于追逐新软件,并且有一个规模比较可观,才华横溢,活跃和严肃的社区。其中其pkg部分,近似于arch的pacman,其port部分,近似于arch的abs,但好像因为其严谨,而缺乏类似arch的aur的东西。<br />
<br />
===Arch vs NetBSD===<br />
NetBSD名称来源于其发起和发展主要靠网络,它是一个自由,安全并且具有高度可移植性的类UNIX开源操作系统,从64位的Opteron机器和桌面系统到手持和嵌入式设备,它支持超过70种平台,可以说是支持平台最多的一个发行版,但它为了可移植性,不可避免牺牲了部分平台的功力,从而无法充分发挥特定平台的全部潜力。它设计简洁,并且那些高级特性使它同时成为优异的生产和研究环境,它也提供给用户所有的源代码。许多应用程序轻易地可以通过pkgsrc来获得,它就是NetBSD软件包集合。Arch不会像NetBSD那样可以用在那么多的设备上,但是对i686平台它会提供更多的应用程序。而且默认的pkgsrc安装方法是先取得软件包的源码再进行编译,而Arch是直接提供二进制软件包。Arch和NetBSD之间有很多相似之处;它们都使用/etc/rc.conf作为主配置文件,它们非常精简和轻巧,它们都提供ports系统和二进制软件,它们都有活跃,严谨的开发和社区。Arch还从*BSD那里借鉴了它的init系统的概念。<br />
<br />
===Arch vs OpenBSD===<br />
OpenBSD是个极端追求安全性的操作系统,自我宣称“大概是头等安全的操作系统“。它也是一个自由,用于多个平台的基于4.4BSD的类UNIX操作系统。相比之下,Arch更专注于简单,优美,精巧和最新的软件。OpenBSD支持大多数程序的二进制仿真,它们来自SVR4(Solaris),FreeBSD, GNU/Linux, BSD/OS, SunOS and HP-UX. 和Arch一样,OpenBSD提供了一个小而优美的基本安装并且使用一个ports系统和软件包系统来允许进行容易的安装和管理非基本系统的软件包。GNU/Linux系统比如说Arch,它和大多数基于BSD的操作系统一样,OpenBSD内核和用户空间的程序,比如说shell和常见的工具(像ls,cp,cat和ps),它们被开发成在单一的源代码仓库中。<br />
目前BSD系列对硬件支持都集中在服务器,对普通电脑的支持相对落后于Linux,而且,软件交流社区也仍然集中在服务器领域,对桌面用户的交流比较弱势,不太适合桌面用户。<br />
<br />
==与其他的对比==<br />
===Arch 与 Zenwalk===<br />
Zenwalk是从Slackware衍生的,但是它更方便和现代。Arch和Zenwalk一个很大的不同是Zenwalk安装的包是开发者已经选好的。如果你喜欢他们的选择,这会节省你的时间,但如果你想有其他选择,这就成它的不便之处了。<br />
<br />
===Arch vs Gobolinux===<br />
Gobolinux 有一个独特的无为而治的包管理方法。其文件系统被组织成应用程序全部位于 /Programs 目录,并且通过符号链接使用。删除程序X只需 rm -rf /Programs/X http://www.gobolinux.org/index.php?page=at_a_glance<br />
It does not seem to focus on i686 binaries and does allow source-based package installs.<br />
其并不是针对i686平台优化的二进制程序,允许基于源码的软件安装。<br />
<br />
===Arch vs Minix 3===<br />
Arch 是一个拥有现代社区和硬件支持的完整发行版。Minix 3 是一个有一些有趣特性的微小而不稳定的高级研究用操作系统,例如用于 [http://en.wikipedia.org/wiki/Microkernel microkernel]。 http://www.minix3.org/<br />
<br />
===Arch 与 Frugalware===<br />
Arch 基于文本界面并且面向命令行操作, 而 Frugalware 提供了更佳的多语言支持. 同时 Frugalware 也提供了更多的本地化文档. 虽然同样使用 packman, 但是它们的包并不完全兼容. Frugalware 默认不支持 JFS 文件系统. Frugalware 不再基于 Slackware,更像是一个独立的发行版,并且它基于 i686 架构。<br />
<br />
===Arch 与 Rock===<br />
<br />
来自这篇介绍:http://www.rocklinux.org/wiki/About<br />
<br />
ROCK Linux是一个用来打造Linux发行版的灵活的开发工具包,即打造你自己的Linux发行版可用的工具链或框架。这个你也可以参考我们的目标描述。<br />
<br />
如果你不想打造你自己的Linux发行版,而只是对一个具有多用途的好的发行版感兴趣,你或许可以看一下 http://www.rocklinux.org/wiki/Crystal_ROCK<br />
<br />
它是一个作为开发工具而生的发行版。和Arch相比,它有和其他基于源码的发行版一样的问题,如编译所需的时间等。它可以运行在多种处理器上如SPARC, ARM等。<br />
<br />
===Arch 与 T2===<br />
来自FAQ http://www.t2-project.org/faq/<br />
<br />
问题:既然已经有Gentoo了为什么还需要T2?<br />
回答:T2,或者更精确的说,它的前身ROCK Linux,它在1998年就启动了,比Gentoo早几个月,而且比Gentoo更早在freshmeat注册--所以,这个问题如果能反过来问或许更好。<br />
同样,在技术方面T2支持商业强度的开发,坚持目标,交互编译,可选的嵌入式C开发库和多引导系统可选择。T2的包通常不包括任何代码,它是基于key-value的文本文件,这使得包的工作和更新在T2上非常快。<br />
Arch使用为i686优化的二进制包(由于不需要编译所有的东西,所以很快)来和T2竞争。T2在技术实力方面是一个强有力的竞争者。由于它能用于嵌入式设备,它有可能在某些应用方面击败Arch。T2值得关注。</div>Ly50247https://wiki.archlinux.org/index.php?title=Arch_compared_to_other_distributions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135542Arch compared to other distributions (简体中文)2011-04-01T09:22:21Z<p>Ly50247: /* Arch 与 Fedora */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
{{i18n|Arch Compared to Other Distributions}}<br />
{{Article summary start|概述}}<br />
{{Article summary text|Arch Linux 和其他流行 GNU/Linux 发行版和BSDs的简明比较。}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch Linux}}<br />
{{Article summary wiki|The Arch Way}}<br />
{{Article summary heading|外部链接}}<br />
{{Article summary link|DistroWatch.com|http://distrowatch.com/}}<br />
{{Article summary end}}<br />
<br />
本文试图将 ArchLinux 和其他流行的 GNU/Linux 发行版和类UNIX系统作一个比较。下面的总结很简洁,但可以帮您决定 Arch Linux 是否符合自己的需求。尽管评论和叙述有一定作用,但亲身体验总是比较发行版的最好方法。<br />
<br />
==基于源码的发行版==<br />
基于源码的发行版是可度便捷的,拥有根据自己的机器架构和使用方案最优地控制和编译整个系统和所有软件的优势,但劣势是要在源码编译上消耗大量时间。Arch 的基础和所有软件包都为i686和x86-64平台编译,从而相比基于i386/i486/i586二进制包的发行版,更充分发挥硬件的性能优势。<br />
<br />
===ArchLinux 与 Gentoo===<br />
Arch Linux 和 Gentoo Linux 都是滚动升级的发行版,在上游软件发布后很短时间就制作完成可用的软件包。Gentoo的包和基本系统是直接从源码根据用户指定的USE标识构建。尽管Arch 基本系统被设计为安装预编译的 i686/x86_64 二进制包,它也提供类 ports 系统来从源码编译软件。这样 Arch 更易于构建和升级,而 Gentoo 更易于完全得定制。Arch 只支持 i686 和 x86_64 ,而 Gentoo 对 x86, ppc, sparc, alpha, amd64, arm, mips, hppa, s390, sh, 和 itanium架构提供官方支持。因为 Gentoo 和 Arch 的安装环境都只包含基本系统,二都都被认为是高度可定制的。Gentoo 用户会从 Arch 的大多数方面感到满意。<br />
<br />
=== Arch 与 Sorcerer/Lunar-Linux/Source Mage ===<br />
Sorcerer/Lunar-Linux/Source Mage (SLS)都是基于源码的发行版,它们最开始的时候都是有联系的。SLS使用一套非常简单的脚本文件来创建包描述,使用一个全局配置文件来配置编译过程,这很像 Arch 的[[Arch Build System]](ABS系统)。SLS工具提供完全依赖检查(包括处理可选特性)和包的跟踪、删除以及升级。SLS不提供二进制的包,但是它能很容易的回滚到以前安装的包。<br />
<br />
安装过程包括从文本和ncurses菜单配置一个简单基本系统,然后重新编译这个基本系统(可选)。和 Arch 一样,它们不提供缺省的WM/DE/DM(窗口管理器,桌面环境,桌面管理器),在安装时也没有安装Xorg。但是它们提供一种很简单的方法来安装可选的几个X server(包括X.Org 6.8或7, XFree86)。<br />
<br />
SLS的历史非常复杂。关于它是最好记录可以在这里找到:[http://wiki.sourcemage.org/SourceMage/History the SourceMage wiki]。<br />
<br />
相关链接:<br />
<br />
[http://lunar-linux.org/ Lunar Linux]<br />
<br />
[http://www.sourcemage.org/ SourceMage]<br />
<br />
[http://sorcerer.berlios.de/ Sorcerer]<br />
<br />
==极简派(Minimalist)==<br />
<br />
极简派发行版和 Arch 有相当的可比性,有一些共同之处。从技术层面都强调简洁的重要性。<br />
<br />
=== Arch 与 LFS ===<br />
LFS(Linux From Scratch), 是最个性化的系统,她不是一个发行版,只以文档形式存在。文档指导用户获得用于构建一个实用 GNU/Linux 系统的最少的基础源码包,以及如何手动编译(包括打补丁和配置编译选项等)。LFS就是这样小巧,并且提供优秀和富指导性的构建基本系统的过程。<br />
<br />
Arch基本系统同样提供这些软件包(为 i686/x86-64 优化),以及BSD风格的启动脚本、一些额外的辅助工具和功能强大的 [[pacman]] 包管理工具。LFS 并不提供在线软件仓库,源码要手动获取、编译和安装(使用 make )。(也存在一些手动的包管理方法,在 LFS 手册有提及。)基于Arch基本系统,社区和开发者提供并管理数以千计可供 pacman 安装的二进制包以及 [[Arch Build System]] 使用的 [[PKGBUILD]] 脚本。Arch 同时也包括 [[makepkg]] 工具用来方便地生成 {{Filename|.pkg.tar.xz}} 格式的软件包,然后可以用 pacman 安装。<br />
<br />
Judd Vinet从源码构建 ArchLinux,并用C写下 [[pacman]] 。历史原因,Arch 有时被人们形容成“带有一个优秀包管理系统的Linux“(Linux, with a nice package manager)。<br />
<br />
===Arch 与 CRUX===<br />
<br />
Arch是单独开发的,而不是基于其他任何 GNU/Linux 发行版。在构建 Arch 之前,Judd Vinet 使用并称赞 CRUX(Per Lidén构建的轻量级发行版)。最初的灵感和CRUX是相同的, Arch从源码构建,之后有了用C写成的 [[pacman]]。它们有着相同的指导原则,比如二者都对硬件架构优化,最小化并符合K.I.S.S原则。二者都有类ports系统,使用*BSD风格的初始化系统,而且像*BSD一样都提供可扩展的最小基本环境。[[pacman]] 是 Arch 的一大特色,它用来管理系统中的二进制包,并能很好地与 [[Arch Build System]] 协同工作。CRUX 用一个社区开发的 prt-get来配合自己的ports系统来处理依赖关系,但包是从源码生成的(尽管 CRUX 基本安装环境是二进制的)。Arch 只提供对 x86-64 和 i686 的官方支持,而 CURUX 有官方支持的i686以及社区开发的 x86-64、ppc 和 ppc64。<br />
<br />
Arch 使用滚动升级系统并提供大量二进制包和 [[Arch User Repository]]。相比之下 CRUX 提供一个缺乏官方支持的 ports 系统和比较逊色的软件仓库。<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?pid=133721#p133721 这个论坛的帖子]陈述了一位用户对这两个发行版的观点。<br />
<br />
===Arch 与 Slackware===<br />
Slackware 和 Arch 很相似,二者都是小巧优雅的发行版。Slackware以约束少和从内核开始的朴素的包著名。Arch 只有在避免出现严重问题或保证顺利打包时才使用补丁。两者都使用BSD 的初始化脚本。Arch 有一个健壮的包管理系统 [[pacman]]。与Slackware的标准工具不同,它可以自己处理依赖关系并提供更自动化的系统升级方式。Slackware用户更倾向于手动处理依赖关系,以尽可能控制自己的系统。Slackware也对预编译的库和依赖提供杰出的支持。Arch 是一个滚动升级的系统,Slackware的发布更为保守,更喜欢提供稳定的软件包。在这个方面,Arch更为“前卫”。Arch 软件仓库提供成千上万的二进制包,而相对之下Slackware的更为逊色。Arch提供 [[Arch Build System]](一个类ports系统)和[[AUR]](用户贡献的数以万计的PKGBUILD)。 Slackware提供一个相似的系统 [http://www.slackbuilds.org slackbuilds.org],它是半官方支持的Slackbuilds(和PKGBUILD相似)仓库。Slackware用户一般会对Arch的多数方面感到满意。<br />
<br />
==Arch 与 其他图形化的发行版==<br />
图形化的发行版之间有许多相同之处,而Arch和他们其中的任何一个都非常的不同。 Arch 是个基于文本和面向命令行的。 如果想真正学习Linux,Arch是个更好的选择。图形化的发行版往往装备有GUI安装器(像Fedora的Anaconda)和GUI的系统配置工具(像Suse的Yast)。特殊的不同之处在下面描述。<br />
<br />
=== Arch 与 Debian GNU/Linux===<br />
<br />
Debian 是一个更大的项目和社区,提供稳定、测试和不稳定分支,包含超过二千的二进制包。Arch不像Debian那样把包分成“-dev”和“-common”,因此Arch的软件仓库看起来更小。Debian 对自由软件更热情。Arch对GNU定义的非自由('non-free')包更显宽容。Debian更注重于稳定性并经过充分测试,而Arch更注重于简洁、小巧和提供最新软件。Arch的包去Debian Stable 和 Testing 中的更新,和 unstable里的差不多。Debian 和 Arch 都提供很好的包管理系统。Arch 滚动升级,而 Debian Stable 采用“固定”的包发行。Debian 支持许多架构,包括alpha, arm, hppa, i386, x86_64, ia64, m68k, mips, mipsel, powerpc, s390 和 sparc,而 Arch 只支持i686 和 x86_64。<br />
Arch 对从源码创建包提供更好的支持,有一个类ports系统。Debian 不提供ports系统,只依靠着包数量庞大的软件仓库。Arch安装环境只提供最小的基本系统,编辑文本文件来配置系统,而Debian的方式更为自动化,另外还提供多种安装方式。Debian使用SysVinit,而Arch使用类*BSD风格init。Arch只在迫不得已时才打补丁。<br />
<br />
=== Arch与 Ubuntu===<br />
<br />
Ubuntu是一个非常流行的基于Debian的发行版,由Canonical公司提供商业支持,而Arch是从源码创建的独立发行版。两个项目有非常不同的目标并面向不同的用户群体。Arch为那些渴望自己用手的用户设计,而Ubuntu提供自动配置好了的系统面向“所有”的用户。如果你想快速安装使用而不作过多修改的话,Ubuntu更适合你。Arch以很小的基本系统提供给用户,很大程序上依靠用户按自己的需求定制。一般来说,开发者和用手能力强更喜欢Arch,尽管很多Arch用户最初用的是Ubuntu后来转而使用Arch。Ubuntu每6个月发行一个新版本,而Arch是滚动升级的。Arch提供类ports包构建系统( [[Arch Build System]])而Ubuntu没有。这两个社区也有不尽相同,Arch社区更小,强烈鼓励用户为Arch奉献一份力量。而相反,Ubuntu社区很大,并能容忍其中许多实际上并未为开发、打包和维护作贡献的用户。<br />
<br />
===Arch 与 Fedora===<br />
<br />
Fedora由社区开发,并由Red Hat提供财力支持,是目前最流行的发行版之一。它是一个很激进的测试的发行版,它的包和工程将被迁移到RHEL,基本一些最终被其他发行版所接受。Arch同样也被认为是有些激进的,尽管它是滚动升级而且不是另一个发行版的测试分支。Fedora以一个庞大社区而骄傲,有很多预编译包和完美的技术支持。Fedora的包是RPM格式的,使用YUM包管理器,并有一个官方的图形界面工具(Packagekit)。 Arch使用[[pacman]] to 去管理简单的tar包并且不对图形前端提供官方支持。 Fedora refuses to include MP3 and other media support due to its dedication to include only free software, though third party repositories are available for such packages. Arch is more lenient in its disposition toward MP3 and free software, leaving the discernment to the user. Fedora offers both a graphical and a text installer which provide a desktop environment including a very modest assortment of default packages to build upon or customize. Arch provides an ncurses-based installer of a minimal base system only. Fedora has a scheduled release cycle, but officially supports version upgrades. Arch is a rolling-release system. The Arch project is geared more toward simplicity, lightweight elegance and empowering the user, whereas Fedora focuses more on community development and systemic innovation. Arch features a ports system, whereas Fedora does not. Both Arch and Fedora communities are strongly encouraged to contribute to project development. Fedora has earned much community recognition for integration of SELinux, GCJ compiled packages (to remove the need for Sun's JRE), and prolific upstream contribution.<br />
<br />
===Arch 与 Mandriva===<br />
<br />
Mandriva Linux(前身为 Mandrake Linux)创建于1998年,目标是使GNU/Linux对于每个人都易于使用。它使用基于RPM包,使用urpmi包管理软件。它与Arch的目标用户不尽相同。<br />
<br />
===Arch 与 openSUSE===<br />
openSUSE使用RPM包格式并以YaST2图形化配置工具著名,YaST2对大多数用户提供一站式配置管理(包括包管理)。Arch不提供这样的工具,因为它违背了[[The Arch Way]]。<br />
然而openSUSE大多为认为对新手(或者更喜欢图形界面、自动化配置和开箱即用的用户)更为友好。<br />
<br />
==与BSD系列的对比==<br />
===Arch vs FreeBSD===<br />
BSDs 起源于伯克利Unix. http://www.freebsd.org/about.html 因此Freebsd不是一个Linux发行版. 软件可以使用二进制或通过'ports'从源代码安装。BSD自我宣称它不仅仅是一个作为整体上的系统,并且会确认每个被移植到FreeBSD上的程序是否能工作正常。像Arch一样,软件包差不多是最新的。这大概是Arch最有意思的竞争者,因为它也醉心于追逐新软件,并且有一个规模比较可观,才华横溢,活跃和严肃的社区。其中其pkg部分,近似于arch的pacman,其port部分,近似于arch的abs,但好像因为其严谨,而缺乏类似arch的aur的东西。<br />
<br />
===Arch vs NetBSD===<br />
NetBSD名称来源于其发起和发展主要靠网络,它是一个自由,安全并且具有高度可移植性的类UNIX开源操作系统,从64位的Opteron机器和桌面系统到手持和嵌入式设备,它支持超过70种平台,可以说是支持平台最多的一个发行版,但它为了可移植性,不可避免牺牲了部分平台的功力,从而无法充分发挥特定平台的全部潜力。它设计简洁,并且那些高级特性使它同时成为优异的生产和研究环境,它也提供给用户所有的源代码。许多应用程序轻易地可以通过pkgsrc来获得,它就是NetBSD软件包集合。Arch不会像NetBSD那样可以用在那么多的设备上,但是对i686平台它会提供更多的应用程序。而且默认的pkgsrc安装方法是先取得软件包的源码再进行编译,而Arch是直接提供二进制软件包。Arch和NetBSD之间有很多相似之处;它们都使用/etc/rc.conf作为主配置文件,它们非常精简和轻巧,它们都提供ports系统和二进制软件,它们都有活跃,严谨的开发和社区。Arch还从*BSD那里借鉴了它的init系统的概念。<br />
<br />
===Arch vs OpenBSD===<br />
OpenBSD是个极端追求安全性的操作系统,自我宣称“大概是头等安全的操作系统“。它也是一个自由,用于多个平台的基于4.4BSD的类UNIX操作系统。相比之下,Arch更专注于简单,优美,精巧和最新的软件。OpenBSD支持大多数程序的二进制仿真,它们来自SVR4(Solaris),FreeBSD, GNU/Linux, BSD/OS, SunOS and HP-UX. 和Arch一样,OpenBSD提供了一个小而优美的基本安装并且使用一个ports系统和软件包系统来允许进行容易的安装和管理非基本系统的软件包。GNU/Linux系统比如说Arch,它和大多数基于BSD的操作系统一样,OpenBSD内核和用户空间的程序,比如说shell和常见的工具(像ls,cp,cat和ps),它们被开发成在单一的源代码仓库中。<br />
目前BSD系列对硬件支持都集中在服务器,对普通电脑的支持相对落后于Linux,而且,软件交流社区也仍然集中在服务器领域,对桌面用户的交流比较弱势,不太适合桌面用户。<br />
<br />
==与其他的对比==<br />
===Arch 与 Zenwalk===<br />
Zenwalk是从Slackware衍生的,但是它更方便和现代。Arch和Zenwalk一个很大的不同是Zenwalk安装的包是开发者已经选好的。如果你喜欢他们的选择,这会节省你的时间,但如果你想有其他选择,这就成它的不便之处了。<br />
<br />
===Arch vs Gobolinux===<br />
Gobolinux 有一个独特的无为而治的包管理方法。其文件系统被组织成应用程序全部位于 /Programs 目录,并且通过符号链接使用。删除程序X只需 rm -rf /Programs/X http://www.gobolinux.org/index.php?page=at_a_glance<br />
It does not seem to focus on i686 binaries and does allow source-based package installs.<br />
其并不是针对i686平台优化的二进制程序,允许基于源码的软件安装。<br />
<br />
===Arch vs Minix 3===<br />
Arch 是一个拥有现代社区和硬件支持的完整发行版。Minix 3 是一个有一些有趣特性的微小而不稳定的高级研究用操作系统,例如用于 [http://en.wikipedia.org/wiki/Microkernel microkernel]。 http://www.minix3.org/<br />
<br />
===Arch 与 Frugalware===<br />
Arch 基于文本界面并且面向命令行操作, 而 Frugalware 提供了更佳的多语言支持. 同时 Frugalware 也提供了更多的本地化文档. 虽然同样使用 packman, 但是它们的包并不完全兼容. Frugalware 默认不支持 JFS 文件系统. Frugalware 不再基于 Slackware,更像是一个独立的发行版,并且它基于 i686 架构。<br />
<br />
===Arch 与 Rock===<br />
<br />
来自这篇介绍:http://www.rocklinux.org/wiki/About<br />
<br />
ROCK Linux是一个用来打造Linux发行版的灵活的开发工具包,即打造你自己的Linux发行版可用的工具链或框架。这个你也可以参考我们的目标描述。<br />
<br />
如果你不想打造你自己的Linux发行版,而只是对一个具有多用途的好的发行版感兴趣,你或许可以看一下 http://www.rocklinux.org/wiki/Crystal_ROCK<br />
<br />
它是一个作为开发工具而生的发行版。和Arch相比,它有和其他基于源码的发行版一样的问题,如编译所需的时间等。它可以运行在多种处理器上如SPARC, ARM等。<br />
<br />
===Arch 与 T2===<br />
来自FAQ http://www.t2-project.org/faq/<br />
<br />
问题:既然已经有Gentoo了为什么还需要T2?<br />
回答:T2,或者更精确的说,它的前身ROCK Linux,它在1998年就启动了,比Gentoo早几个月,而且比Gentoo更早在freshmeat注册--所以,这个问题如果能反过来问或许更好。<br />
同样,在技术方面T2支持商业强度的开发,坚持目标,交互编译,可选的嵌入式C开发库和多引导系统可选择。T2的包通常不包括任何代码,它是基于key-value的文本文件,这使得包的工作和更新在T2上非常快。<br />
Arch使用为i686优化的二进制包(由于不需要编译所有的东西,所以很快)来和T2竞争。T2在技术实力方面是一个强有力的竞争者。由于它能用于嵌入式设备,它有可能在某些应用方面击败Arch。T2值得关注。</div>Ly50247https://wiki.archlinux.org/index.php?title=Arch_compared_to_other_distributions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135539Arch compared to other distributions (简体中文)2011-04-01T09:10:50Z<p>Ly50247: /* Arch 与 基于 RPM 的发行版 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
{{i18n|Arch Compared to Other Distributions}}<br />
{{Article summary start|概述}}<br />
{{Article summary text|Arch Linux 和其他流行 GNU/Linux 发行版和BSDs的简明比较。}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch Linux}}<br />
{{Article summary wiki|The Arch Way}}<br />
{{Article summary heading|外部链接}}<br />
{{Article summary link|DistroWatch.com|http://distrowatch.com/}}<br />
{{Article summary end}}<br />
<br />
本文试图将 ArchLinux 和其他流行的 GNU/Linux 发行版和类UNIX系统作一个比较。下面的总结很简洁,但可以帮您决定 Arch Linux 是否符合自己的需求。尽管评论和叙述有一定作用,但亲身体验总是比较发行版的最好方法。<br />
<br />
==基于源码的发行版==<br />
基于源码的发行版是可度便捷的,拥有根据自己的机器架构和使用方案最优地控制和编译整个系统和所有软件的优势,但劣势是要在源码编译上消耗大量时间。Arch 的基础和所有软件包都为i686和x86-64平台编译,从而相比基于i386/i486/i586二进制包的发行版,更充分发挥硬件的性能优势。<br />
<br />
===ArchLinux 与 Gentoo===<br />
Arch Linux 和 Gentoo Linux 都是滚动升级的发行版,在上游软件发布后很短时间就制作完成可用的软件包。Gentoo的包和基本系统是直接从源码根据用户指定的USE标识构建。尽管Arch 基本系统被设计为安装预编译的 i686/x86_64 二进制包,它也提供类 ports 系统来从源码编译软件。这样 Arch 更易于构建和升级,而 Gentoo 更易于完全得定制。Arch 只支持 i686 和 x86_64 ,而 Gentoo 对 x86, ppc, sparc, alpha, amd64, arm, mips, hppa, s390, sh, 和 itanium架构提供官方支持。因为 Gentoo 和 Arch 的安装环境都只包含基本系统,二都都被认为是高度可定制的。Gentoo 用户会从 Arch 的大多数方面感到满意。<br />
<br />
=== Arch 与 Sorcerer/Lunar-Linux/Source Mage ===<br />
Sorcerer/Lunar-Linux/Source Mage (SLS)都是基于源码的发行版,它们最开始的时候都是有联系的。SLS使用一套非常简单的脚本文件来创建包描述,使用一个全局配置文件来配置编译过程,这很像 Arch 的[[Arch Build System]](ABS系统)。SLS工具提供完全依赖检查(包括处理可选特性)和包的跟踪、删除以及升级。SLS不提供二进制的包,但是它能很容易的回滚到以前安装的包。<br />
<br />
安装过程包括从文本和ncurses菜单配置一个简单基本系统,然后重新编译这个基本系统(可选)。和 Arch 一样,它们不提供缺省的WM/DE/DM(窗口管理器,桌面环境,桌面管理器),在安装时也没有安装Xorg。但是它们提供一种很简单的方法来安装可选的几个X server(包括X.Org 6.8或7, XFree86)。<br />
<br />
SLS的历史非常复杂。关于它是最好记录可以在这里找到:[http://wiki.sourcemage.org/SourceMage/History the SourceMage wiki]。<br />
<br />
相关链接:<br />
<br />
[http://lunar-linux.org/ Lunar Linux]<br />
<br />
[http://www.sourcemage.org/ SourceMage]<br />
<br />
[http://sorcerer.berlios.de/ Sorcerer]<br />
<br />
==极简派(Minimalist)==<br />
<br />
极简派发行版和 Arch 有相当的可比性,有一些共同之处。从技术层面都强调简洁的重要性。<br />
<br />
=== Arch 与 LFS ===<br />
LFS(Linux From Scratch), 是最个性化的系统,她不是一个发行版,只以文档形式存在。文档指导用户获得用于构建一个实用 GNU/Linux 系统的最少的基础源码包,以及如何手动编译(包括打补丁和配置编译选项等)。LFS就是这样小巧,并且提供优秀和富指导性的构建基本系统的过程。<br />
<br />
Arch基本系统同样提供这些软件包(为 i686/x86-64 优化),以及BSD风格的启动脚本、一些额外的辅助工具和功能强大的 [[pacman]] 包管理工具。LFS 并不提供在线软件仓库,源码要手动获取、编译和安装(使用 make )。(也存在一些手动的包管理方法,在 LFS 手册有提及。)基于Arch基本系统,社区和开发者提供并管理数以千计可供 pacman 安装的二进制包以及 [[Arch Build System]] 使用的 [[PKGBUILD]] 脚本。Arch 同时也包括 [[makepkg]] 工具用来方便地生成 {{Filename|.pkg.tar.xz}} 格式的软件包,然后可以用 pacman 安装。<br />
<br />
Judd Vinet从源码构建 ArchLinux,并用C写下 [[pacman]] 。历史原因,Arch 有时被人们形容成“带有一个优秀包管理系统的Linux“(Linux, with a nice package manager)。<br />
<br />
===Arch 与 CRUX===<br />
<br />
Arch是单独开发的,而不是基于其他任何 GNU/Linux 发行版。在构建 Arch 之前,Judd Vinet 使用并称赞 CRUX(Per Lidén构建的轻量级发行版)。最初的灵感和CRUX是相同的, Arch从源码构建,之后有了用C写成的 [[pacman]]。它们有着相同的指导原则,比如二者都对硬件架构优化,最小化并符合K.I.S.S原则。二者都有类ports系统,使用*BSD风格的初始化系统,而且像*BSD一样都提供可扩展的最小基本环境。[[pacman]] 是 Arch 的一大特色,它用来管理系统中的二进制包,并能很好地与 [[Arch Build System]] 协同工作。CRUX 用一个社区开发的 prt-get来配合自己的ports系统来处理依赖关系,但包是从源码生成的(尽管 CRUX 基本安装环境是二进制的)。Arch 只提供对 x86-64 和 i686 的官方支持,而 CURUX 有官方支持的i686以及社区开发的 x86-64、ppc 和 ppc64。<br />
<br />
Arch 使用滚动升级系统并提供大量二进制包和 [[Arch User Repository]]。相比之下 CRUX 提供一个缺乏官方支持的 ports 系统和比较逊色的软件仓库。<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?pid=133721#p133721 这个论坛的帖子]陈述了一位用户对这两个发行版的观点。<br />
<br />
===Arch 与 Slackware===<br />
Slackware 和 Arch 很相似,二者都是小巧优雅的发行版。Slackware以约束少和从内核开始的朴素的包著名。Arch 只有在避免出现严重问题或保证顺利打包时才使用补丁。两者都使用BSD 的初始化脚本。Arch 有一个健壮的包管理系统 [[pacman]]。与Slackware的标准工具不同,它可以自己处理依赖关系并提供更自动化的系统升级方式。Slackware用户更倾向于手动处理依赖关系,以尽可能控制自己的系统。Slackware也对预编译的库和依赖提供杰出的支持。Arch 是一个滚动升级的系统,Slackware的发布更为保守,更喜欢提供稳定的软件包。在这个方面,Arch更为“前卫”。Arch 软件仓库提供成千上万的二进制包,而相对之下Slackware的更为逊色。Arch提供 [[Arch Build System]](一个类ports系统)和[[AUR]](用户贡献的数以万计的PKGBUILD)。 Slackware提供一个相似的系统 [http://www.slackbuilds.org slackbuilds.org],它是半官方支持的Slackbuilds(和PKGBUILD相似)仓库。Slackware用户一般会对Arch的多数方面感到满意。<br />
<br />
==Arch 与 其他图形化的发行版==<br />
图形化的发行版之间有许多相同之处,而Arch和他们其中的任何一个都非常的不同。 Arch 是个基于文本和面向命令行的。 如果想真正学习Linux,Arch是个更好的选择。图形化的发行版往往装备有GUI安装器(像Fedora的Anaconda)和GUI的系统配置工具(像Suse的Yast)。特殊的不同之处在下面描述。<br />
<br />
=== Arch 与 Debian GNU/Linux===<br />
<br />
Debian 是一个更大的项目和社区,提供稳定、测试和不稳定分支,包含超过二千的二进制包。Arch不像Debian那样把包分成“-dev”和“-common”,因此Arch的软件仓库看起来更小。Debian 对自由软件更热情。Arch对GNU定义的非自由('non-free')包更显宽容。Debian更注重于稳定性并经过充分测试,而Arch更注重于简洁、小巧和提供最新软件。Arch的包去Debian Stable 和 Testing 中的更新,和 unstable里的差不多。Debian 和 Arch 都提供很好的包管理系统。Arch 滚动升级,而 Debian Stable 采用“固定”的包发行。Debian 支持许多架构,包括alpha, arm, hppa, i386, x86_64, ia64, m68k, mips, mipsel, powerpc, s390 和 sparc,而 Arch 只支持i686 和 x86_64。<br />
Arch 对从源码创建包提供更好的支持,有一个类ports系统。Debian 不提供ports系统,只依靠着包数量庞大的软件仓库。Arch安装环境只提供最小的基本系统,编辑文本文件来配置系统,而Debian的方式更为自动化,另外还提供多种安装方式。Debian使用SysVinit,而Arch使用类*BSD风格init。Arch只在迫不得已时才打补丁。<br />
<br />
=== Arch与 Ubuntu===<br />
<br />
Ubuntu是一个非常流行的基于Debian的发行版,由Canonical公司提供商业支持,而Arch是从源码创建的独立发行版。两个项目有非常不同的目标并面向不同的用户群体。Arch为那些渴望自己用手的用户设计,而Ubuntu提供自动配置好了的系统面向“所有”的用户。如果你想快速安装使用而不作过多修改的话,Ubuntu更适合你。Arch以很小的基本系统提供给用户,很大程序上依靠用户按自己的需求定制。一般来说,开发者和用手能力强更喜欢Arch,尽管很多Arch用户最初用的是Ubuntu后来转而使用Arch。Ubuntu每6个月发行一个新版本,而Arch是滚动升级的。Arch提供类ports包构建系统( [[Arch Build System]])而Ubuntu没有。这两个社区也有不尽相同,Arch社区更小,强烈鼓励用户为Arch奉献一份力量。而相反,Ubuntu社区很大,并能容忍其中许多实际上并未为开发、打包和维护作贡献的用户。<br />
<br />
===Arch 与 Fedora===<br />
Fedora 是 RedHat 发行版的技术前导版,对新技术的采用非常激进(比arch还激进),但也因此会导致很多不稳定。它有个坚实的社区和许多预先创建好的软件包,还有可获得的商业性技术支持。Fedora因为商业的原因,默认是不提供有专利方面限制的软件的。Fedora有图形界面安装。<br />
Arch使用基于ncurses文字界面安装。Fedora的图形界面设计友好。Arch相对Fedora是更为简单的系统,依赖于用户手动配置。Fedora有固定版本发布周期。Arch是滚动升级系统。Arch的设计理念是面向轻量级优雅,而Fedora目的是测试所引入的新技术,所以更加适合直接针对系统的开发人员。<br />
<br />
===Arch 与 Mandriva===<br />
<br />
Mandriva Linux(前身为 Mandrake Linux)创建于1998年,目标是使GNU/Linux对于每个人都易于使用。它使用基于RPM包,使用urpmi包管理软件。它与Arch的目标用户不尽相同。<br />
<br />
===Arch 与 openSUSE===<br />
openSUSE使用RPM包格式并以YaST2图形化配置工具著名,YaST2对大多数用户提供一站式配置管理(包括包管理)。Arch不提供这样的工具,因为它违背了[[The Arch Way]]。<br />
然而openSUSE大多为认为对新手(或者更喜欢图形界面、自动化配置和开箱即用的用户)更为友好。<br />
<br />
==与BSD系列的对比==<br />
===Arch vs FreeBSD===<br />
BSDs 起源于伯克利Unix. http://www.freebsd.org/about.html 因此Freebsd不是一个Linux发行版. 软件可以使用二进制或通过'ports'从源代码安装。BSD自我宣称它不仅仅是一个作为整体上的系统,并且会确认每个被移植到FreeBSD上的程序是否能工作正常。像Arch一样,软件包差不多是最新的。这大概是Arch最有意思的竞争者,因为它也醉心于追逐新软件,并且有一个规模比较可观,才华横溢,活跃和严肃的社区。其中其pkg部分,近似于arch的pacman,其port部分,近似于arch的abs,但好像因为其严谨,而缺乏类似arch的aur的东西。<br />
<br />
===Arch vs NetBSD===<br />
NetBSD名称来源于其发起和发展主要靠网络,它是一个自由,安全并且具有高度可移植性的类UNIX开源操作系统,从64位的Opteron机器和桌面系统到手持和嵌入式设备,它支持超过70种平台,可以说是支持平台最多的一个发行版,但它为了可移植性,不可避免牺牲了部分平台的功力,从而无法充分发挥特定平台的全部潜力。它设计简洁,并且那些高级特性使它同时成为优异的生产和研究环境,它也提供给用户所有的源代码。许多应用程序轻易地可以通过pkgsrc来获得,它就是NetBSD软件包集合。Arch不会像NetBSD那样可以用在那么多的设备上,但是对i686平台它会提供更多的应用程序。而且默认的pkgsrc安装方法是先取得软件包的源码再进行编译,而Arch是直接提供二进制软件包。Arch和NetBSD之间有很多相似之处;它们都使用/etc/rc.conf作为主配置文件,它们非常精简和轻巧,它们都提供ports系统和二进制软件,它们都有活跃,严谨的开发和社区。Arch还从*BSD那里借鉴了它的init系统的概念。<br />
<br />
===Arch vs OpenBSD===<br />
OpenBSD是个极端追求安全性的操作系统,自我宣称“大概是头等安全的操作系统“。它也是一个自由,用于多个平台的基于4.4BSD的类UNIX操作系统。相比之下,Arch更专注于简单,优美,精巧和最新的软件。OpenBSD支持大多数程序的二进制仿真,它们来自SVR4(Solaris),FreeBSD, GNU/Linux, BSD/OS, SunOS and HP-UX. 和Arch一样,OpenBSD提供了一个小而优美的基本安装并且使用一个ports系统和软件包系统来允许进行容易的安装和管理非基本系统的软件包。GNU/Linux系统比如说Arch,它和大多数基于BSD的操作系统一样,OpenBSD内核和用户空间的程序,比如说shell和常见的工具(像ls,cp,cat和ps),它们被开发成在单一的源代码仓库中。<br />
目前BSD系列对硬件支持都集中在服务器,对普通电脑的支持相对落后于Linux,而且,软件交流社区也仍然集中在服务器领域,对桌面用户的交流比较弱势,不太适合桌面用户。<br />
<br />
==与其他的对比==<br />
===Arch 与 Zenwalk===<br />
Zenwalk是从Slackware衍生的,但是它更方便和现代。Arch和Zenwalk一个很大的不同是Zenwalk安装的包是开发者已经选好的。如果你喜欢他们的选择,这会节省你的时间,但如果你想有其他选择,这就成它的不便之处了。<br />
<br />
===Arch vs Gobolinux===<br />
Gobolinux 有一个独特的无为而治的包管理方法。其文件系统被组织成应用程序全部位于 /Programs 目录,并且通过符号链接使用。删除程序X只需 rm -rf /Programs/X http://www.gobolinux.org/index.php?page=at_a_glance<br />
It does not seem to focus on i686 binaries and does allow source-based package installs.<br />
其并不是针对i686平台优化的二进制程序,允许基于源码的软件安装。<br />
<br />
===Arch vs Minix 3===<br />
Arch 是一个拥有现代社区和硬件支持的完整发行版。Minix 3 是一个有一些有趣特性的微小而不稳定的高级研究用操作系统,例如用于 [http://en.wikipedia.org/wiki/Microkernel microkernel]。 http://www.minix3.org/<br />
<br />
===Arch 与 Frugalware===<br />
Arch 基于文本界面并且面向命令行操作, 而 Frugalware 提供了更佳的多语言支持. 同时 Frugalware 也提供了更多的本地化文档. 虽然同样使用 packman, 但是它们的包并不完全兼容. Frugalware 默认不支持 JFS 文件系统. Frugalware 不再基于 Slackware,更像是一个独立的发行版,并且它基于 i686 架构。<br />
<br />
===Arch 与 Rock===<br />
<br />
来自这篇介绍:http://www.rocklinux.org/wiki/About<br />
<br />
ROCK Linux是一个用来打造Linux发行版的灵活的开发工具包,即打造你自己的Linux发行版可用的工具链或框架。这个你也可以参考我们的目标描述。<br />
<br />
如果你不想打造你自己的Linux发行版,而只是对一个具有多用途的好的发行版感兴趣,你或许可以看一下 http://www.rocklinux.org/wiki/Crystal_ROCK<br />
<br />
它是一个作为开发工具而生的发行版。和Arch相比,它有和其他基于源码的发行版一样的问题,如编译所需的时间等。它可以运行在多种处理器上如SPARC, ARM等。<br />
<br />
===Arch 与 T2===<br />
来自FAQ http://www.t2-project.org/faq/<br />
<br />
问题:既然已经有Gentoo了为什么还需要T2?<br />
回答:T2,或者更精确的说,它的前身ROCK Linux,它在1998年就启动了,比Gentoo早几个月,而且比Gentoo更早在freshmeat注册--所以,这个问题如果能反过来问或许更好。<br />
同样,在技术方面T2支持商业强度的开发,坚持目标,交互编译,可选的嵌入式C开发库和多引导系统可选择。T2的包通常不包括任何代码,它是基于key-value的文本文件,这使得包的工作和更新在T2上非常快。<br />
Arch使用为i686优化的二进制包(由于不需要编译所有的东西,所以很快)来和T2竞争。T2在技术实力方面是一个强有力的竞争者。由于它能用于嵌入式设备,它有可能在某些应用方面击败Arch。T2值得关注。</div>Ly50247https://wiki.archlinux.org/index.php?title=Arch_compared_to_other_distributions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135536Arch compared to other distributions (简体中文)2011-04-01T09:09:25Z<p>Ly50247: /* Arch与 Ubuntu */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
{{i18n|Arch Compared to Other Distributions}}<br />
{{Article summary start|概述}}<br />
{{Article summary text|Arch Linux 和其他流行 GNU/Linux 发行版和BSDs的简明比较。}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch Linux}}<br />
{{Article summary wiki|The Arch Way}}<br />
{{Article summary heading|外部链接}}<br />
{{Article summary link|DistroWatch.com|http://distrowatch.com/}}<br />
{{Article summary end}}<br />
<br />
本文试图将 ArchLinux 和其他流行的 GNU/Linux 发行版和类UNIX系统作一个比较。下面的总结很简洁,但可以帮您决定 Arch Linux 是否符合自己的需求。尽管评论和叙述有一定作用,但亲身体验总是比较发行版的最好方法。<br />
<br />
==基于源码的发行版==<br />
基于源码的发行版是可度便捷的,拥有根据自己的机器架构和使用方案最优地控制和编译整个系统和所有软件的优势,但劣势是要在源码编译上消耗大量时间。Arch 的基础和所有软件包都为i686和x86-64平台编译,从而相比基于i386/i486/i586二进制包的发行版,更充分发挥硬件的性能优势。<br />
<br />
===ArchLinux 与 Gentoo===<br />
Arch Linux 和 Gentoo Linux 都是滚动升级的发行版,在上游软件发布后很短时间就制作完成可用的软件包。Gentoo的包和基本系统是直接从源码根据用户指定的USE标识构建。尽管Arch 基本系统被设计为安装预编译的 i686/x86_64 二进制包,它也提供类 ports 系统来从源码编译软件。这样 Arch 更易于构建和升级,而 Gentoo 更易于完全得定制。Arch 只支持 i686 和 x86_64 ,而 Gentoo 对 x86, ppc, sparc, alpha, amd64, arm, mips, hppa, s390, sh, 和 itanium架构提供官方支持。因为 Gentoo 和 Arch 的安装环境都只包含基本系统,二都都被认为是高度可定制的。Gentoo 用户会从 Arch 的大多数方面感到满意。<br />
<br />
=== Arch 与 Sorcerer/Lunar-Linux/Source Mage ===<br />
Sorcerer/Lunar-Linux/Source Mage (SLS)都是基于源码的发行版,它们最开始的时候都是有联系的。SLS使用一套非常简单的脚本文件来创建包描述,使用一个全局配置文件来配置编译过程,这很像 Arch 的[[Arch Build System]](ABS系统)。SLS工具提供完全依赖检查(包括处理可选特性)和包的跟踪、删除以及升级。SLS不提供二进制的包,但是它能很容易的回滚到以前安装的包。<br />
<br />
安装过程包括从文本和ncurses菜单配置一个简单基本系统,然后重新编译这个基本系统(可选)。和 Arch 一样,它们不提供缺省的WM/DE/DM(窗口管理器,桌面环境,桌面管理器),在安装时也没有安装Xorg。但是它们提供一种很简单的方法来安装可选的几个X server(包括X.Org 6.8或7, XFree86)。<br />
<br />
SLS的历史非常复杂。关于它是最好记录可以在这里找到:[http://wiki.sourcemage.org/SourceMage/History the SourceMage wiki]。<br />
<br />
相关链接:<br />
<br />
[http://lunar-linux.org/ Lunar Linux]<br />
<br />
[http://www.sourcemage.org/ SourceMage]<br />
<br />
[http://sorcerer.berlios.de/ Sorcerer]<br />
<br />
==极简派(Minimalist)==<br />
<br />
极简派发行版和 Arch 有相当的可比性,有一些共同之处。从技术层面都强调简洁的重要性。<br />
<br />
=== Arch 与 LFS ===<br />
LFS(Linux From Scratch), 是最个性化的系统,她不是一个发行版,只以文档形式存在。文档指导用户获得用于构建一个实用 GNU/Linux 系统的最少的基础源码包,以及如何手动编译(包括打补丁和配置编译选项等)。LFS就是这样小巧,并且提供优秀和富指导性的构建基本系统的过程。<br />
<br />
Arch基本系统同样提供这些软件包(为 i686/x86-64 优化),以及BSD风格的启动脚本、一些额外的辅助工具和功能强大的 [[pacman]] 包管理工具。LFS 并不提供在线软件仓库,源码要手动获取、编译和安装(使用 make )。(也存在一些手动的包管理方法,在 LFS 手册有提及。)基于Arch基本系统,社区和开发者提供并管理数以千计可供 pacman 安装的二进制包以及 [[Arch Build System]] 使用的 [[PKGBUILD]] 脚本。Arch 同时也包括 [[makepkg]] 工具用来方便地生成 {{Filename|.pkg.tar.xz}} 格式的软件包,然后可以用 pacman 安装。<br />
<br />
Judd Vinet从源码构建 ArchLinux,并用C写下 [[pacman]] 。历史原因,Arch 有时被人们形容成“带有一个优秀包管理系统的Linux“(Linux, with a nice package manager)。<br />
<br />
===Arch 与 CRUX===<br />
<br />
Arch是单独开发的,而不是基于其他任何 GNU/Linux 发行版。在构建 Arch 之前,Judd Vinet 使用并称赞 CRUX(Per Lidén构建的轻量级发行版)。最初的灵感和CRUX是相同的, Arch从源码构建,之后有了用C写成的 [[pacman]]。它们有着相同的指导原则,比如二者都对硬件架构优化,最小化并符合K.I.S.S原则。二者都有类ports系统,使用*BSD风格的初始化系统,而且像*BSD一样都提供可扩展的最小基本环境。[[pacman]] 是 Arch 的一大特色,它用来管理系统中的二进制包,并能很好地与 [[Arch Build System]] 协同工作。CRUX 用一个社区开发的 prt-get来配合自己的ports系统来处理依赖关系,但包是从源码生成的(尽管 CRUX 基本安装环境是二进制的)。Arch 只提供对 x86-64 和 i686 的官方支持,而 CURUX 有官方支持的i686以及社区开发的 x86-64、ppc 和 ppc64。<br />
<br />
Arch 使用滚动升级系统并提供大量二进制包和 [[Arch User Repository]]。相比之下 CRUX 提供一个缺乏官方支持的 ports 系统和比较逊色的软件仓库。<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?pid=133721#p133721 这个论坛的帖子]陈述了一位用户对这两个发行版的观点。<br />
<br />
===Arch 与 Slackware===<br />
Slackware 和 Arch 很相似,二者都是小巧优雅的发行版。Slackware以约束少和从内核开始的朴素的包著名。Arch 只有在避免出现严重问题或保证顺利打包时才使用补丁。两者都使用BSD 的初始化脚本。Arch 有一个健壮的包管理系统 [[pacman]]。与Slackware的标准工具不同,它可以自己处理依赖关系并提供更自动化的系统升级方式。Slackware用户更倾向于手动处理依赖关系,以尽可能控制自己的系统。Slackware也对预编译的库和依赖提供杰出的支持。Arch 是一个滚动升级的系统,Slackware的发布更为保守,更喜欢提供稳定的软件包。在这个方面,Arch更为“前卫”。Arch 软件仓库提供成千上万的二进制包,而相对之下Slackware的更为逊色。Arch提供 [[Arch Build System]](一个类ports系统)和[[AUR]](用户贡献的数以万计的PKGBUILD)。 Slackware提供一个相似的系统 [http://www.slackbuilds.org slackbuilds.org],它是半官方支持的Slackbuilds(和PKGBUILD相似)仓库。Slackware用户一般会对Arch的多数方面感到满意。<br />
<br />
==Arch 与 其他图形化的发行版==<br />
图形化的发行版之间有许多相同之处,而Arch和他们其中的任何一个都非常的不同。 Arch 是个基于文本和面向命令行的。 如果想真正学习Linux,Arch是个更好的选择。图形化的发行版往往装备有GUI安装器(像Fedora的Anaconda)和GUI的系统配置工具(像Suse的Yast)。特殊的不同之处在下面描述。<br />
<br />
=== Arch 与 Debian GNU/Linux===<br />
<br />
Debian 是一个更大的项目和社区,提供稳定、测试和不稳定分支,包含超过二千的二进制包。Arch不像Debian那样把包分成“-dev”和“-common”,因此Arch的软件仓库看起来更小。Debian 对自由软件更热情。Arch对GNU定义的非自由('non-free')包更显宽容。Debian更注重于稳定性并经过充分测试,而Arch更注重于简洁、小巧和提供最新软件。Arch的包去Debian Stable 和 Testing 中的更新,和 unstable里的差不多。Debian 和 Arch 都提供很好的包管理系统。Arch 滚动升级,而 Debian Stable 采用“固定”的包发行。Debian 支持许多架构,包括alpha, arm, hppa, i386, x86_64, ia64, m68k, mips, mipsel, powerpc, s390 和 sparc,而 Arch 只支持i686 和 x86_64。<br />
Arch 对从源码创建包提供更好的支持,有一个类ports系统。Debian 不提供ports系统,只依靠着包数量庞大的软件仓库。Arch安装环境只提供最小的基本系统,编辑文本文件来配置系统,而Debian的方式更为自动化,另外还提供多种安装方式。Debian使用SysVinit,而Arch使用类*BSD风格init。Arch只在迫不得已时才打补丁。<br />
<br />
=== Arch与 Ubuntu===<br />
<br />
Ubuntu是一个非常流行的基于Debian的发行版,由Canonical公司提供商业支持,而Arch是从源码创建的独立发行版。两个项目有非常不同的目标并面向不同的用户群体。Arch为那些渴望自己用手的用户设计,而Ubuntu提供自动配置好了的系统面向“所有”的用户。如果你想快速安装使用而不作过多修改的话,Ubuntu更适合你。Arch以很小的基本系统提供给用户,很大程序上依靠用户按自己的需求定制。一般来说,开发者和用手能力强更喜欢Arch,尽管很多Arch用户最初用的是Ubuntu后来转而使用Arch。Ubuntu每6个月发行一个新版本,而Arch是滚动升级的。Arch提供类ports包构建系统( [[Arch Build System]])而Ubuntu没有。这两个社区也有不尽相同,Arch社区更小,强烈鼓励用户为Arch奉献一份力量。而相反,Ubuntu社区很大,并能容忍其中许多实际上并未为开发、打包和维护作贡献的用户。<br />
<br />
===Arch 与 基于 RPM 的发行版===<br />
RPM格式的软件包可以从很多地方得到,rpm可以非常灵活地处理依赖问题,但也因此导致第三方的包经常存在依赖问题,但目前几乎所有基于rpm的Linux系统都提供了非常完备的软件包管理系统,轻易解决了这个问题。另外,在RedHat 的 RPM 和 OpenSuse的RPM之间也经常造成混淆。<br />
<br />
===Arch 与 Fedora===<br />
Fedora 是 RedHat 发行版的技术前导版,对新技术的采用非常激进(比arch还激进),但也因此会导致很多不稳定。它有个坚实的社区和许多预先创建好的软件包,还有可获得的商业性技术支持。Fedora因为商业的原因,默认是不提供有专利方面限制的软件的。Fedora有图形界面安装。<br />
Arch使用基于ncurses文字界面安装。Fedora的图形界面设计友好。Arch相对Fedora是更为简单的系统,依赖于用户手动配置。Fedora有固定版本发布周期。Arch是滚动升级系统。Arch的设计理念是面向轻量级优雅,而Fedora目的是测试所引入的新技术,所以更加适合直接针对系统的开发人员。<br />
<br />
===Arch 与 Mandriva===<br />
<br />
Mandriva Linux(前身为 Mandrake Linux)创建于1998年,目标是使GNU/Linux对于每个人都易于使用。它使用基于RPM包,使用urpmi包管理软件。它与Arch的目标用户不尽相同。<br />
<br />
===Arch 与 openSUSE===<br />
openSUSE使用RPM包格式并以YaST2图形化配置工具著名,YaST2对大多数用户提供一站式配置管理(包括包管理)。Arch不提供这样的工具,因为它违背了[[The Arch Way]]。<br />
然而openSUSE大多为认为对新手(或者更喜欢图形界面、自动化配置和开箱即用的用户)更为友好。<br />
<br />
==与BSD系列的对比==<br />
===Arch vs FreeBSD===<br />
BSDs 起源于伯克利Unix. http://www.freebsd.org/about.html 因此Freebsd不是一个Linux发行版. 软件可以使用二进制或通过'ports'从源代码安装。BSD自我宣称它不仅仅是一个作为整体上的系统,并且会确认每个被移植到FreeBSD上的程序是否能工作正常。像Arch一样,软件包差不多是最新的。这大概是Arch最有意思的竞争者,因为它也醉心于追逐新软件,并且有一个规模比较可观,才华横溢,活跃和严肃的社区。其中其pkg部分,近似于arch的pacman,其port部分,近似于arch的abs,但好像因为其严谨,而缺乏类似arch的aur的东西。<br />
<br />
===Arch vs NetBSD===<br />
NetBSD名称来源于其发起和发展主要靠网络,它是一个自由,安全并且具有高度可移植性的类UNIX开源操作系统,从64位的Opteron机器和桌面系统到手持和嵌入式设备,它支持超过70种平台,可以说是支持平台最多的一个发行版,但它为了可移植性,不可避免牺牲了部分平台的功力,从而无法充分发挥特定平台的全部潜力。它设计简洁,并且那些高级特性使它同时成为优异的生产和研究环境,它也提供给用户所有的源代码。许多应用程序轻易地可以通过pkgsrc来获得,它就是NetBSD软件包集合。Arch不会像NetBSD那样可以用在那么多的设备上,但是对i686平台它会提供更多的应用程序。而且默认的pkgsrc安装方法是先取得软件包的源码再进行编译,而Arch是直接提供二进制软件包。Arch和NetBSD之间有很多相似之处;它们都使用/etc/rc.conf作为主配置文件,它们非常精简和轻巧,它们都提供ports系统和二进制软件,它们都有活跃,严谨的开发和社区。Arch还从*BSD那里借鉴了它的init系统的概念。<br />
<br />
===Arch vs OpenBSD===<br />
OpenBSD是个极端追求安全性的操作系统,自我宣称“大概是头等安全的操作系统“。它也是一个自由,用于多个平台的基于4.4BSD的类UNIX操作系统。相比之下,Arch更专注于简单,优美,精巧和最新的软件。OpenBSD支持大多数程序的二进制仿真,它们来自SVR4(Solaris),FreeBSD, GNU/Linux, BSD/OS, SunOS and HP-UX. 和Arch一样,OpenBSD提供了一个小而优美的基本安装并且使用一个ports系统和软件包系统来允许进行容易的安装和管理非基本系统的软件包。GNU/Linux系统比如说Arch,它和大多数基于BSD的操作系统一样,OpenBSD内核和用户空间的程序,比如说shell和常见的工具(像ls,cp,cat和ps),它们被开发成在单一的源代码仓库中。<br />
目前BSD系列对硬件支持都集中在服务器,对普通电脑的支持相对落后于Linux,而且,软件交流社区也仍然集中在服务器领域,对桌面用户的交流比较弱势,不太适合桌面用户。<br />
<br />
==与其他的对比==<br />
===Arch 与 Zenwalk===<br />
Zenwalk是从Slackware衍生的,但是它更方便和现代。Arch和Zenwalk一个很大的不同是Zenwalk安装的包是开发者已经选好的。如果你喜欢他们的选择,这会节省你的时间,但如果你想有其他选择,这就成它的不便之处了。<br />
<br />
===Arch vs Gobolinux===<br />
Gobolinux 有一个独特的无为而治的包管理方法。其文件系统被组织成应用程序全部位于 /Programs 目录,并且通过符号链接使用。删除程序X只需 rm -rf /Programs/X http://www.gobolinux.org/index.php?page=at_a_glance<br />
It does not seem to focus on i686 binaries and does allow source-based package installs.<br />
其并不是针对i686平台优化的二进制程序,允许基于源码的软件安装。<br />
<br />
===Arch vs Minix 3===<br />
Arch 是一个拥有现代社区和硬件支持的完整发行版。Minix 3 是一个有一些有趣特性的微小而不稳定的高级研究用操作系统,例如用于 [http://en.wikipedia.org/wiki/Microkernel microkernel]。 http://www.minix3.org/<br />
<br />
===Arch 与 Frugalware===<br />
Arch 基于文本界面并且面向命令行操作, 而 Frugalware 提供了更佳的多语言支持. 同时 Frugalware 也提供了更多的本地化文档. 虽然同样使用 packman, 但是它们的包并不完全兼容. Frugalware 默认不支持 JFS 文件系统. Frugalware 不再基于 Slackware,更像是一个独立的发行版,并且它基于 i686 架构。<br />
<br />
===Arch 与 Rock===<br />
<br />
来自这篇介绍:http://www.rocklinux.org/wiki/About<br />
<br />
ROCK Linux是一个用来打造Linux发行版的灵活的开发工具包,即打造你自己的Linux发行版可用的工具链或框架。这个你也可以参考我们的目标描述。<br />
<br />
如果你不想打造你自己的Linux发行版,而只是对一个具有多用途的好的发行版感兴趣,你或许可以看一下 http://www.rocklinux.org/wiki/Crystal_ROCK<br />
<br />
它是一个作为开发工具而生的发行版。和Arch相比,它有和其他基于源码的发行版一样的问题,如编译所需的时间等。它可以运行在多种处理器上如SPARC, ARM等。<br />
<br />
===Arch 与 T2===<br />
来自FAQ http://www.t2-project.org/faq/<br />
<br />
问题:既然已经有Gentoo了为什么还需要T2?<br />
回答:T2,或者更精确的说,它的前身ROCK Linux,它在1998年就启动了,比Gentoo早几个月,而且比Gentoo更早在freshmeat注册--所以,这个问题如果能反过来问或许更好。<br />
同样,在技术方面T2支持商业强度的开发,坚持目标,交互编译,可选的嵌入式C开发库和多引导系统可选择。T2的包通常不包括任何代码,它是基于key-value的文本文件,这使得包的工作和更新在T2上非常快。<br />
Arch使用为i686优化的二进制包(由于不需要编译所有的东西,所以很快)来和T2竞争。T2在技术实力方面是一个强有力的竞争者。由于它能用于嵌入式设备,它有可能在某些应用方面击败Arch。T2值得关注。</div>Ly50247https://wiki.archlinux.org/index.php?title=Arch_compared_to_other_distributions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135533Arch compared to other distributions (简体中文)2011-04-01T08:51:57Z<p>Ly50247: /* Arch 与 openSUSE */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
{{i18n|Arch Compared to Other Distributions}}<br />
{{Article summary start|概述}}<br />
{{Article summary text|Arch Linux 和其他流行 GNU/Linux 发行版和BSDs的简明比较。}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch Linux}}<br />
{{Article summary wiki|The Arch Way}}<br />
{{Article summary heading|外部链接}}<br />
{{Article summary link|DistroWatch.com|http://distrowatch.com/}}<br />
{{Article summary end}}<br />
<br />
本文试图将 ArchLinux 和其他流行的 GNU/Linux 发行版和类UNIX系统作一个比较。下面的总结很简洁,但可以帮您决定 Arch Linux 是否符合自己的需求。尽管评论和叙述有一定作用,但亲身体验总是比较发行版的最好方法。<br />
<br />
==基于源码的发行版==<br />
基于源码的发行版是可度便捷的,拥有根据自己的机器架构和使用方案最优地控制和编译整个系统和所有软件的优势,但劣势是要在源码编译上消耗大量时间。Arch 的基础和所有软件包都为i686和x86-64平台编译,从而相比基于i386/i486/i586二进制包的发行版,更充分发挥硬件的性能优势。<br />
<br />
===ArchLinux 与 Gentoo===<br />
Arch Linux 和 Gentoo Linux 都是滚动升级的发行版,在上游软件发布后很短时间就制作完成可用的软件包。Gentoo的包和基本系统是直接从源码根据用户指定的USE标识构建。尽管Arch 基本系统被设计为安装预编译的 i686/x86_64 二进制包,它也提供类 ports 系统来从源码编译软件。这样 Arch 更易于构建和升级,而 Gentoo 更易于完全得定制。Arch 只支持 i686 和 x86_64 ,而 Gentoo 对 x86, ppc, sparc, alpha, amd64, arm, mips, hppa, s390, sh, 和 itanium架构提供官方支持。因为 Gentoo 和 Arch 的安装环境都只包含基本系统,二都都被认为是高度可定制的。Gentoo 用户会从 Arch 的大多数方面感到满意。<br />
<br />
=== Arch 与 Sorcerer/Lunar-Linux/Source Mage ===<br />
Sorcerer/Lunar-Linux/Source Mage (SLS)都是基于源码的发行版,它们最开始的时候都是有联系的。SLS使用一套非常简单的脚本文件来创建包描述,使用一个全局配置文件来配置编译过程,这很像 Arch 的[[Arch Build System]](ABS系统)。SLS工具提供完全依赖检查(包括处理可选特性)和包的跟踪、删除以及升级。SLS不提供二进制的包,但是它能很容易的回滚到以前安装的包。<br />
<br />
安装过程包括从文本和ncurses菜单配置一个简单基本系统,然后重新编译这个基本系统(可选)。和 Arch 一样,它们不提供缺省的WM/DE/DM(窗口管理器,桌面环境,桌面管理器),在安装时也没有安装Xorg。但是它们提供一种很简单的方法来安装可选的几个X server(包括X.Org 6.8或7, XFree86)。<br />
<br />
SLS的历史非常复杂。关于它是最好记录可以在这里找到:[http://wiki.sourcemage.org/SourceMage/History the SourceMage wiki]。<br />
<br />
相关链接:<br />
<br />
[http://lunar-linux.org/ Lunar Linux]<br />
<br />
[http://www.sourcemage.org/ SourceMage]<br />
<br />
[http://sorcerer.berlios.de/ Sorcerer]<br />
<br />
==极简派(Minimalist)==<br />
<br />
极简派发行版和 Arch 有相当的可比性,有一些共同之处。从技术层面都强调简洁的重要性。<br />
<br />
=== Arch 与 LFS ===<br />
LFS(Linux From Scratch), 是最个性化的系统,她不是一个发行版,只以文档形式存在。文档指导用户获得用于构建一个实用 GNU/Linux 系统的最少的基础源码包,以及如何手动编译(包括打补丁和配置编译选项等)。LFS就是这样小巧,并且提供优秀和富指导性的构建基本系统的过程。<br />
<br />
Arch基本系统同样提供这些软件包(为 i686/x86-64 优化),以及BSD风格的启动脚本、一些额外的辅助工具和功能强大的 [[pacman]] 包管理工具。LFS 并不提供在线软件仓库,源码要手动获取、编译和安装(使用 make )。(也存在一些手动的包管理方法,在 LFS 手册有提及。)基于Arch基本系统,社区和开发者提供并管理数以千计可供 pacman 安装的二进制包以及 [[Arch Build System]] 使用的 [[PKGBUILD]] 脚本。Arch 同时也包括 [[makepkg]] 工具用来方便地生成 {{Filename|.pkg.tar.xz}} 格式的软件包,然后可以用 pacman 安装。<br />
<br />
Judd Vinet从源码构建 ArchLinux,并用C写下 [[pacman]] 。历史原因,Arch 有时被人们形容成“带有一个优秀包管理系统的Linux“(Linux, with a nice package manager)。<br />
<br />
===Arch 与 CRUX===<br />
<br />
Arch是单独开发的,而不是基于其他任何 GNU/Linux 发行版。在构建 Arch 之前,Judd Vinet 使用并称赞 CRUX(Per Lidén构建的轻量级发行版)。最初的灵感和CRUX是相同的, Arch从源码构建,之后有了用C写成的 [[pacman]]。它们有着相同的指导原则,比如二者都对硬件架构优化,最小化并符合K.I.S.S原则。二者都有类ports系统,使用*BSD风格的初始化系统,而且像*BSD一样都提供可扩展的最小基本环境。[[pacman]] 是 Arch 的一大特色,它用来管理系统中的二进制包,并能很好地与 [[Arch Build System]] 协同工作。CRUX 用一个社区开发的 prt-get来配合自己的ports系统来处理依赖关系,但包是从源码生成的(尽管 CRUX 基本安装环境是二进制的)。Arch 只提供对 x86-64 和 i686 的官方支持,而 CURUX 有官方支持的i686以及社区开发的 x86-64、ppc 和 ppc64。<br />
<br />
Arch 使用滚动升级系统并提供大量二进制包和 [[Arch User Repository]]。相比之下 CRUX 提供一个缺乏官方支持的 ports 系统和比较逊色的软件仓库。<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?pid=133721#p133721 这个论坛的帖子]陈述了一位用户对这两个发行版的观点。<br />
<br />
===Arch 与 Slackware===<br />
Slackware 和 Arch 很相似,二者都是小巧优雅的发行版。Slackware以约束少和从内核开始的朴素的包著名。Arch 只有在避免出现严重问题或保证顺利打包时才使用补丁。两者都使用BSD 的初始化脚本。Arch 有一个健壮的包管理系统 [[pacman]]。与Slackware的标准工具不同,它可以自己处理依赖关系并提供更自动化的系统升级方式。Slackware用户更倾向于手动处理依赖关系,以尽可能控制自己的系统。Slackware也对预编译的库和依赖提供杰出的支持。Arch 是一个滚动升级的系统,Slackware的发布更为保守,更喜欢提供稳定的软件包。在这个方面,Arch更为“前卫”。Arch 软件仓库提供成千上万的二进制包,而相对之下Slackware的更为逊色。Arch提供 [[Arch Build System]](一个类ports系统)和[[AUR]](用户贡献的数以万计的PKGBUILD)。 Slackware提供一个相似的系统 [http://www.slackbuilds.org slackbuilds.org],它是半官方支持的Slackbuilds(和PKGBUILD相似)仓库。Slackware用户一般会对Arch的多数方面感到满意。<br />
<br />
==Arch 与 其他图形化的发行版==<br />
图形化的发行版之间有许多相同之处,而Arch和他们其中的任何一个都非常的不同。 Arch 是个基于文本和面向命令行的。 如果想真正学习Linux,Arch是个更好的选择。图形化的发行版往往装备有GUI安装器(像Fedora的Anaconda)和GUI的系统配置工具(像Suse的Yast)。特殊的不同之处在下面描述。<br />
<br />
=== Arch 与 Debian GNU/Linux===<br />
<br />
Debian 是一个更大的项目和社区,提供稳定、测试和不稳定分支,包含超过二千的二进制包。Arch不像Debian那样把包分成“-dev”和“-common”,因此Arch的软件仓库看起来更小。Debian 对自由软件更热情。Arch对GNU定义的非自由('non-free')包更显宽容。Debian更注重于稳定性并经过充分测试,而Arch更注重于简洁、小巧和提供最新软件。Arch的包去Debian Stable 和 Testing 中的更新,和 unstable里的差不多。Debian 和 Arch 都提供很好的包管理系统。Arch 滚动升级,而 Debian Stable 采用“固定”的包发行。Debian 支持许多架构,包括alpha, arm, hppa, i386, x86_64, ia64, m68k, mips, mipsel, powerpc, s390 和 sparc,而 Arch 只支持i686 和 x86_64。<br />
Arch 对从源码创建包提供更好的支持,有一个类ports系统。Debian 不提供ports系统,只依靠着包数量庞大的软件仓库。Arch安装环境只提供最小的基本系统,编辑文本文件来配置系统,而Debian的方式更为自动化,另外还提供多种安装方式。Debian使用SysVinit,而Arch使用类*BSD风格init。Arch只在迫不得已时才打补丁。<br />
<br />
=== Arch与 Ubuntu===<br />
Arch 是个为了省力地追新而设计的系统,而Ubuntu是为了更方便好用而设计的系统。所以,如果你喜欢自己定制、喜欢追逐软件最新版本,那么 Arch 更为合适。如果不想浪费太多时间在定制系统上,而是希望能够安装完成之后,少量定制就能满意使用,那么Ubuntu显然更擅长此道。一般而言,开发人员和产品设计人员可能喜欢 Arch 多一点。<br />
<br />
===Arch 与 基于 RPM 的发行版===<br />
RPM格式的软件包可以从很多地方得到,rpm可以非常灵活地处理依赖问题,但也因此导致第三方的包经常存在依赖问题,但目前几乎所有基于rpm的Linux系统都提供了非常完备的软件包管理系统,轻易解决了这个问题。另外,在RedHat 的 RPM 和 OpenSuse的RPM之间也经常造成混淆。<br />
<br />
===Arch 与 Fedora===<br />
Fedora 是 RedHat 发行版的技术前导版,对新技术的采用非常激进(比arch还激进),但也因此会导致很多不稳定。它有个坚实的社区和许多预先创建好的软件包,还有可获得的商业性技术支持。Fedora因为商业的原因,默认是不提供有专利方面限制的软件的。Fedora有图形界面安装。<br />
Arch使用基于ncurses文字界面安装。Fedora的图形界面设计友好。Arch相对Fedora是更为简单的系统,依赖于用户手动配置。Fedora有固定版本发布周期。Arch是滚动升级系统。Arch的设计理念是面向轻量级优雅,而Fedora目的是测试所引入的新技术,所以更加适合直接针对系统的开发人员。<br />
<br />
===Arch 与 Mandriva===<br />
<br />
Mandriva Linux(前身为 Mandrake Linux)创建于1998年,目标是使GNU/Linux对于每个人都易于使用。它使用基于RPM包,使用urpmi包管理软件。它与Arch的目标用户不尽相同。<br />
<br />
===Arch 与 openSUSE===<br />
openSUSE使用RPM包格式并以YaST2图形化配置工具著名,YaST2对大多数用户提供一站式配置管理(包括包管理)。Arch不提供这样的工具,因为它违背了[[The Arch Way]]。<br />
然而openSUSE大多为认为对新手(或者更喜欢图形界面、自动化配置和开箱即用的用户)更为友好。<br />
<br />
==与BSD系列的对比==<br />
===Arch vs FreeBSD===<br />
BSDs 起源于伯克利Unix. http://www.freebsd.org/about.html 因此Freebsd不是一个Linux发行版. 软件可以使用二进制或通过'ports'从源代码安装。BSD自我宣称它不仅仅是一个作为整体上的系统,并且会确认每个被移植到FreeBSD上的程序是否能工作正常。像Arch一样,软件包差不多是最新的。这大概是Arch最有意思的竞争者,因为它也醉心于追逐新软件,并且有一个规模比较可观,才华横溢,活跃和严肃的社区。其中其pkg部分,近似于arch的pacman,其port部分,近似于arch的abs,但好像因为其严谨,而缺乏类似arch的aur的东西。<br />
<br />
===Arch vs NetBSD===<br />
NetBSD名称来源于其发起和发展主要靠网络,它是一个自由,安全并且具有高度可移植性的类UNIX开源操作系统,从64位的Opteron机器和桌面系统到手持和嵌入式设备,它支持超过70种平台,可以说是支持平台最多的一个发行版,但它为了可移植性,不可避免牺牲了部分平台的功力,从而无法充分发挥特定平台的全部潜力。它设计简洁,并且那些高级特性使它同时成为优异的生产和研究环境,它也提供给用户所有的源代码。许多应用程序轻易地可以通过pkgsrc来获得,它就是NetBSD软件包集合。Arch不会像NetBSD那样可以用在那么多的设备上,但是对i686平台它会提供更多的应用程序。而且默认的pkgsrc安装方法是先取得软件包的源码再进行编译,而Arch是直接提供二进制软件包。Arch和NetBSD之间有很多相似之处;它们都使用/etc/rc.conf作为主配置文件,它们非常精简和轻巧,它们都提供ports系统和二进制软件,它们都有活跃,严谨的开发和社区。Arch还从*BSD那里借鉴了它的init系统的概念。<br />
<br />
===Arch vs OpenBSD===<br />
OpenBSD是个极端追求安全性的操作系统,自我宣称“大概是头等安全的操作系统“。它也是一个自由,用于多个平台的基于4.4BSD的类UNIX操作系统。相比之下,Arch更专注于简单,优美,精巧和最新的软件。OpenBSD支持大多数程序的二进制仿真,它们来自SVR4(Solaris),FreeBSD, GNU/Linux, BSD/OS, SunOS and HP-UX. 和Arch一样,OpenBSD提供了一个小而优美的基本安装并且使用一个ports系统和软件包系统来允许进行容易的安装和管理非基本系统的软件包。GNU/Linux系统比如说Arch,它和大多数基于BSD的操作系统一样,OpenBSD内核和用户空间的程序,比如说shell和常见的工具(像ls,cp,cat和ps),它们被开发成在单一的源代码仓库中。<br />
目前BSD系列对硬件支持都集中在服务器,对普通电脑的支持相对落后于Linux,而且,软件交流社区也仍然集中在服务器领域,对桌面用户的交流比较弱势,不太适合桌面用户。<br />
<br />
==与其他的对比==<br />
===Arch 与 Zenwalk===<br />
Zenwalk是从Slackware衍生的,但是它更方便和现代。Arch和Zenwalk一个很大的不同是Zenwalk安装的包是开发者已经选好的。如果你喜欢他们的选择,这会节省你的时间,但如果你想有其他选择,这就成它的不便之处了。<br />
<br />
===Arch vs Gobolinux===<br />
Gobolinux 有一个独特的无为而治的包管理方法。其文件系统被组织成应用程序全部位于 /Programs 目录,并且通过符号链接使用。删除程序X只需 rm -rf /Programs/X http://www.gobolinux.org/index.php?page=at_a_glance<br />
It does not seem to focus on i686 binaries and does allow source-based package installs.<br />
其并不是针对i686平台优化的二进制程序,允许基于源码的软件安装。<br />
<br />
===Arch vs Minix 3===<br />
Arch 是一个拥有现代社区和硬件支持的完整发行版。Minix 3 是一个有一些有趣特性的微小而不稳定的高级研究用操作系统,例如用于 [http://en.wikipedia.org/wiki/Microkernel microkernel]。 http://www.minix3.org/<br />
<br />
===Arch 与 Frugalware===<br />
Arch 基于文本界面并且面向命令行操作, 而 Frugalware 提供了更佳的多语言支持. 同时 Frugalware 也提供了更多的本地化文档. 虽然同样使用 packman, 但是它们的包并不完全兼容. Frugalware 默认不支持 JFS 文件系统. Frugalware 不再基于 Slackware,更像是一个独立的发行版,并且它基于 i686 架构。<br />
<br />
===Arch 与 Rock===<br />
<br />
来自这篇介绍:http://www.rocklinux.org/wiki/About<br />
<br />
ROCK Linux是一个用来打造Linux发行版的灵活的开发工具包,即打造你自己的Linux发行版可用的工具链或框架。这个你也可以参考我们的目标描述。<br />
<br />
如果你不想打造你自己的Linux发行版,而只是对一个具有多用途的好的发行版感兴趣,你或许可以看一下 http://www.rocklinux.org/wiki/Crystal_ROCK<br />
<br />
它是一个作为开发工具而生的发行版。和Arch相比,它有和其他基于源码的发行版一样的问题,如编译所需的时间等。它可以运行在多种处理器上如SPARC, ARM等。<br />
<br />
===Arch 与 T2===<br />
来自FAQ http://www.t2-project.org/faq/<br />
<br />
问题:既然已经有Gentoo了为什么还需要T2?<br />
回答:T2,或者更精确的说,它的前身ROCK Linux,它在1998年就启动了,比Gentoo早几个月,而且比Gentoo更早在freshmeat注册--所以,这个问题如果能反过来问或许更好。<br />
同样,在技术方面T2支持商业强度的开发,坚持目标,交互编译,可选的嵌入式C开发库和多引导系统可选择。T2的包通常不包括任何代码,它是基于key-value的文本文件,这使得包的工作和更新在T2上非常快。<br />
Arch使用为i686优化的二进制包(由于不需要编译所有的东西,所以很快)来和T2竞争。T2在技术实力方面是一个强有力的竞争者。由于它能用于嵌入式设备,它有可能在某些应用方面击败Arch。T2值得关注。</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135504Open Sound System (简体中文)2011-04-01T02:32:57Z<p>Ly50247: /* Changing the Sample Rate */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==使用Gstreamer的程序==<br />
<br />
移除pulseaudio和gstreamer*-pulse的程序和库。<br />
<br />
要将gstreamer的输出设置成OSS而不是缺省的ALSA,运行:<br />
<br />
gstreamer-properties<br />
<br />
把'''Default Output'''(缺省输出)选成 custom(自定义),并把文本框中内容改成: <br />
<br />
oss4sink<br />
<br />
对于输入:<br />
<br />
oss4src<br />
<br />
{{Note|oss4src不一定比osssrc听起来更好,所以只有在发现确实这样时再改。}}<br />
<br />
{{Note|对于一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties没作用,因为它们依赖 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties设置完Workaround后用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷贝到"musicaudiosink"(在一个位置)中 }}<br />
<br />
如果你用gstreamer作为phonon的后端,要设置环境变量,对于当前用户:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
把它加到 {{Filename|~/.bashrc}} 来登陆自动加载。<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== OSS与多媒体键 ==<br />
一个简单的静音/恢复和增减音量的方法是使用[[AUR]]中的 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} 脚本]。<br />
如果你的多媒体键默认不工作,查看 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS 使用多媒体键控制OSS]。<br />
<br />
安装好了这样在开关声音:<br />
$ ossvol -t<br />
输入{{Codeline|ossvol -h}}查看其他命令:<br />
<br />
如果你不如果怎么把命令绑定到多媒体键上,看[[Extra Keyboard Keys]]。<br />
<br />
<br />
=={{Codeline|ossvol}}的问题解决==<br />
如果你看到这样的错误:<br />
Bad mixer control name(987) 'vol'<br />
你需要编辑{{Filename|/usr/bin/ossvol}}改{{Codeline|CHANNEL}}变量的值,它在脚本的开始处。例如我的是{{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}。<br />
<br />
*'''注意''' 如果你用xbindkeys来绑定快捷键,把<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
加到.xbindkeysrc中的traise/lower volume section是调整音量的好方法。<br />
<br />
==改变采样率==<br />
<br />
改变采样率不是那么简单的事,它只能通过root用户改变并且改变时vmix不能被任何程序使用。在接下来的操作之前,检查一下你的receiver/amplifier(接收器/放大器)并且使用高质量的扬声器而不是普通的电脑扬声器。因为如果你用的是普通的电脑扬声器,下边的任何改动都不会让你感觉到任何变化。<br />
<br />
缺省的采样率是48000hz。 There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
==Changing the Default Sound Output==<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
==Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB==<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
<br />
==简单的系统托盘小工具==<br />
想要一个GNOME那样的控制音量小工具?W [http://bbs.archlinux.org/viewtopic.php?id=77440 在这里]我得到一个可用的 [http://pastebin.furver.se/0xflchkfz/ 工具]。<br />
<br />
下载 [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这个脚本] 重命名(例如 ossvolctl),运行:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
==开机自启动ossxmix托盘==<br />
<br />
'''KDE 4'''<br />
<br />
在<code>~/.local/share/applications/</code>创建一个启动器<code>ossxmix.desktop</code>:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
让它随桌面环境启动:<br />
<br />
System Settings(系统设置) > Advanced tab(高级) > Autostart(自启动),然后点击add program(添加程序)并选择 'Multimedia' (多媒体)。<br />
<br />
'''Gnome''' <br />
<br />
*以root用户创建/usr/local/bin/ossxmix_bg:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
到 System(系统)> Preferences(属性) > Start Up Applications(启动程序)<br />
<br />
*点击Add(添加),在Name(名称)中输入 OSSMIX ,field(内容)中输入<code>/usr/local/bin/ossxmix_bg</code>然后点击Add(添加)按钮。<br />
<br />
*重新登陆生效。<br />
<br />
==录制一个程序的声音==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
==Suspend and Hibernation==<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
==ALSA 模拟器==<br />
你可以让<tt>alsa-lib</tt>用OSS作为声音输出系统,这是一种ALSA模拟器。<br />
<br />
但是注意,这个方法可能在你声音输出的时候造成额外的延迟,而且模拟器也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA检测设备,这个软件就不能正常工作。<br />
<br />
所以,因为大多数应用直接支持OSSS,这个方法只是最后的解决方案。<br />
<br />
将来会有更完善的ALSA模拟器,像<tt>libsalsa</tt>和<tt>cuckoo</tt>.<br />
<br />
===介绍===<br />
<br />
* 安装<tt>alsa-plugins</tt>包。<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* 编辑 {{Filename|/etc/asound.conf}}:<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | 如果你不再使用OSS,别忘了把{{Filename|/etc/asound.conf}}改回去。}}<br />
<br />
==对特定驱动的设置==<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135503Open Sound System (简体中文)2011-04-01T02:22:58Z<p>Ly50247: /* Start ossxmix docked to systray on startup */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==使用Gstreamer的程序==<br />
<br />
移除pulseaudio和gstreamer*-pulse的程序和库。<br />
<br />
要将gstreamer的输出设置成OSS而不是缺省的ALSA,运行:<br />
<br />
gstreamer-properties<br />
<br />
把'''Default Output'''(缺省输出)选成 custom(自定义),并把文本框中内容改成: <br />
<br />
oss4sink<br />
<br />
对于输入:<br />
<br />
oss4src<br />
<br />
{{Note|oss4src不一定比osssrc听起来更好,所以只有在发现确实这样时再改。}}<br />
<br />
{{Note|对于一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties没作用,因为它们依赖 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties设置完Workaround后用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷贝到"musicaudiosink"(在一个位置)中 }}<br />
<br />
如果你用gstreamer作为phonon的后端,要设置环境变量,对于当前用户:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
把它加到 {{Filename|~/.bashrc}} 来登陆自动加载。<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== OSS与多媒体键 ==<br />
一个简单的静音/恢复和增减音量的方法是使用[[AUR]]中的 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} 脚本]。<br />
如果你的多媒体键默认不工作,查看 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS 使用多媒体键控制OSS]。<br />
<br />
安装好了这样在开关声音:<br />
$ ossvol -t<br />
输入{{Codeline|ossvol -h}}查看其他命令:<br />
<br />
如果你不如果怎么把命令绑定到多媒体键上,看[[Extra Keyboard Keys]]。<br />
<br />
<br />
=={{Codeline|ossvol}}的问题解决==<br />
如果你看到这样的错误:<br />
Bad mixer control name(987) 'vol'<br />
你需要编辑{{Filename|/usr/bin/ossvol}}改{{Codeline|CHANNEL}}变量的值,它在脚本的开始处。例如我的是{{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}。<br />
<br />
*'''注意''' 如果你用xbindkeys来绑定快捷键,把<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
加到.xbindkeysrc中的traise/lower volume section是调整音量的好方法。<br />
<br />
==Changing the Sample Rate==<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
==Changing the Default Sound Output==<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
==Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB==<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
<br />
==简单的系统托盘小工具==<br />
想要一个GNOME那样的控制音量小工具?W [http://bbs.archlinux.org/viewtopic.php?id=77440 在这里]我得到一个可用的 [http://pastebin.furver.se/0xflchkfz/ 工具]。<br />
<br />
下载 [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这个脚本] 重命名(例如 ossvolctl),运行:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
==开机自启动ossxmix托盘==<br />
<br />
'''KDE 4'''<br />
<br />
在<code>~/.local/share/applications/</code>创建一个启动器<code>ossxmix.desktop</code>:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
让它随桌面环境启动:<br />
<br />
System Settings(系统设置) > Advanced tab(高级) > Autostart(自启动),然后点击add program(添加程序)并选择 'Multimedia' (多媒体)。<br />
<br />
'''Gnome''' <br />
<br />
*以root用户创建/usr/local/bin/ossxmix_bg:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
到 System(系统)> Preferences(属性) > Start Up Applications(启动程序)<br />
<br />
*点击Add(添加),在Name(名称)中输入 OSSMIX ,field(内容)中输入<code>/usr/local/bin/ossxmix_bg</code>然后点击Add(添加)按钮。<br />
<br />
*重新登陆生效。<br />
<br />
==录制一个程序的声音==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
==Suspend and Hibernation==<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
==ALSA 模拟器==<br />
你可以让<tt>alsa-lib</tt>用OSS作为声音输出系统,这是一种ALSA模拟器。<br />
<br />
但是注意,这个方法可能在你声音输出的时候造成额外的延迟,而且模拟器也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA检测设备,这个软件就不能正常工作。<br />
<br />
所以,因为大多数应用直接支持OSSS,这个方法只是最后的解决方案。<br />
<br />
将来会有更完善的ALSA模拟器,像<tt>libsalsa</tt>和<tt>cuckoo</tt>.<br />
<br />
===介绍===<br />
<br />
* 安装<tt>alsa-plugins</tt>包。<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* 编辑 {{Filename|/etc/asound.conf}}:<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | 如果你不再使用OSS,别忘了把{{Filename|/etc/asound.conf}}改回去。}}<br />
<br />
==对特定驱动的设置==<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135500Open Sound System (简体中文)2011-04-01T01:56:59Z<p>Ly50247: /* Settings for specific driver */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==使用Gstreamer的程序==<br />
<br />
移除pulseaudio和gstreamer*-pulse的程序和库。<br />
<br />
要将gstreamer的输出设置成OSS而不是缺省的ALSA,运行:<br />
<br />
gstreamer-properties<br />
<br />
把'''Default Output'''(缺省输出)选成 custom(自定义),并把文本框中内容改成: <br />
<br />
oss4sink<br />
<br />
对于输入:<br />
<br />
oss4src<br />
<br />
{{Note|oss4src不一定比osssrc听起来更好,所以只有在发现确实这样时再改。}}<br />
<br />
{{Note|对于一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties没作用,因为它们依赖 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties设置完Workaround后用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷贝到"musicaudiosink"(在一个位置)中 }}<br />
<br />
如果你用gstreamer作为phonon的后端,要设置环境变量,对于当前用户:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
把它加到 {{Filename|~/.bashrc}} 来登陆自动加载。<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== OSS与多媒体键 ==<br />
一个简单的静音/恢复和增减音量的方法是使用[[AUR]]中的 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} 脚本]。<br />
如果你的多媒体键默认不工作,查看 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS 使用多媒体键控制OSS]。<br />
<br />
安装好了这样在开关声音:<br />
$ ossvol -t<br />
输入{{Codeline|ossvol -h}}查看其他命令:<br />
<br />
如果你不如果怎么把命令绑定到多媒体键上,看[[Extra Keyboard Keys]]。<br />
<br />
<br />
=={{Codeline|ossvol}}的问题解决==<br />
如果你看到这样的错误:<br />
Bad mixer control name(987) 'vol'<br />
你需要编辑{{Filename|/usr/bin/ossvol}}改{{Codeline|CHANNEL}}变量的值,它在脚本的开始处。例如我的是{{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}。<br />
<br />
*'''注意''' 如果你用xbindkeys来绑定快捷键,把<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
加到.xbindkeysrc中的traise/lower volume section是调整音量的好方法。<br />
<br />
==Changing the Sample Rate==<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
==Changing the Default Sound Output==<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
==Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB==<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
<br />
==简单的系统托盘小工具==<br />
想要一个GNOME那样的控制音量小工具?W [http://bbs.archlinux.org/viewtopic.php?id=77440 在这里]我得到一个可用的 [http://pastebin.furver.se/0xflchkfz/ 工具]。<br />
<br />
下载 [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这个脚本] 重命名(例如 ossvolctl),运行:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
==Start ossxmix docked to systray on startup==<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
==录制一个程序的声音==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
==Suspend and Hibernation==<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
==ALSA 模拟器==<br />
你可以让<tt>alsa-lib</tt>用OSS作为声音输出系统,这是一种ALSA模拟器。<br />
<br />
但是注意,这个方法可能在你声音输出的时候造成额外的延迟,而且模拟器也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA检测设备,这个软件就不能正常工作。<br />
<br />
所以,因为大多数应用直接支持OSSS,这个方法只是最后的解决方案。<br />
<br />
将来会有更完善的ALSA模拟器,像<tt>libsalsa</tt>和<tt>cuckoo</tt>.<br />
<br />
===介绍===<br />
<br />
* 安装<tt>alsa-plugins</tt>包。<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* 编辑 {{Filename|/etc/asound.conf}}:<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | 如果你不再使用OSS,别忘了把{{Filename|/etc/asound.conf}}改回去。}}<br />
<br />
==对特定驱动的设置==<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135499Open Sound System (简体中文)2011-04-01T01:55:03Z<p>Ly50247: /* ALSA虚拟机 */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==使用Gstreamer的程序==<br />
<br />
移除pulseaudio和gstreamer*-pulse的程序和库。<br />
<br />
要将gstreamer的输出设置成OSS而不是缺省的ALSA,运行:<br />
<br />
gstreamer-properties<br />
<br />
把'''Default Output'''(缺省输出)选成 custom(自定义),并把文本框中内容改成: <br />
<br />
oss4sink<br />
<br />
对于输入:<br />
<br />
oss4src<br />
<br />
{{Note|oss4src不一定比osssrc听起来更好,所以只有在发现确实这样时再改。}}<br />
<br />
{{Note|对于一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties没作用,因为它们依赖 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties设置完Workaround后用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷贝到"musicaudiosink"(在一个位置)中 }}<br />
<br />
如果你用gstreamer作为phonon的后端,要设置环境变量,对于当前用户:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
把它加到 {{Filename|~/.bashrc}} 来登陆自动加载。<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== OSS与多媒体键 ==<br />
一个简单的静音/恢复和增减音量的方法是使用[[AUR]]中的 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} 脚本]。<br />
如果你的多媒体键默认不工作,查看 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS 使用多媒体键控制OSS]。<br />
<br />
安装好了这样在开关声音:<br />
$ ossvol -t<br />
输入{{Codeline|ossvol -h}}查看其他命令:<br />
<br />
如果你不如果怎么把命令绑定到多媒体键上,看[[Extra Keyboard Keys]]。<br />
<br />
<br />
=={{Codeline|ossvol}}的问题解决==<br />
如果你看到这样的错误:<br />
Bad mixer control name(987) 'vol'<br />
你需要编辑{{Filename|/usr/bin/ossvol}}改{{Codeline|CHANNEL}}变量的值,它在脚本的开始处。例如我的是{{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}。<br />
<br />
*'''注意''' 如果你用xbindkeys来绑定快捷键,把<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
加到.xbindkeysrc中的traise/lower volume section是调整音量的好方法。<br />
<br />
==Changing the Sample Rate==<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
==Changing the Default Sound Output==<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
==Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB==<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
<br />
==简单的系统托盘小工具==<br />
想要一个GNOME那样的控制音量小工具?W [http://bbs.archlinux.org/viewtopic.php?id=77440 在这里]我得到一个可用的 [http://pastebin.furver.se/0xflchkfz/ 工具]。<br />
<br />
下载 [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这个脚本] 重命名(例如 ossvolctl),运行:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
==Start ossxmix docked to systray on startup==<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
==录制一个程序的声音==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
==Suspend and Hibernation==<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
==ALSA 模拟器==<br />
你可以让<tt>alsa-lib</tt>用OSS作为声音输出系统,这是一种ALSA模拟器。<br />
<br />
但是注意,这个方法可能在你声音输出的时候造成额外的延迟,而且模拟器也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA检测设备,这个软件就不能正常工作。<br />
<br />
所以,因为大多数应用直接支持OSSS,这个方法只是最后的解决方案。<br />
<br />
将来会有更完善的ALSA模拟器,像<tt>libsalsa</tt>和<tt>cuckoo</tt>.<br />
<br />
===介绍===<br />
<br />
* 安装<tt>alsa-plugins</tt>包。<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* 编辑 {{Filename|/etc/asound.conf}}:<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | 如果你不再使用OSS,别忘了把{{Filename|/etc/asound.conf}}改回去。}}<br />
<br />
==Settings for specific driver==<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
//////<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135498Open Sound System (简体中文)2011-04-01T01:54:30Z<p>Ly50247: /* ALSA emulation */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==使用Gstreamer的程序==<br />
<br />
移除pulseaudio和gstreamer*-pulse的程序和库。<br />
<br />
要将gstreamer的输出设置成OSS而不是缺省的ALSA,运行:<br />
<br />
gstreamer-properties<br />
<br />
把'''Default Output'''(缺省输出)选成 custom(自定义),并把文本框中内容改成: <br />
<br />
oss4sink<br />
<br />
对于输入:<br />
<br />
oss4src<br />
<br />
{{Note|oss4src不一定比osssrc听起来更好,所以只有在发现确实这样时再改。}}<br />
<br />
{{Note|对于一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties没作用,因为它们依赖 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties设置完Workaround后用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷贝到"musicaudiosink"(在一个位置)中 }}<br />
<br />
如果你用gstreamer作为phonon的后端,要设置环境变量,对于当前用户:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
把它加到 {{Filename|~/.bashrc}} 来登陆自动加载。<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== OSS与多媒体键 ==<br />
一个简单的静音/恢复和增减音量的方法是使用[[AUR]]中的 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} 脚本]。<br />
如果你的多媒体键默认不工作,查看 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS 使用多媒体键控制OSS]。<br />
<br />
安装好了这样在开关声音:<br />
$ ossvol -t<br />
输入{{Codeline|ossvol -h}}查看其他命令:<br />
<br />
如果你不如果怎么把命令绑定到多媒体键上,看[[Extra Keyboard Keys]]。<br />
<br />
<br />
=={{Codeline|ossvol}}的问题解决==<br />
如果你看到这样的错误:<br />
Bad mixer control name(987) 'vol'<br />
你需要编辑{{Filename|/usr/bin/ossvol}}改{{Codeline|CHANNEL}}变量的值,它在脚本的开始处。例如我的是{{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}。<br />
<br />
*'''注意''' 如果你用xbindkeys来绑定快捷键,把<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
加到.xbindkeysrc中的traise/lower volume section是调整音量的好方法。<br />
<br />
==Changing the Sample Rate==<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
==Changing the Default Sound Output==<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
==Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB==<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
<br />
==简单的系统托盘小工具==<br />
想要一个GNOME那样的控制音量小工具?W [http://bbs.archlinux.org/viewtopic.php?id=77440 在这里]我得到一个可用的 [http://pastebin.furver.se/0xflchkfz/ 工具]。<br />
<br />
下载 [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这个脚本] 重命名(例如 ossvolctl),运行:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
==Start ossxmix docked to systray on startup==<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
==录制一个程序的声音==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
==Suspend and Hibernation==<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
==ALSA 模拟器==<br />
你可以让<tt>alsa-lib</tt>用OSS作为声音输出系统,这是一种ALSA模拟器。<br />
<br />
但是注意,这个方法可能在你声音输出的时候造成额外的延迟,而且模拟器也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA检测设备,这个软件就不能正常工作。<br />
<br />
所以,因为大多数应用直接支持OSSS,这个方法只是最后的解决方案。<br />
<br />
将来会有更完善的ALSA模拟器,像<tt>libsalsa</tt>和<tt>cuckoo</tt>.<br />
<br />
===介绍===<br />
<br />
* 安装<tt>alsa-plugins</tt>包。<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* 编辑 {{Filename|/etc/asound.conf}}:<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | 如果你不再使用OSS,别忘了把{{Filename|/etc/asound.conf}}改回去。}}<br />
<br />
==Settings for specific driver==<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
//////<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135497Open Sound System (简体中文)2011-04-01T01:46:38Z<p>Ly50247: /* Record sound output from a program */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==使用Gstreamer的程序==<br />
<br />
移除pulseaudio和gstreamer*-pulse的程序和库。<br />
<br />
要将gstreamer的输出设置成OSS而不是缺省的ALSA,运行:<br />
<br />
gstreamer-properties<br />
<br />
把'''Default Output'''(缺省输出)选成 custom(自定义),并把文本框中内容改成: <br />
<br />
oss4sink<br />
<br />
对于输入:<br />
<br />
oss4src<br />
<br />
{{Note|oss4src不一定比osssrc听起来更好,所以只有在发现确实这样时再改。}}<br />
<br />
{{Note|对于一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties没作用,因为它们依赖 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties设置完Workaround后用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷贝到"musicaudiosink"(在一个位置)中 }}<br />
<br />
如果你用gstreamer作为phonon的后端,要设置环境变量,对于当前用户:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
把它加到 {{Filename|~/.bashrc}} 来登陆自动加载。<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== OSS与多媒体键 ==<br />
一个简单的静音/恢复和增减音量的方法是使用[[AUR]]中的 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} 脚本]。<br />
如果你的多媒体键默认不工作,查看 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS 使用多媒体键控制OSS]。<br />
<br />
安装好了这样在开关声音:<br />
$ ossvol -t<br />
输入{{Codeline|ossvol -h}}查看其他命令:<br />
<br />
如果你不如果怎么把命令绑定到多媒体键上,看[[Extra Keyboard Keys]]。<br />
<br />
<br />
=={{Codeline|ossvol}}的问题解决==<br />
如果你看到这样的错误:<br />
Bad mixer control name(987) 'vol'<br />
你需要编辑{{Filename|/usr/bin/ossvol}}改{{Codeline|CHANNEL}}变量的值,它在脚本的开始处。例如我的是{{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}。<br />
<br />
*'''注意''' 如果你用xbindkeys来绑定快捷键,把<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
加到.xbindkeysrc中的traise/lower volume section是调整音量的好方法。<br />
<br />
==Changing the Sample Rate==<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
==Changing the Default Sound Output==<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
==Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB==<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
<br />
==简单的系统托盘小工具==<br />
想要一个GNOME那样的控制音量小工具?W [http://bbs.archlinux.org/viewtopic.php?id=77440 在这里]我得到一个可用的 [http://pastebin.furver.se/0xflchkfz/ 工具]。<br />
<br />
下载 [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这个脚本] 重命名(例如 ossvolctl),运行:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
==Start ossxmix docked to systray on startup==<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
==录制一个程序的声音==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
==Suspend and Hibernation==<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
==ALSA emulation==<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
===Instructions===<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
==Settings for specific driver==<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
//////<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135496Open Sound System (简体中文)2011-04-01T01:45:12Z<p>Ly50247: /* {{Codeline|ossvol}} troubleshooting */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==使用Gstreamer的程序==<br />
<br />
移除pulseaudio和gstreamer*-pulse的程序和库。<br />
<br />
要将gstreamer的输出设置成OSS而不是缺省的ALSA,运行:<br />
<br />
gstreamer-properties<br />
<br />
把'''Default Output'''(缺省输出)选成 custom(自定义),并把文本框中内容改成: <br />
<br />
oss4sink<br />
<br />
对于输入:<br />
<br />
oss4src<br />
<br />
{{Note|oss4src不一定比osssrc听起来更好,所以只有在发现确实这样时再改。}}<br />
<br />
{{Note|对于一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties没作用,因为它们依赖 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties设置完Workaround后用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷贝到"musicaudiosink"(在一个位置)中 }}<br />
<br />
如果你用gstreamer作为phonon的后端,要设置环境变量,对于当前用户:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
把它加到 {{Filename|~/.bashrc}} 来登陆自动加载。<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== OSS与多媒体键 ==<br />
一个简单的静音/恢复和增减音量的方法是使用[[AUR]]中的 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} 脚本]。<br />
如果你的多媒体键默认不工作,查看 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS 使用多媒体键控制OSS]。<br />
<br />
安装好了这样在开关声音:<br />
$ ossvol -t<br />
输入{{Codeline|ossvol -h}}查看其他命令:<br />
<br />
如果你不如果怎么把命令绑定到多媒体键上,看[[Extra Keyboard Keys]]。<br />
<br />
<br />
=={{Codeline|ossvol}}的问题解决==<br />
如果你看到这样的错误:<br />
Bad mixer control name(987) 'vol'<br />
你需要编辑{{Filename|/usr/bin/ossvol}}改{{Codeline|CHANNEL}}变量的值,它在脚本的开始处。例如我的是{{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}。<br />
<br />
*'''注意''' 如果你用xbindkeys来绑定快捷键,把<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
加到.xbindkeysrc中的traise/lower volume section是调整音量的好方法。<br />
<br />
==Changing the Sample Rate==<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
==Changing the Default Sound Output==<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
==Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB==<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
<br />
==简单的系统托盘小工具==<br />
想要一个GNOME那样的控制音量小工具?W [http://bbs.archlinux.org/viewtopic.php?id=77440 在这里]我得到一个可用的 [http://pastebin.furver.se/0xflchkfz/ 工具]。<br />
<br />
下载 [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这个脚本] 重命名(例如 ossvolctl),运行:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
==Start ossxmix docked to systray on startup==<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
==Record sound output from a program==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
==Suspend and Hibernation==<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
==ALSA emulation==<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
===Instructions===<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
==Settings for specific driver==<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
//////<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135445Open Sound System (简体中文)2011-03-31T14:34:25Z<p>Ly50247: /* 提示和小技巧 */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==使用Gstreamer的程序==<br />
<br />
移除pulseaudio和gstreamer*-pulse的程序和库。<br />
<br />
要将gstreamer的输出设置成OSS而不是缺省的ALSA,运行:<br />
<br />
gstreamer-properties<br />
<br />
把'''Default Output'''(缺省输出)选成 custom(自定义),并把文本框中内容改成: <br />
<br />
oss4sink<br />
<br />
对于输入:<br />
<br />
oss4src<br />
<br />
{{Note|oss4src不一定比osssrc听起来更好,所以只有在发现确实这样时再改。}}<br />
<br />
{{Note|对于一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties没作用,因为它们依赖 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties设置完Workaround后用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷贝到"musicaudiosink"(在一个位置)中 }}<br />
<br />
如果你用gstreamer作为phonon的后端,要设置环境变量,对于当前用户:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
把它加到 {{Filename|~/.bashrc}} 来登陆自动加载。<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== OSS与多媒体键 ==<br />
一个简单的静音/恢复和增减音量的方法是使用[[AUR]]中的 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} 脚本]。<br />
如果你的多媒体键默认不工作,查看 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS 使用多媒体键控制OSS]。<br />
<br />
安装好了这样在开关声音:<br />
$ ossvol -t<br />
输入{{Codeline|ossvol -h}}查看其他命令:<br />
<br />
如果你不如果怎么把命令绑定到多媒体键上,看[[Extra Keyboard Keys]]。<br />
<br />
<br />
=={{Codeline|ossvol}} troubleshooting==<br />
If you get an error like:<br />
Bad mixer control name(987) 'vol'<br />
you need to edit the script ({{Filename|/usr/bin/ossvol}}) and change the value of the {{Codeline|CHANNEL}} variable which is at the beginning of the script. For example mine is {{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.<br />
<br />
*'''Note''' if you are using xbindkeys for your multimedia keys adding this<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume<br />
<br />
==Changing the Sample Rate==<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
#''' Make changes permanent''' use the soundon.user file to set the rate for every soundon<br />
write <code>"vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user</code> and make it executable.<br />
<br />
==Changing the Default Sound Output==<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
==Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB==<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.<br />
<br />
7. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
<br />
==简单的系统托盘小工具==<br />
想要一个GNOME那样的控制音量小工具?W [http://bbs.archlinux.org/viewtopic.php?id=77440 在这里]我得到一个可用的 [http://pastebin.furver.se/0xflchkfz/ 工具]。<br />
<br />
下载 [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这个脚本] 重命名(例如 ossvolctl),运行:<br />
$ chmod +x ossvolctl<br />
# cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
# install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
==Start ossxmix docked to systray on startup==<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/sh<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
==Record sound output from a program==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
==Suspend and Hibernation==<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [[Suspend_to_RAM|s2ram]] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
## Checking if you are a root or not<br />
if ! [ -w / ]; then<br />
echo >&2 "This script must be run as root"<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt ||<br />
echo "OSS restart failed, check /tmp/oss.txt for advice"<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>pid=$(pidof operapluginwrapper) && kill $pid</nowiki>''' before s2ram -f. }}<br />
<br />
==ALSA emulation==<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
===Instructions===<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
==Settings for specific driver==<br />
If something isn't working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)<br />
<br />
* Find out which driver is used<br />
<br />
# lspci -vnn|grep -i -A 15 audio<br />
<pre>00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)<br />
Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]<br />
Flags: bus master, medium devsel, latency 0, IRQ 21<br />
I/O ports at 2100 [size=256]<br />
I/O ports at 2200 [size=64]<br />
Memory at d0581000 (32-bit, non-prefetchable) [size=512]<br />
Memory at d0582000 (32-bit, non-prefetchable) [size=256]<br />
Capabilities: <access denied><br />
Kernel driver in use: *oss_ich*<br />
Kernel modules: snd-intel8x0</pre><br />
<br />
* Locate configuration file for device in:<br />
<br />
# cd /usr/lib/oss/conf/<br />
<br />
* Try changing defaults. There are only few settings, and they are self explanatory <br />
<br />
Setting: <br />
ich_jacksense = 1 <br />
in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).<br />
<br />
*Restart oss for changes take effects.<br />
<br />
# sudo /etc/rc.d/oss restart<br />
<br />
* oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.<br />
<br />
//////<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135444Open Sound System (简体中文)2011-03-31T13:59:28Z<p>Ly50247: /* Applications that use Gstreamer */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==使用Gstreamer的程序==<br />
<br />
移除pulseaudio和gstreamer*-pulse的程序和库。<br />
<br />
要将gstreamer的输出设置成OSS而不是缺省的ALSA,运行:<br />
<br />
gstreamer-properties<br />
<br />
把'''Default Output'''(缺省输出)选成 custom(自定义),并把文本框中内容改成: <br />
<br />
oss4sink<br />
<br />
对于输入:<br />
<br />
oss4src<br />
<br />
{{Note|oss4src不一定比osssrc听起来更好,所以只有在发现确实这样时再改。}}<br />
<br />
{{Note|对于一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties没作用,因为它们依赖 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties设置完Workaround后用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷贝到"musicaudiosink"(在一个位置)中 }}<br />
<br />
如果你用gstreamer作为phonon的后端,要设置环境变量,对于当前用户:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
把它加到 {{Filename|~/.bashrc}} 来登陆自动加载。<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== 多媒体键 ==<br />
<br />
If your multimedia keys don't work by default, read the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS Using multimedia keys with OSS] page.<br />
<br />
== 简单的系统托盘小工具 ==<br />
这是一个不依赖任何桌面环境的小工具,就类似gnome和xfce下的音量调节工具,使用鼠标滚轮直接滚动调整声音。来源于[http:/bbs.archlinux.org/viewtopic.php?id=77440 论坛],从[http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这里]下载,下载后改名为你喜欢的名字,如ossvolctl,然后赋予执行权限,复制到系统或者个人程序文件夹:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/<br />
或者执行下面的:<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
之后直接运行ossvolctl就可以看到了。如果你愿意,可以添加到自启动目录<code>~/.config/autostart</code><br />
或者添加到启动脚本<br />
<br />
== 其他提示 ==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Starting_ossxmix_minimized_to_tray_on_desktop_startup Starting ossxmix minimized to tray on desktop startup].<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135443Open Sound System (简体中文)2011-03-31T13:49:47Z<p>Ly50247: /* 配置程序来使用OSS */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
==MOC==<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
==Applications that use Gstreamer==<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
{{Note|For some applications (e.g. Rhythmbox, Totem) the gstreamer-properties have no effect, as they rely on "musicaudiosink" instead of "audiosink" (which is modified by gstreamer-properties). Workaround: Set audiosink with gstreamer-properties and use gconf-editor to copy the value of "/system/gstreamer/0.10/default/audiosink" to "musicaudiosink" (at the same location) }}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
==firefox(火狐)>=3.5==<br />
<br />
Firefox 3.5 新引进的<video>和<audio>标签支持直接播放ogg媒体。然而它不能同时支持ALSA和OSS,所以你需要安装[community]中的xulrunner-oss包。<br />
<br />
1. 关闭 firefox。<br />
2. 安装[community]中的xulrunner-oss包。<br />
3. 启动firefox。<br />
<br />
==Mplayer==<br />
<br />
如果你用GUI外壳(如smplayer)。你会发现在音频设置中有oss输出选项。如果用它本身,可以播放时指定{{Codeline|mplayer -ao oss /some/file/to/play.mkv}},如果嫌麻烦可以在{{Filename|"$HOME"/.mplayer/config}}中加入 "ao=oss"。<br />
<br />
==Music Player Daemon(MPD)==<br />
MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,检查这两个文件,找到这样的东西:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
如果你发现一个像上边的未注释的ALSA配置,注释或删掉,并加入下边的内容:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|我必须把这个配置写到 ~/.mpdconf 才能正常工作,按理预改/etc/mpd.conf也行。(应该是~/.mpdconf把优先级高或者把/etc/mpd.conf配置覆盖了)}}<br />
对于大多数用户可以不需要进一步的配置了。然而如果你的MPD重启后不成正常工作,或者你更具体地配置,OSS音频输出可以像这样更详细地配置: <br />
首先运行:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
找到类似这样{{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}的行。注意你的 <SOME_CARD_IDENTIFIER> ,然后加入下边粗体的部分到你的MPD配置文件:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== 多媒体键 ==<br />
<br />
If your multimedia keys don't work by default, read the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS Using multimedia keys with OSS] page.<br />
<br />
== 简单的系统托盘小工具 ==<br />
这是一个不依赖任何桌面环境的小工具,就类似gnome和xfce下的音量调节工具,使用鼠标滚轮直接滚动调整声音。来源于[http:/bbs.archlinux.org/viewtopic.php?id=77440 论坛],从[http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这里]下载,下载后改名为你喜欢的名字,如ossvolctl,然后赋予执行权限,复制到系统或者个人程序文件夹:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/<br />
或者执行下面的:<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
之后直接运行ossvolctl就可以看到了。如果你愿意,可以添加到自启动目录<code>~/.config/autostart</code><br />
或者添加到启动脚本<br />
<br />
== 其他提示 ==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Starting_ossxmix_minimized_to_tray_on_desktop_startup Starting ossxmix minimized to tray on desktop startup].<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135442Open Sound System (简体中文)2011-03-31T13:33:20Z<p>Ly50247: /* 配置程序来使用OSS */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
==Skype==<br />
<br />
<tt>skype</tt>包只支持ALSA ,获得支持OSS的Skype,安装 <tt>skype-oss</tt> 包:<br />
<br />
# pacman -S skype-oss<br />
<br />
如果你用的是x86_64,可以用[http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss]。<br />
<br />
==Wine==<br />
<br />
* 运行 <tt>winecfg</tt>。<br />
<br />
$ winecfg<br />
<br />
* 到<tt>Audio(音频)</tt> 选项卡。<br />
<br />
* 选择<tt>OSS Driver(OSS驱动)</tt>。<br />
<br />
==Gajim==<br />
Gajim缺省用 {{Codeline|aplay -q}}放声音。可以在Advanced Settings(高级设置)里搜索{{Codeline|soundplayer}}变量。oss提供的ossplay程序是一个好的替换:{{Codeline|ossplay -qq}}<br />
<br />
===MOC===<br />
<br />
让MOC支持OSS4,你必须把配置文件{{Filename|"$HOME"/.moc}}中的 OSSMixerDevice 改成{{Filename|/dev/ossmix}}。<br />
然后MOC就可以正常工作。或者你可以编译AUR中的moc-svn包(它支持新的vmix)。<br />
在界面下更改OSSMixerChannel可以在mocp中按'w'。<br />
<br />
===Applications that use Gstreamer===<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
{{Note|For some applications (e.g. Rhythmbox, Totem) the gstreamer-properties have no effect, as they rely on "musicaudiosink" instead of "audiosink" (which is modified by gstreamer-properties). Workaround: Set audiosink with gstreamer-properties and use gconf-editor to copy the value of "/system/gstreamer/0.10/default/audiosink" to "musicaudiosink" (at the same location) }}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
===Firefox >=3.5===<br />
<br />
Firefox 3.5 introduces the <video> and <audio> tag support and can play ogg media out of the box. However, it currently can't be compiled with ALSA and OSS support at the same time. So you need to install the xulrunner-oss package from [community].<br />
<br />
1. Stop firefox.<br />
2. Install xulrunner-oss package from [community].<br />
3. Start firefox.<br />
<br />
===Mplayer===<br />
<br />
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: {{Codeline|mplayer -ao oss /some/file/to/play.mkv}} If you don't want to bother typing it over and over again add "ao=oss" to your config file. ({{Filename|"$HOME"/.mplayer/config}})<br />
<br />
===Music Player Daemon===<br />
<br />
MPD is configured through /etc/mpd.conf or ~/.mpdconf. Check both of these files, looking for something that looks like:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "Some Device Name"<br />
}<br />
<br />
If you find an uncommented (the lines do not begin with #'s) ALSA configuration like the one above, comment all of it out, or delete it, and add the following:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
}<br />
<br />
{{Note|I had to put this configuration in my ~/.mpdconf for it to work properly, but it ought to work in /etc/mpd.conf as well.}}<br />
Further configuration might not be necessary for all users. However, if you experience issues (in that MPD doesn't work properly after it's been restarted), or if you like having specific (i.e. more user-configured, less auto-configured) config files, the audio output for OSS can be more specifically configured as follows: First, run:<br />
<br />
ossinfo | grep /dev/dsp<br />
<br />
Look for the line that says something similar to {{Codeline|/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0}}. Take note of what your <SOME_CARD_IDENTIFIER> is, and add bolded lines to your OSS audio output in your mpd config file:<br />
<br />
audio_output {<br />
type "oss"<br />
name "My OSS Device"<br />
'''device "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"'''<br />
'''mixer_device "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"'''<br />
}<br />
<br />
== 其他程序 ==<br />
<br />
* 如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 为程序设置OSSv4]这里<br />
* 用{Codeline|pacman -Ss -- -oss}} 和 [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| AUR中] 搜索特定的包。<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== 多媒体键 ==<br />
<br />
If your multimedia keys don't work by default, read the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS Using multimedia keys with OSS] page.<br />
<br />
== 简单的系统托盘小工具 ==<br />
这是一个不依赖任何桌面环境的小工具,就类似gnome和xfce下的音量调节工具,使用鼠标滚轮直接滚动调整声音。来源于[http:/bbs.archlinux.org/viewtopic.php?id=77440 论坛],从[http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这里]下载,下载后改名为你喜欢的名字,如ossvolctl,然后赋予执行权限,复制到系统或者个人程序文件夹:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/<br />
或者执行下面的:<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
之后直接运行ossvolctl就可以看到了。如果你愿意,可以添加到自启动目录<code>~/.config/autostart</code><br />
或者添加到启动脚本<br />
<br />
== 其他提示 ==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Starting_ossxmix_minimized_to_tray_on_desktop_startup Starting ossxmix minimized to tray on desktop startup].<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135441Open Sound System (简体中文)2011-03-31T13:16:58Z<p>Ly50247: /* 声音控制 */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页。<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
如果可能,把所有依赖alsa-lib的软件全部重新编译一次去掉ALSA支持是使用OSS驱动最完美的方案。查询什么软件依赖alsa-lib:<br />
$ pacman -Qi alsa-lib<br />
然后到AUR上搜索<tt>-oss</tt>结尾的软件包,下载然后运行<tt>makepkg</tt>,替代系统里面现有的包就可以了。如果AUR里面没有的,就自己下载相关PKGBUILD,去掉alsa-lib,然后makepkg并且安装,别忘记把成功的包上传到AUR上去哦<br />
<br />
== Flash插件无声 ==<br />
<br />
安装<tt>libflashsupport-oss</tt>,前提是你的系统是Arch i686.<br />
<br />
pacman -S libflashsupport-oss<br />
<br />
如果是Arch x86_64,你就需要从AUR安装[http://aur.archlinux.org/packages.php?ID=20322 lib32-libflashsupport-oss]。<br />
<br />
== Skype 问题 ==<br />
有一个特殊版本的Skype 1.4 for OSS(QT静态编译),你可以从这里获得[http://aur.archlinux.org/packages.php?do_Details=1&ID=13003&O=0&L=0&C=0&K=skype&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
一个2进制程序包可以从 skype's 下载页获取[http://skype.com/go/getskype-linux-oss].<br />
<br />
== KDE Phonon ==<br />
<br />
''原始的'' Qt Phonon应该默认就可以在OSS驱动下正常工作。<br />
<br />
但是,如果你用KDE并且使用Xine后台作为声音输出,你就可能会遇到问题。你可以用过修改默认Phonon后台来解决这个问题,如使用gstreamer<br />
<br />
编辑 <tt>~/.kde4/share/config/servicetype_profilerc</tt>:<br />
<br />
[PhononBackend]<br />
Entry0_Preference=2<br />
Entry0_Service=phononbackends/gstreamer.desktop<br />
Entry1_Preference=1<br />
Entry1_Service=phononbackends/xine.desktop<br />
NumberOfEntries=2<br />
<br />
== Wine ==<br />
<br />
* 运行<tt>winecfg</tt>.<br />
<br />
winecfg<br />
<br />
* 选择<tt>Audio</tt>选项卡.<br />
<br />
* 选种<tt>OSS Driver</tt>.<br />
<br />
<br />
== 其他程序 ==<br />
<br />
如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4]这里<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== 多媒体键 ==<br />
<br />
If your multimedia keys don't work by default, read the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS Using multimedia keys with OSS] page.<br />
<br />
== 简单的系统托盘小工具 ==<br />
这是一个不依赖任何桌面环境的小工具,就类似gnome和xfce下的音量调节工具,使用鼠标滚轮直接滚动调整声音。来源于[http:/bbs.archlinux.org/viewtopic.php?id=77440 论坛],从[http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这里]下载,下载后改名为你喜欢的名字,如ossvolctl,然后赋予执行权限,复制到系统或者个人程序文件夹:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/<br />
或者执行下面的:<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
之后直接运行ossvolctl就可以看到了。如果你愿意,可以添加到自启动目录<code>~/.config/autostart</code><br />
或者添加到启动脚本<br />
<br />
== 其他提示 ==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Starting_ossxmix_minimized_to_tray_on_desktop_startup Starting ossxmix minimized to tray on desktop startup].<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135440Open Sound System (简体中文)2011-03-31T13:15:39Z<p>Ly50247: /* 混音器 */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 声音控制 =<br />
为了控制不同设备,你要设置混音器。命令行工具是 {{Codeline|ossmix}},它很像BSD声音混音器(mixerctl)。还有一个更友好的基于图形界面的混音器 {{Codeline|ossxmix}} ,运行时依赖{{Package Official|gtk2}}。<br />
<br />
<tt>ossxmix</tt>的基本界面和控制功能如下:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# 一个声卡一个标签页<br />
# Vmix (虚拟混音器) 的特别配置,包括采样率和混音器优先级。<br />
# 这是你声卡的插孔(输入和输出)的配置。声卡提供的每一个混音器控制都在这里显示。<br />
# 应用程序vmix混音器和音量控制。如果程序不在播放声音它会用pcm08, pcm09...标记,当播放时会显示程序名称。<br />
<br />
== 颜色定义 ==<br />
<br />
对于high definition (HD) audio,{{Codeline|ossxmix}}会用预定义的颜色显示jack的设置:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
==保存和恢复混音器设置==<br />
<br />
混音器设置在关机时会保存,如果你现在就要保存,可以运行:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} 可以用来把音量记录在文件中(用 {{Codeline|-f}} 选项)然后用 {{Codeline|-L}} 选项恢复。<br />
<br />
== 其他的混音器程序 ==<br />
<br />
其他支持OSS的混音器程序有:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS的支持正在开发中。<br />
<br />
= 配置程序来使用OSS =<br />
<br />
如果可能,把所有依赖alsa-lib的软件全部重新编译一次去掉ALSA支持是使用OSS驱动最完美的方案。查询什么软件依赖alsa-lib:<br />
$ pacman -Qi alsa-lib<br />
然后到AUR上搜索<tt>-oss</tt>结尾的软件包,下载然后运行<tt>makepkg</tt>,替代系统里面现有的包就可以了。如果AUR里面没有的,就自己下载相关PKGBUILD,去掉alsa-lib,然后makepkg并且安装,别忘记把成功的包上传到AUR上去哦<br />
<br />
== Flash插件无声 ==<br />
<br />
安装<tt>libflashsupport-oss</tt>,前提是你的系统是Arch i686.<br />
<br />
pacman -S libflashsupport-oss<br />
<br />
如果是Arch x86_64,你就需要从AUR安装[http://aur.archlinux.org/packages.php?ID=20322 lib32-libflashsupport-oss]。<br />
<br />
== Skype 问题 ==<br />
有一个特殊版本的Skype 1.4 for OSS(QT静态编译),你可以从这里获得[http://aur.archlinux.org/packages.php?do_Details=1&ID=13003&O=0&L=0&C=0&K=skype&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
一个2进制程序包可以从 skype's 下载页获取[http://skype.com/go/getskype-linux-oss].<br />
<br />
== KDE Phonon ==<br />
<br />
''原始的'' Qt Phonon应该默认就可以在OSS驱动下正常工作。<br />
<br />
但是,如果你用KDE并且使用Xine后台作为声音输出,你就可能会遇到问题。你可以用过修改默认Phonon后台来解决这个问题,如使用gstreamer<br />
<br />
编辑 <tt>~/.kde4/share/config/servicetype_profilerc</tt>:<br />
<br />
[PhononBackend]<br />
Entry0_Preference=2<br />
Entry0_Service=phononbackends/gstreamer.desktop<br />
Entry1_Preference=1<br />
Entry1_Service=phononbackends/xine.desktop<br />
NumberOfEntries=2<br />
<br />
== Wine ==<br />
<br />
* 运行<tt>winecfg</tt>.<br />
<br />
winecfg<br />
<br />
* 选择<tt>Audio</tt>选项卡.<br />
<br />
* 选种<tt>OSS Driver</tt>.<br />
<br />
<br />
== 其他程序 ==<br />
<br />
如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4]这里<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== 多媒体键 ==<br />
<br />
If your multimedia keys don't work by default, read the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS Using multimedia keys with OSS] page.<br />
<br />
== 简单的系统托盘小工具 ==<br />
这是一个不依赖任何桌面环境的小工具,就类似gnome和xfce下的音量调节工具,使用鼠标滚轮直接滚动调整声音。来源于[http:/bbs.archlinux.org/viewtopic.php?id=77440 论坛],从[http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这里]下载,下载后改名为你喜欢的名字,如ossvolctl,然后赋予执行权限,复制到系统或者个人程序文件夹:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/<br />
或者执行下面的:<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
之后直接运行ossvolctl就可以看到了。如果你愿意,可以添加到自启动目录<code>~/.config/autostart</code><br />
或者添加到启动脚本<br />
<br />
== 其他提示 ==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Starting_ossxmix_minimized_to_tray_on_desktop_startup Starting ossxmix minimized to tray on desktop startup].<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135438Open Sound System (简体中文)2011-03-31T12:54:50Z<p>Ly50247: /* 测试 */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
<br />
要注意默认的音量很高,不要戴耳机,并且调低扬声器的音量(如果可以),然后再进行测试:<br />
<br />
'''测试OSS:'''<br />
<br />
$ osstest<br />
<br />
你应该能在测试过程中听到音乐,如果没有,尝试在接下来的步骤里调节音量。<br />
<br />
如果你要让多个程序同时发声,可以用OSS的软件混音器——vmix。<br />
<br />
'''检查vmix是否开启了:'''<br />
<br />
$ ossmix -a | grep -i vmix<br />
<br />
你应该能看到类似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你没看到任何含'vmix'的行,很可能vmix没有依附到你的声音设备上,运行下面命令: <br />
<br />
$ vmixctl attach device<br />
<br />
其中''device''是你的声音设备,比如/dev/oss/oss_envy240/pcm0。<br />
<br />
为了避免将来手动运行这个命令,可以把它加到/usr/lib/oss/soundon.user里,像[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output]中建议的。<br />
<br />
如果你看到了"Device or resource busy"(设备或资源繁忙)的错误,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然后重启。 <br />
<br />
'''查看哪个设置被检测到了:'''<br />
<br />
$ ossinfo<br />
<br />
你应该能够看到你的设备列在Device objects 或 Audio Devices下。如果你要用的设备不在其中,需要编辑 /usr/lib/oss/etc/installed_drivers 。设备的驱动应该在更上边。而后可能需要运行soundoff, soundon。如果还不工作,注释掉所有不必要的驱动。<br />
<br />
= 混音器 =<br />
基于命令行到混音器叫 ossmix,它很像BSD声音混音器(mixerctl)。<br />
还有一个更友好的基于图形界面的混音器 ossxmix。运行需要依赖gtk2。<br />
ossxmix的控制功能解释如下:<br />
<br />
______________________________<br />
/ High Definition Audio ALC262 \ ----------------------------------> 声卡的标签<br />
/________________________________\_______________________________<br />
|<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels \ The vmix (virtual mixer) special configurations<br />
| [ Stereo [v] ] |--> appear at the top. These include sampling rate<br />
| / and mixer priority. They are provided by OSS.<br />
| __codec1______________________________________________________ <br />
| | _jack_______________________________________________________ \ <br />
| | | _int-speaker____________________ __green_________________ |<br />
| | | | | | | <br />
| | | | _mode______ | | | | _mode______ | | | 这儿是你的声卡的配置。<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] |--> 这儿显示的控制器都是根据你的声卡配置的。<br />
| | | | | | | | | | | <br />
| | | |________________________________| |_______________________ |<br />
| | |____________________________________________________________ |<br />
| |______________________________________________________________ /<br />
|<br />
| ___vmix0_______________________________________________________ \<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | Here are the vmix mixer controls. These are<br />
| | | | O O | | x x | | O O | virtual mixer controls provided by OSS. Each<br />
| | | | | | x O | | | | x x | | | | O O | slider is the volume control of a different<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O |--> application. When one application uses the<br />
| | | | | | x x | | | | x x | | | | O O | sound card, its name is shown in the place of<br />
| | |_________| x x |_________| x x |_________| O O | the 'pcm#' labels. There are also sound level<br />
| |______________________________________________________________ | meter levels for each application.<br />
|________________________________________________________________ /<br />
<br />
===保存和恢复混音器设置===<br />
如果你希望手动保存混音器设置,运行savemixer。这样做你需要文件/usr/lib/oss/etc/save.mixer的写权限或者使用-f选择另外一个文件。使用savemixer -L重置混音器的设置。初始脚本通过在关闭前和启动后运行下列命令来在不同的会话间保存混音器的设置:<br />
savemixer<br />
<br />
<br />
= 配置程序来使用OSS =<br />
<br />
如果可能,把所有依赖alsa-lib的软件全部重新编译一次去掉ALSA支持是使用OSS驱动最完美的方案。查询什么软件依赖alsa-lib:<br />
$ pacman -Qi alsa-lib<br />
然后到AUR上搜索<tt>-oss</tt>结尾的软件包,下载然后运行<tt>makepkg</tt>,替代系统里面现有的包就可以了。如果AUR里面没有的,就自己下载相关PKGBUILD,去掉alsa-lib,然后makepkg并且安装,别忘记把成功的包上传到AUR上去哦<br />
<br />
== Flash插件无声 ==<br />
<br />
安装<tt>libflashsupport-oss</tt>,前提是你的系统是Arch i686.<br />
<br />
pacman -S libflashsupport-oss<br />
<br />
如果是Arch x86_64,你就需要从AUR安装[http://aur.archlinux.org/packages.php?ID=20322 lib32-libflashsupport-oss]。<br />
<br />
== Skype 问题 ==<br />
有一个特殊版本的Skype 1.4 for OSS(QT静态编译),你可以从这里获得[http://aur.archlinux.org/packages.php?do_Details=1&ID=13003&O=0&L=0&C=0&K=skype&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
一个2进制程序包可以从 skype's 下载页获取[http://skype.com/go/getskype-linux-oss].<br />
<br />
== KDE Phonon ==<br />
<br />
''原始的'' Qt Phonon应该默认就可以在OSS驱动下正常工作。<br />
<br />
但是,如果你用KDE并且使用Xine后台作为声音输出,你就可能会遇到问题。你可以用过修改默认Phonon后台来解决这个问题,如使用gstreamer<br />
<br />
编辑 <tt>~/.kde4/share/config/servicetype_profilerc</tt>:<br />
<br />
[PhononBackend]<br />
Entry0_Preference=2<br />
Entry0_Service=phononbackends/gstreamer.desktop<br />
Entry1_Preference=1<br />
Entry1_Service=phononbackends/xine.desktop<br />
NumberOfEntries=2<br />
<br />
== Wine ==<br />
<br />
* 运行<tt>winecfg</tt>.<br />
<br />
winecfg<br />
<br />
* 选择<tt>Audio</tt>选项卡.<br />
<br />
* 选种<tt>OSS Driver</tt>.<br />
<br />
<br />
== 其他程序 ==<br />
<br />
如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4]这里<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== 多媒体键 ==<br />
<br />
If your multimedia keys don't work by default, read the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS Using multimedia keys with OSS] page.<br />
<br />
== 简单的系统托盘小工具 ==<br />
这是一个不依赖任何桌面环境的小工具,就类似gnome和xfce下的音量调节工具,使用鼠标滚轮直接滚动调整声音。来源于[http:/bbs.archlinux.org/viewtopic.php?id=77440 论坛],从[http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这里]下载,下载后改名为你喜欢的名字,如ossvolctl,然后赋予执行权限,复制到系统或者个人程序文件夹:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/<br />
或者执行下面的:<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
之后直接运行ossvolctl就可以看到了。如果你愿意,可以添加到自启动目录<code>~/.config/autostart</code><br />
或者添加到启动脚本<br />
<br />
== 其他提示 ==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Starting_ossxmix_minimized_to_tray_on_desktop_startup Starting ossxmix minimized to tray on desktop startup].<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135437Open Sound System (简体中文)2011-03-31T12:39:26Z<p>Ly50247: /* 安装 */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
这会安装OSS并运行其启动脚本,它会暂时使ALSA模块失效,并安装OSS内核模块。因为ALSA在引导过程中默认开启,你需要关闭它以免引导时它与OSS发生冲突。可以编辑{Filename|rc.conf}} 文件并添加:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
然后将OSS加入守护进程中:<br />
<br />
DAEMONS=(crond hal @oss...<br />
<br />
如果用户不在audio组里,把他加进去:<br />
<br />
# gpasswd -a username audio<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
如果OSS无法检测到你的声卡,运行:<br />
<br />
# ossdetect -v<br />
<br />
然后运行 {{Codeline|soundoff && soundon}} 来重新激活它。<br />
<br />
= 测试 =<br />
* 运行以下命令测试OSS:<br />
$ osstest<br />
在测试过程中你应该能听到音乐。<br />
<br />
<br />
= 混音器 =<br />
基于命令行到混音器叫 ossmix,它很像BSD声音混音器(mixerctl)。<br />
还有一个更友好的基于图形界面的混音器 ossxmix。运行需要依赖gtk2。<br />
ossxmix的控制功能解释如下:<br />
<br />
______________________________<br />
/ High Definition Audio ALC262 \ ----------------------------------> 声卡的标签<br />
/________________________________\_______________________________<br />
|<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels \ The vmix (virtual mixer) special configurations<br />
| [ Stereo [v] ] |--> appear at the top. These include sampling rate<br />
| / and mixer priority. They are provided by OSS.<br />
| __codec1______________________________________________________ <br />
| | _jack_______________________________________________________ \ <br />
| | | _int-speaker____________________ __green_________________ |<br />
| | | | | | | <br />
| | | | _mode______ | | | | _mode______ | | | 这儿是你的声卡的配置。<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] |--> 这儿显示的控制器都是根据你的声卡配置的。<br />
| | | | | | | | | | | <br />
| | | |________________________________| |_______________________ |<br />
| | |____________________________________________________________ |<br />
| |______________________________________________________________ /<br />
|<br />
| ___vmix0_______________________________________________________ \<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | Here are the vmix mixer controls. These are<br />
| | | | O O | | x x | | O O | virtual mixer controls provided by OSS. Each<br />
| | | | | | x O | | | | x x | | | | O O | slider is the volume control of a different<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O |--> application. When one application uses the<br />
| | | | | | x x | | | | x x | | | | O O | sound card, its name is shown in the place of<br />
| | |_________| x x |_________| x x |_________| O O | the 'pcm#' labels. There are also sound level<br />
| |______________________________________________________________ | meter levels for each application.<br />
|________________________________________________________________ /<br />
<br />
===保存和恢复混音器设置===<br />
如果你希望手动保存混音器设置,运行savemixer。这样做你需要文件/usr/lib/oss/etc/save.mixer的写权限或者使用-f选择另外一个文件。使用savemixer -L重置混音器的设置。初始脚本通过在关闭前和启动后运行下列命令来在不同的会话间保存混音器的设置:<br />
savemixer<br />
<br />
<br />
= 配置程序来使用OSS =<br />
<br />
如果可能,把所有依赖alsa-lib的软件全部重新编译一次去掉ALSA支持是使用OSS驱动最完美的方案。查询什么软件依赖alsa-lib:<br />
$ pacman -Qi alsa-lib<br />
然后到AUR上搜索<tt>-oss</tt>结尾的软件包,下载然后运行<tt>makepkg</tt>,替代系统里面现有的包就可以了。如果AUR里面没有的,就自己下载相关PKGBUILD,去掉alsa-lib,然后makepkg并且安装,别忘记把成功的包上传到AUR上去哦<br />
<br />
== Flash插件无声 ==<br />
<br />
安装<tt>libflashsupport-oss</tt>,前提是你的系统是Arch i686.<br />
<br />
pacman -S libflashsupport-oss<br />
<br />
如果是Arch x86_64,你就需要从AUR安装[http://aur.archlinux.org/packages.php?ID=20322 lib32-libflashsupport-oss]。<br />
<br />
== Skype 问题 ==<br />
有一个特殊版本的Skype 1.4 for OSS(QT静态编译),你可以从这里获得[http://aur.archlinux.org/packages.php?do_Details=1&ID=13003&O=0&L=0&C=0&K=skype&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
一个2进制程序包可以从 skype's 下载页获取[http://skype.com/go/getskype-linux-oss].<br />
<br />
== KDE Phonon ==<br />
<br />
''原始的'' Qt Phonon应该默认就可以在OSS驱动下正常工作。<br />
<br />
但是,如果你用KDE并且使用Xine后台作为声音输出,你就可能会遇到问题。你可以用过修改默认Phonon后台来解决这个问题,如使用gstreamer<br />
<br />
编辑 <tt>~/.kde4/share/config/servicetype_profilerc</tt>:<br />
<br />
[PhononBackend]<br />
Entry0_Preference=2<br />
Entry0_Service=phononbackends/gstreamer.desktop<br />
Entry1_Preference=1<br />
Entry1_Service=phononbackends/xine.desktop<br />
NumberOfEntries=2<br />
<br />
== Wine ==<br />
<br />
* 运行<tt>winecfg</tt>.<br />
<br />
winecfg<br />
<br />
* 选择<tt>Audio</tt>选项卡.<br />
<br />
* 选种<tt>OSS Driver</tt>.<br />
<br />
<br />
== 其他程序 ==<br />
<br />
如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4]这里<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== 多媒体键 ==<br />
<br />
If your multimedia keys don't work by default, read the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS Using multimedia keys with OSS] page.<br />
<br />
== 简单的系统托盘小工具 ==<br />
这是一个不依赖任何桌面环境的小工具,就类似gnome和xfce下的音量调节工具,使用鼠标滚轮直接滚动调整声音。来源于[http:/bbs.archlinux.org/viewtopic.php?id=77440 论坛],从[http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这里]下载,下载后改名为你喜欢的名字,如ossvolctl,然后赋予执行权限,复制到系统或者个人程序文件夹:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/<br />
或者执行下面的:<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
之后直接运行ossvolctl就可以看到了。如果你愿意,可以添加到自启动目录<code>~/.config/autostart</code><br />
或者添加到启动脚本<br />
<br />
== 其他提示 ==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Starting_ossxmix_minimized_to_tray_on_desktop_startup Starting ossxmix minimized to tray on desktop startup].<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135436Open Sound System (简体中文)2011-03-31T12:30:20Z<p>Ly50247: /* 与ALSA驱动对比 */</p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
OSS与ALSA相比的一些优缺点。<br />
<br />
== OSS的优点(对用户来说) ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些老声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 声音程序的初始反应时间一般更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模拟。<br />
<br />
== OSS的优点(对开发者来说) ==<br />
* 清晰的API[http://manuals.opensound.com/developer 文档],更易于使用。<br />
* 支持用户空间的声音驱动。<br />
* 可移植性强,OSS也可以在BSDs和Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== ALSA的优点 ==<br />
* ALSA对USB音频设备支持更好,而OSS的输出还在试验中,输入还未实现。<br />
* ALSA支持蓝牙声音设备。<br />
* ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。<br />
* ALSA对MIDI支持得更好,但用OSS你只能通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* ALSA对待机支持更好,而用OSS,你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* OSS的jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。而ALSA没这个问题。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
* 把<tt>oss</tt>加到你的 <tt>/etc/rc.conf</tt>文件的 <tt>DAEMONS</tt> 列中,这样启动时会自动加载oss。<br />
<br />
'''注意:'''<br />
* 最好能把alsa删除了也就是<tt>alsa-utils</tt>。<br />
* 上面的步骤用于安装oss 4.1,如果你想安装oss 4.0,你依旧可以在这找到它 [http://aur.archlinux.org/packages.php?ID=14421 AUR]。<br />
* 请注意,如果是从oss-linux-free升级来的用户,请注意删除/usr/lib/oss文件夹。现在配置文件特别是里面定义的模块有很大变化。最好删除。否则会出现找不到模块,没有声音之类的问题。如果不幸遇到,就删除OSS后,删除/usr/lib/oss文件夹,然后重启再安装OSS,再次重启。<br />
<br />
= 测试 =<br />
* 运行以下命令测试OSS:<br />
$ osstest<br />
在测试过程中你应该能听到音乐。<br />
<br />
<br />
= 混音器 =<br />
基于命令行到混音器叫 ossmix,它很像BSD声音混音器(mixerctl)。<br />
还有一个更友好的基于图形界面的混音器 ossxmix。运行需要依赖gtk2。<br />
ossxmix的控制功能解释如下:<br />
<br />
______________________________<br />
/ High Definition Audio ALC262 \ ----------------------------------> 声卡的标签<br />
/________________________________\_______________________________<br />
|<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels \ The vmix (virtual mixer) special configurations<br />
| [ Stereo [v] ] |--> appear at the top. These include sampling rate<br />
| / and mixer priority. They are provided by OSS.<br />
| __codec1______________________________________________________ <br />
| | _jack_______________________________________________________ \ <br />
| | | _int-speaker____________________ __green_________________ |<br />
| | | | | | | <br />
| | | | _mode______ | | | | _mode______ | | | 这儿是你的声卡的配置。<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] |--> 这儿显示的控制器都是根据你的声卡配置的。<br />
| | | | | | | | | | | <br />
| | | |________________________________| |_______________________ |<br />
| | |____________________________________________________________ |<br />
| |______________________________________________________________ /<br />
|<br />
| ___vmix0_______________________________________________________ \<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | Here are the vmix mixer controls. These are<br />
| | | | O O | | x x | | O O | virtual mixer controls provided by OSS. Each<br />
| | | | | | x O | | | | x x | | | | O O | slider is the volume control of a different<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O |--> application. When one application uses the<br />
| | | | | | x x | | | | x x | | | | O O | sound card, its name is shown in the place of<br />
| | |_________| x x |_________| x x |_________| O O | the 'pcm#' labels. There are also sound level<br />
| |______________________________________________________________ | meter levels for each application.<br />
|________________________________________________________________ /<br />
<br />
===保存和恢复混音器设置===<br />
如果你希望手动保存混音器设置,运行savemixer。这样做你需要文件/usr/lib/oss/etc/save.mixer的写权限或者使用-f选择另外一个文件。使用savemixer -L重置混音器的设置。初始脚本通过在关闭前和启动后运行下列命令来在不同的会话间保存混音器的设置:<br />
savemixer<br />
<br />
<br />
= 配置程序来使用OSS =<br />
<br />
如果可能,把所有依赖alsa-lib的软件全部重新编译一次去掉ALSA支持是使用OSS驱动最完美的方案。查询什么软件依赖alsa-lib:<br />
$ pacman -Qi alsa-lib<br />
然后到AUR上搜索<tt>-oss</tt>结尾的软件包,下载然后运行<tt>makepkg</tt>,替代系统里面现有的包就可以了。如果AUR里面没有的,就自己下载相关PKGBUILD,去掉alsa-lib,然后makepkg并且安装,别忘记把成功的包上传到AUR上去哦<br />
<br />
== Flash插件无声 ==<br />
<br />
安装<tt>libflashsupport-oss</tt>,前提是你的系统是Arch i686.<br />
<br />
pacman -S libflashsupport-oss<br />
<br />
如果是Arch x86_64,你就需要从AUR安装[http://aur.archlinux.org/packages.php?ID=20322 lib32-libflashsupport-oss]。<br />
<br />
== Skype 问题 ==<br />
有一个特殊版本的Skype 1.4 for OSS(QT静态编译),你可以从这里获得[http://aur.archlinux.org/packages.php?do_Details=1&ID=13003&O=0&L=0&C=0&K=skype&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
一个2进制程序包可以从 skype's 下载页获取[http://skype.com/go/getskype-linux-oss].<br />
<br />
== KDE Phonon ==<br />
<br />
''原始的'' Qt Phonon应该默认就可以在OSS驱动下正常工作。<br />
<br />
但是,如果你用KDE并且使用Xine后台作为声音输出,你就可能会遇到问题。你可以用过修改默认Phonon后台来解决这个问题,如使用gstreamer<br />
<br />
编辑 <tt>~/.kde4/share/config/servicetype_profilerc</tt>:<br />
<br />
[PhononBackend]<br />
Entry0_Preference=2<br />
Entry0_Service=phononbackends/gstreamer.desktop<br />
Entry1_Preference=1<br />
Entry1_Service=phononbackends/xine.desktop<br />
NumberOfEntries=2<br />
<br />
== Wine ==<br />
<br />
* 运行<tt>winecfg</tt>.<br />
<br />
winecfg<br />
<br />
* 选择<tt>Audio</tt>选项卡.<br />
<br />
* 选种<tt>OSS Driver</tt>.<br />
<br />
<br />
== 其他程序 ==<br />
<br />
如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4]这里<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== 多媒体键 ==<br />
<br />
If your multimedia keys don't work by default, read the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS Using multimedia keys with OSS] page.<br />
<br />
== 简单的系统托盘小工具 ==<br />
这是一个不依赖任何桌面环境的小工具,就类似gnome和xfce下的音量调节工具,使用鼠标滚轮直接滚动调整声音。来源于[http:/bbs.archlinux.org/viewtopic.php?id=77440 论坛],从[http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这里]下载,下载后改名为你喜欢的名字,如ossvolctl,然后赋予执行权限,复制到系统或者个人程序文件夹:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/<br />
或者执行下面的:<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
之后直接运行ossvolctl就可以看到了。如果你愿意,可以添加到自启动目录<code>~/.config/autostart</code><br />
或者添加到启动脚本<br />
<br />
== 其他提示 ==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Starting_ossxmix_minimized_to_tray_on_desktop_startup Starting ossxmix minimized to tray on desktop startup].<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Open_Sound_System_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135435Open Sound System (简体中文)2011-03-31T12:15:08Z<p>Ly50247: </p>
<hr />
<div>[[Category:声音]]<br />
[[Category:音频/视频]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
{{i18n|OSS}}<br />
{{translateme}}<br />
<br />
这篇文章讲述如果在你的电脑上安装和配置'''O'''pen '''S'''ound '''S'''ystem (OSS)。<br />
<br />
[http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] 是一个类Unix和POSIX兼容系统上一个可选的声音架构。OSSv3是Linux下原始的声音系统并集成在内核里,但是OSSv4在2002年OSS成为商业软件时它地位被ALSA所取代。OSSv4在2007年又成为了开源软件 ,[http://www.opensound.com/ 4Front Technologies] 以GPL协议发布了它的源码。<br />
<br />
= 与ALSA驱动对比 =<br />
<br />
== (对用户来说)OSS的优点 ==<br />
* 在内核空间(kernel space)里面包含了一个透明软件混音器(vmix)。这样多个程序就可以同时使用声音设备而且没有任何问题。<br />
* 这个混音器可以让你单独调节各个程序的音量。<br />
* 对某些声卡有着更好的支持比如创新(Creative)的X-Fi。<br />
* 一般来说声音质量更好。<br />
* 对使用OSS的应用程序接口(API)的程序有更好的支持(废话。。),很多程序都支持OSS的API,然而ALSA的OSS虚拟方式是有很多问题的。<br />
<br />
== (对开发者来说)OSS的优点 ==<br />
* 清晰的API,更简单的应用。<br />
* API本身也更好,[http://manuals.opensound.com/developer 相关文档].<br />
* 支持用户空间的声音驱动(oss_userdev)。<br />
* 可移植性强,如果程序在Linux下支持OSS,那么它也可以在FreeBSD,Solaris下运行。<br />
* 本身可以跨平台,可以更[http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf 方便]移植到新的操作系统。<br />
<br />
== OSS的缺点 ==<br />
* USB声卡驱动支持目前在linux下还是试验性质的。<br />
* 蓝牙声音设备目前还不支持。<br />
* AC'97和HDAudio dial-up soft-modems (比如Si3055)目前还不支持<br />
* MIDI支持目前还未完成。但是你可以通过软件合成器(如timidity和fluidsynth)来使用MIDI。<br />
* 待机目前还不支持。你需要在待机前使用<tt>soundoff</tt>来停止OSS驱动,在恢复后使用<tt>soundon</tt>来启动OSS。<br />
* 自动jack检测目前在'''某些'''HDAudio-powered主板上不能正常工作。也就是说在某些型号的主板上,你可能需要在插入耳机的时候手动关闭外置扬声器。<br />
<br />
= 安装 =<br />
* 运行下面的命令安装oss:<br />
<br />
# pacman -S oss<br />
<br />
* 运行下面的命令启动oss:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
* 把<tt>oss</tt>加到你的 <tt>/etc/rc.conf</tt>文件的 <tt>DAEMONS</tt> 列中,这样启动时会自动加载oss。<br />
<br />
'''注意:'''<br />
* 最好能把alsa删除了也就是<tt>alsa-utils</tt>。<br />
* 上面的步骤用于安装oss 4.1,如果你想安装oss 4.0,你依旧可以在这找到它 [http://aur.archlinux.org/packages.php?ID=14421 AUR]。<br />
* 请注意,如果是从oss-linux-free升级来的用户,请注意删除/usr/lib/oss文件夹。现在配置文件特别是里面定义的模块有很大变化。最好删除。否则会出现找不到模块,没有声音之类的问题。如果不幸遇到,就删除OSS后,删除/usr/lib/oss文件夹,然后重启再安装OSS,再次重启。<br />
<br />
= 测试 =<br />
* 运行以下命令测试OSS:<br />
$ osstest<br />
在测试过程中你应该能听到音乐。<br />
<br />
<br />
= 混音器 =<br />
基于命令行到混音器叫 ossmix,它很像BSD声音混音器(mixerctl)。<br />
还有一个更友好的基于图形界面的混音器 ossxmix。运行需要依赖gtk2。<br />
ossxmix的控制功能解释如下:<br />
<br />
______________________________<br />
/ High Definition Audio ALC262 \ ----------------------------------> 声卡的标签<br />
/________________________________\_______________________________<br />
|<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels \ The vmix (virtual mixer) special configurations<br />
| [ Stereo [v] ] |--> appear at the top. These include sampling rate<br />
| / and mixer priority. They are provided by OSS.<br />
| __codec1______________________________________________________ <br />
| | _jack_______________________________________________________ \ <br />
| | | _int-speaker____________________ __green_________________ |<br />
| | | | | | | <br />
| | | | _mode______ | | | | _mode______ | | | 这儿是你的声卡的配置。<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] |--> 这儿显示的控制器都是根据你的声卡配置的。<br />
| | | | | | | | | | | <br />
| | | |________________________________| |_______________________ |<br />
| | |____________________________________________________________ |<br />
| |______________________________________________________________ /<br />
|<br />
| ___vmix0_______________________________________________________ \<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | Here are the vmix mixer controls. These are<br />
| | | | O O | | x x | | O O | virtual mixer controls provided by OSS. Each<br />
| | | | | | x O | | | | x x | | | | O O | slider is the volume control of a different<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O |--> application. When one application uses the<br />
| | | | | | x x | | | | x x | | | | O O | sound card, its name is shown in the place of<br />
| | |_________| x x |_________| x x |_________| O O | the 'pcm#' labels. There are also sound level<br />
| |______________________________________________________________ | meter levels for each application.<br />
|________________________________________________________________ /<br />
<br />
===保存和恢复混音器设置===<br />
如果你希望手动保存混音器设置,运行savemixer。这样做你需要文件/usr/lib/oss/etc/save.mixer的写权限或者使用-f选择另外一个文件。使用savemixer -L重置混音器的设置。初始脚本通过在关闭前和启动后运行下列命令来在不同的会话间保存混音器的设置:<br />
savemixer<br />
<br />
<br />
= 配置程序来使用OSS =<br />
<br />
如果可能,把所有依赖alsa-lib的软件全部重新编译一次去掉ALSA支持是使用OSS驱动最完美的方案。查询什么软件依赖alsa-lib:<br />
$ pacman -Qi alsa-lib<br />
然后到AUR上搜索<tt>-oss</tt>结尾的软件包,下载然后运行<tt>makepkg</tt>,替代系统里面现有的包就可以了。如果AUR里面没有的,就自己下载相关PKGBUILD,去掉alsa-lib,然后makepkg并且安装,别忘记把成功的包上传到AUR上去哦<br />
<br />
== Flash插件无声 ==<br />
<br />
安装<tt>libflashsupport-oss</tt>,前提是你的系统是Arch i686.<br />
<br />
pacman -S libflashsupport-oss<br />
<br />
如果是Arch x86_64,你就需要从AUR安装[http://aur.archlinux.org/packages.php?ID=20322 lib32-libflashsupport-oss]。<br />
<br />
== Skype 问题 ==<br />
有一个特殊版本的Skype 1.4 for OSS(QT静态编译),你可以从这里获得[http://aur.archlinux.org/packages.php?do_Details=1&ID=13003&O=0&L=0&C=0&K=skype&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
一个2进制程序包可以从 skype's 下载页获取[http://skype.com/go/getskype-linux-oss].<br />
<br />
== KDE Phonon ==<br />
<br />
''原始的'' Qt Phonon应该默认就可以在OSS驱动下正常工作。<br />
<br />
但是,如果你用KDE并且使用Xine后台作为声音输出,你就可能会遇到问题。你可以用过修改默认Phonon后台来解决这个问题,如使用gstreamer<br />
<br />
编辑 <tt>~/.kde4/share/config/servicetype_profilerc</tt>:<br />
<br />
[PhononBackend]<br />
Entry0_Preference=2<br />
Entry0_Service=phononbackends/gstreamer.desktop<br />
Entry1_Preference=1<br />
Entry1_Service=phononbackends/xine.desktop<br />
NumberOfEntries=2<br />
<br />
== Wine ==<br />
<br />
* 运行<tt>winecfg</tt>.<br />
<br />
winecfg<br />
<br />
* 选择<tt>Audio</tt>选项卡.<br />
<br />
* 选种<tt>OSS Driver</tt>.<br />
<br />
<br />
== 其他程序 ==<br />
<br />
如果你不能让其他程序发出声音,试试看[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4]这里<br />
<br />
= 问题以及解决 =<br />
== HDAudio硬件的问题解决 ==<br />
<br />
=== 问题如何产生 ===<br />
<br />
如果你有一个HDAudio声音设备,有可能你必须调整一些设置你的声卡才能正常工作。<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time.(参考翻译:任何时间软件都可以调整强大的HDAudio上包含的很多小器件)。这些控制对混音器是外露的,例如,可以被用来把耳机声音输出功能改到声音输入功能。<br />
<br />
但是,这可能导致问题,主要因为HDAudio标准比理想中应该有的标准来说太灵活了,也因为计算机开发商经常支持关注怎么让''官方驱动''正常工作。<br />
<br />
所以你才会在使用HDAudio设备的时候,发现控制是混乱的,必须自己尝试手动调整每一个控制条直到可以工作,因为默认根本不会正常工作。你需要在前台调整ossxmix混音器设定的时候,后台有个程序录制/播放声音(比如 <tt>ossrecord - | ossplay -</tt> 来录制或者 <tt>osstest -lV</tt>来播放)。<br />
<br />
=== 如何解决 ===<br />
<br />
打开<tt>ossxmix</tt>,尝试改变每个控制条到中间位置,这包含在声卡特殊设定,就如上面"[[OSS#The_mixer|混音器]]"说到的一样。<br />
<br />
* 把每个音量控制条往上调整Raise every volume control slider.<br />
* 在每个选择框里面,尝试改变选项,一定要尝试每个可能的选项<br />
* 如果你听到有噪音,一个一个尝试把某些控制往下调整或者静音,直到你找到噪音的来源。<br />
<br />
请注意,你'''不必'''调整顶部区域和底部区域的有关虚拟<tt>vmix</tt>混音器控制的部分控制条。<br />
<br />
== 解决其他问题 ==<br />
<br />
* 类似ALSA的,你需要降低main音量和PCM音量来一定程序上减少噪音(这根据你芯片情况而定。我使用vol=65,pcm=65,芯片为via8237)<br />
<br />
* 看[http://4front-tech.com/forum/viewtopic.php?t=2358 这里]了解如何设定默认声卡,因为默认的选择不是最优的。<br />
<br />
* 如果一个程序播放声音遇到困难, 4front的wiki里面可能有[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 解决办法].<br />
<br />
* 如果你有其他问题,尝试在这个地方搜索或者发帖: http://www.4front-tech.com/forum/<br />
<br />
= 提示和小技巧 =<br />
<br />
== 多媒体键 ==<br />
<br />
If your multimedia keys don't work by default, read the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS Using multimedia keys with OSS] page.<br />
<br />
== 简单的系统托盘小工具 ==<br />
这是一个不依赖任何桌面环境的小工具,就类似gnome和xfce下的音量调节工具,使用鼠标滚轮直接滚动调整声音。来源于[http:/bbs.archlinux.org/viewtopic.php?id=77440 论坛],从[http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt 这里]下载,下载后改名为你喜欢的名字,如ossvolctl,然后赋予执行权限,复制到系统或者个人程序文件夹:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/<br />
或者执行下面的:<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
之后直接运行ossvolctl就可以看到了。如果你愿意,可以添加到自启动目录<code>~/.config/autostart</code><br />
或者添加到启动脚本<br />
<br />
== 其他提示 ==<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Starting_ossxmix_minimized_to_tray_on_desktop_startup Starting ossxmix minimized to tray on desktop startup].<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
== ALSA虚拟机 ==<br />
=== 介绍 ===<br />
你可以让<tt>alsa-lib</tt>使用OSS作为它的声音输出系统,这对很多ALSA虚拟机有效。<br />
<br />
注意:这个方法可能在你声音输出的时候造成额外的延迟,而且虚拟机也不完善,无法保证能让所有程序发声。例如如果软件通过ALSA选择设备,这个软件就不能正常工作。如last.fm<br />
<br />
以后,更完善的方法将出现用来虚拟ALSA,如<tt>libsalsa</tt>以及<tt>cuckoo</tt>.<br />
<br />
<nowiki>OSS为ALSA提供了2个兼容层(layers):内核和ALSA lib。内核模块("cuckoo")是100%兼容所有程序,但是不能和最新的OSS版本;oss里面的alsa虚拟库已经过时,我也不知道到哪里去获得最新版本。</nowiki><br />
<br />
=== 方法 ===<br />
<br />
# 安装<tt>alsa-plugins</tt><br />
<br />
pacman -S alsa-plugins<br />
<br />
# Edit ''/etc/asound.conf'':<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
== System-wide (software) equalizer effects ==<br />
<br />
NOTES: This requires the use of the old softoss module (the predecessor of vmix) which may not be as good as vmix, wine and gstreamer do not play nice with softoss, and the module will not work with sample rates higher than 48khz.<br />
<br />
We must do a few things to gain access to these effects.<br />
<br />
* If you're running the oss-linux-free daemon right now, stop it by running (as root):<br />
/etc/rc.d/oss-linux-free stop<br />
** On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove<br />
vmix<br />
** On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.<br />
*in /usr/lib/oss/etc/installed_drivers add<br />
softoss<br />
* in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
case "$1" in<br />
start)<br />
stat_busy "Starting OSS/Open source driver"<br />
# start<br />
/usr/sbin/soundon<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
grep '^softoss' /proc/modules >/dev/null 2>/dev/null<br />
# if [ $? -eq 0 ]; then<br />
# stat_busy "Replacing old \"softoss\" module with \"vmix\""<br />
# rmmod softoss<br />
# modprobe vmix<br />
# sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers<br />
# fi<br />
add_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Saving OSS mixer"<br />
/usr/sbin/savemixer<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null<br />
if [ $? -eq 0 ]; then<br />
stat_busy "Removing \"cuckoo\" module"<br />
rmmod \"cuckoo\"<br />
fi<br />
stat_busy "Stopping OSS/Open source driver"<br />
/usr/sbin/soundoff<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon oss4<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)<br />
<br />
* start the daemon again (as root of course)<br />
/etc/rc.d/oss-linux-free start<br />
* If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with<br />
ossmix -d1<br />
or<br />
ossxmix<br />
* you must turn off bipass to actually use the effects<br />
ossmix -d1 effects.eq.bypass OFF<br />
or just uncheck bypass in ossxmix<br />
<br />
* enjoy</div>Ly50247https://wiki.archlinux.org/index.php?title=Arch_compared_to_other_distributions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135348Arch compared to other distributions (简体中文)2011-03-30T12:28:53Z<p>Ly50247: /* Arch 与 Debian */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
{{i18n|Arch Compared to Other Distributions}}<br />
{{Article summary start|概述}}<br />
{{Article summary text|Arch Linux 和其他流行 GNU/Linux 发行版和BSDs的简明比较。}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch Linux}}<br />
{{Article summary wiki|The Arch Way}}<br />
{{Article summary heading|外部链接}}<br />
{{Article summary link|DistroWatch.com|http://distrowatch.com/}}<br />
{{Article summary end}}<br />
<br />
本文试图将 ArchLinux 和其他流行的 GNU/Linux 发行版和类UNIX系统作一个比较。下面的总结很简洁,但可以帮您决定 Arch Linux 是否符合自己的需求。尽管评论和叙述有一定作用,但亲身体验总是比较发行版的最好方法。<br />
<br />
==基于源码的发行版==<br />
基于源码的发行版是可度便捷的,拥有根据自己的机器架构和使用方案最优地控制和编译整个系统和所有软件的优势,但劣势是要在源码编译上消耗大量时间。Arch 的基础和所有软件包都为i686和x86-64平台编译,从而相比基于i386/i486/i586二进制包的发行版,更充分发挥硬件的性能优势。<br />
<br />
===ArchLinux 与 Gentoo===<br />
Arch Linux 和 Gentoo Linux 都是滚动升级的发行版,在上游软件发布后很短时间就制作完成可用的软件包。Gentoo的包和基本系统是直接从源码根据用户指定的USE标识构建。尽管Arch 基本系统被设计为安装预编译的 i686/x86_64 二进制包,它也提供类 ports 系统来从源码编译软件。这样 Arch 更易于构建和升级,而 Gentoo 更易于完全得定制。Arch 只支持 i686 和 x86_64 ,而 Gentoo 对 x86, ppc, sparc, alpha, amd64, arm, mips, hppa, s390, sh, 和 itanium架构提供官方支持。因为 Gentoo 和 Arch 的安装环境都只包含基本系统,二都都被认为是高度可定制的。Gentoo 用户会从 Arch 的大多数方面感到满意。<br />
<br />
=== Arch 与 Sorcerer/Lunar-Linux/Source Mage ===<br />
Sorcerer/Lunar-Linux/Source Mage (SLS)都是基于源码的发行版,它们最开始的时候都是有联系的。SLS使用一套非常简单的脚本文件来创建包描述,使用一个全局配置文件来配置编译过程,这很像 Arch 的[[Arch Build System]](ABS系统)。SLS工具提供完全依赖检查(包括处理可选特性)和包的跟踪、删除以及升级。SLS不提供二进制的包,但是它能很容易的回滚到以前安装的包。<br />
<br />
安装过程包括从文本和ncurses菜单配置一个简单基本系统,然后重新编译这个基本系统(可选)。和 Arch 一样,它们不提供缺省的WM/DE/DM(窗口管理器,桌面环境,桌面管理器),在安装时也没有安装Xorg。但是它们提供一种很简单的方法来安装可选的几个X server(包括X.Org 6.8或7, XFree86)。<br />
<br />
SLS的历史非常复杂。关于它是最好记录可以在这里找到:[http://wiki.sourcemage.org/SourceMage/History the SourceMage wiki]。<br />
<br />
相关链接:<br />
<br />
[http://lunar-linux.org/ Lunar Linux]<br />
<br />
[http://www.sourcemage.org/ SourceMage]<br />
<br />
[http://sorcerer.berlios.de/ Sorcerer]<br />
<br />
==极简派(Minimalist)==<br />
<br />
极简派发行版和 Arch 有相当的可比性,有一些共同之处。从技术层面都强调简洁的重要性。<br />
<br />
=== Arch 与 LFS ===<br />
LFS(Linux From Scratch), 是最个性化的系统,她不是一个发行版,只以文档形式存在。文档指导用户获得用于构建一个实用 GNU/Linux 系统的最少的基础源码包,以及如何手动编译(包括打补丁和配置编译选项等)。LFS就是这样小巧,并且提供优秀和富指导性的构建基本系统的过程。<br />
<br />
Arch基本系统同样提供这些软件包(为 i686/x86-64 优化),以及BSD风格的启动脚本、一些额外的辅助工具和功能强大的 [[pacman]] 包管理工具。LFS 并不提供在线软件仓库,源码要手动获取、编译和安装(使用 make )。(也存在一些手动的包管理方法,在 LFS 手册有提及。)基于Arch基本系统,社区和开发者提供并管理数以千计可供 pacman 安装的二进制包以及 [[Arch Build System]] 使用的 [[PKGBUILD]] 脚本。Arch 同时也包括 [[makepkg]] 工具用来方便地生成 {{Filename|.pkg.tar.xz}} 格式的软件包,然后可以用 pacman 安装。<br />
<br />
Judd Vinet从源码构建 ArchLinux,并用C写下 [[pacman]] 。历史原因,Arch 有时被人们形容成“带有一个优秀包管理系统的Linux“(Linux, with a nice package manager)。<br />
<br />
===Arch 与 CRUX===<br />
<br />
Arch是单独开发的,而不是基于其他任何 GNU/Linux 发行版。在构建 Arch 之前,Judd Vinet 使用并称赞 CRUX(Per Lidén构建的轻量级发行版)。最初的灵感和CRUX是相同的, Arch从源码构建,之后有了用C写成的 [[pacman]]。它们有着相同的指导原则,比如二者都对硬件架构优化,最小化并符合K.I.S.S原则。二者都有类ports系统,使用*BSD风格的初始化系统,而且像*BSD一样都提供可扩展的最小基本环境。[[pacman]] 是 Arch 的一大特色,它用来管理系统中的二进制包,并能很好地与 [[Arch Build System]] 协同工作。CRUX 用一个社区开发的 prt-get来配合自己的ports系统来处理依赖关系,但包是从源码生成的(尽管 CRUX 基本安装环境是二进制的)。Arch 只提供对 x86-64 和 i686 的官方支持,而 CURUX 有官方支持的i686以及社区开发的 x86-64、ppc 和 ppc64。<br />
<br />
Arch 使用滚动升级系统并提供大量二进制包和 [[Arch User Repository]]。相比之下 CRUX 提供一个缺乏官方支持的 ports 系统和比较逊色的软件仓库。<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?pid=133721#p133721 这个论坛的帖子]陈述了一位用户对这两个发行版的观点。<br />
<br />
===Arch 与 Slackware===<br />
Slackware 和 Arch 很相似,二者都是小巧优雅的发行版。Slackware以约束少和从内核开始的朴素的包著名。Arch 只有在避免出现严重问题或保证顺利打包时才使用补丁。两者都使用BSD 的初始化脚本。Arch 有一个健壮的包管理系统 [[pacman]]。与Slackware的标准工具不同,它可以自己处理依赖关系并提供更自动化的系统升级方式。Slackware用户更倾向于手动处理依赖关系,以尽可能控制自己的系统。Slackware也对预编译的库和依赖提供杰出的支持。Arch 是一个滚动升级的系统,Slackware的发布更为保守,更喜欢提供稳定的软件包。在这个方面,Arch更为“前卫”。Arch 软件仓库提供成千上万的二进制包,而相对之下Slackware的更为逊色。Arch提供 [[Arch Build System]](一个类ports系统)和[[AUR]](用户贡献的数以万计的PKGBUILD)。 Slackware提供一个相似的系统 [http://www.slackbuilds.org slackbuilds.org],它是半官方支持的Slackbuilds(和PKGBUILD相似)仓库。Slackware用户一般会对Arch的多数方面感到满意。<br />
<br />
==Arch 与 其他图形化的发行版==<br />
图形化的发行版之间有许多相同之处,而Arch和他们其中的任何一个都非常的不同。 Arch 是个基于文本和面向命令行的。 如果想真正学习Linux,Arch是个更好的选择。图形化的发行版往往装备有GUI安装器(像Fedora的Anaconda)和GUI的系统配置工具(像Suse的Yast)。特殊的不同之处在下面描述。<br />
<br />
=== Arch 与 Debian GNU/Linux===<br />
<br />
Debian 是一个更大的项目和社区,提供稳定、测试和不稳定分支,包含超过二千的二进制包。Arch不像Debian那样把包分成“-dev”和“-common”,因此Arch的软件仓库看起来更小。Debian 对自由软件更热情。Arch对GNU定义的非自由('non-free')包更显宽容。Debian更注重于稳定性并经过充分测试,而Arch更注重于简洁、小巧和提供最新软件。Arch的包去Debian Stable 和 Testing 中的更新,和 unstable里的差不多。Debian 和 Arch 都提供很好的包管理系统。Arch 滚动升级,而 Debian Stable 采用“固定”的包发行。Debian 支持许多架构,包括alpha, arm, hppa, i386, x86_64, ia64, m68k, mips, mipsel, powerpc, s390 和 sparc,而 Arch 只支持i686 and x86_64。<br />
Arch 对从源码创建包提供更好的支持,有一个类ports系统。Debian 不提供posts系统,只依靠着包数量庞大的软件仓库。Arch安装环境只提供最小的基本系统,编辑文本文件来配置系统,而Debian的方式更为自动化,另外还提供多种安装方式。Debian使用SysVinit,而Arch使用类*BSD风格init。Arch只在迫不得已时才打补丁。<br />
<br />
=== Arch与 Ubuntu===<br />
Arch 是个为了省力地追新而设计的系统,而Ubuntu是为了更方便好用而设计的系统。所以,如果你喜欢自己定制、喜欢追逐软件最新版本,那么 Arch 更为合适。如果不想浪费太多时间在定制系统上,而是希望能够安装完成之后,少量定制就能满意使用,那么Ubuntu显然更擅长此道。一般而言,开发人员和产品设计人员可能喜欢 Arch 多一点。<br />
<br />
===Arch 与 基于 RPM 的发行版===<br />
RPM格式的软件包可以从很多地方得到,rpm可以非常灵活地处理依赖问题,但也因此导致第三方的包经常存在依赖问题,但目前几乎所有基于rpm的Linux系统都提供了非常完备的软件包管理系统,轻易解决了这个问题。另外,在RedHat 的 RPM 和 OpenSuse的RPM之间也经常造成混淆。<br />
<br />
===Arch 与 Fedora===<br />
Fedora 是 RedHat 发行版的技术前导版,对新技术的采用非常激进(比arch还激进),但也因此会导致很多不稳定。它有个坚实的社区和许多预先创建好的软件包,还有可获得的商业性技术支持。Fedora因为商业的原因,默认是不提供有专利方面限制的软件的。Fedora有图形界面安装。<br />
Arch使用基于ncurses文字界面安装。Fedora的图形界面设计友好。Arch相对Fedora是更为简单的系统,依赖于用户手动配置。Fedora有固定版本发布周期。Arch是滚动升级系统。Arch的设计理念是面向轻量级优雅,而Fedora目的是测试所引入的新技术,所以更加适合直接针对系统的开发人员。<br />
<br />
===Arch 与 Mandriva===<br />
<br />
Mandriva Linux(前身为 Mandrake Linux)创建于1998年,目标是使GNU/Linux对于每个人都易于使用。它使用基于RPM包,使用urpmi包管理软件。它与Arch的目标用户不尽相同。<br />
<br />
===Arch 与 openSUSE===<br />
openSUSE 一向号称是最漂亮的 Linux 发行版,默认已经把很多东西都配置好了,在美工方面下了很多功夫,对商业软件的支持也很好,而且还提供了一个非常优秀的使社区灵活性大大提高在线打包系统。但 openSUSE 近几年更新速度太慢(为了提高灵活度,openSUSE 已经开始试验滚动升级模式 Tumbleweed),最新的几个版本也不太稳定。和 arch 相比,openSUSE 更类似于 ubuntu。<br />
<br />
==与BSD系列的对比==<br />
===Arch vs FreeBSD===<br />
BSDs 起源于伯克利Unix. http://www.freebsd.org/about.html 因此Freebsd不是一个Linux发行版. 软件可以使用二进制或通过'ports'从源代码安装。BSD自我宣称它不仅仅是一个作为整体上的系统,并且会确认每个被移植到FreeBSD上的程序是否能工作正常。像Arch一样,软件包差不多是最新的。这大概是Arch最有意思的竞争者,因为它也醉心于追逐新软件,并且有一个规模比较可观,才华横溢,活跃和严肃的社区。其中其pkg部分,近似于arch的pacman,其port部分,近似于arch的abs,但好像因为其严谨,而缺乏类似arch的aur的东西。<br />
<br />
===Arch vs NetBSD===<br />
NetBSD名称来源于其发起和发展主要靠网络,它是一个自由,安全并且具有高度可移植性的类UNIX开源操作系统,从64位的Opteron机器和桌面系统到手持和嵌入式设备,它支持超过70种平台,可以说是支持平台最多的一个发行版,但它为了可移植性,不可避免牺牲了部分平台的功力,从而无法充分发挥特定平台的全部潜力。它设计简洁,并且那些高级特性使它同时成为优异的生产和研究环境,它也提供给用户所有的源代码。许多应用程序轻易地可以通过pkgsrc来获得,它就是NetBSD软件包集合。Arch不会像NetBSD那样可以用在那么多的设备上,但是对i686平台它会提供更多的应用程序。而且默认的pkgsrc安装方法是先取得软件包的源码再进行编译,而Arch是直接提供二进制软件包。Arch和NetBSD之间有很多相似之处;它们都使用/etc/rc.conf作为主配置文件,它们非常精简和轻巧,它们都提供ports系统和二进制软件,它们都有活跃,严谨的开发和社区。Arch还从*BSD那里借鉴了它的init系统的概念。<br />
<br />
===Arch vs OpenBSD===<br />
OpenBSD是个极端追求安全性的操作系统,自我宣称“大概是头等安全的操作系统“。它也是一个自由,用于多个平台的基于4.4BSD的类UNIX操作系统。相比之下,Arch更专注于简单,优美,精巧和最新的软件。OpenBSD支持大多数程序的二进制仿真,它们来自SVR4(Solaris),FreeBSD, GNU/Linux, BSD/OS, SunOS and HP-UX. 和Arch一样,OpenBSD提供了一个小而优美的基本安装并且使用一个ports系统和软件包系统来允许进行容易的安装和管理非基本系统的软件包。GNU/Linux系统比如说Arch,它和大多数基于BSD的操作系统一样,OpenBSD内核和用户空间的程序,比如说shell和常见的工具(像ls,cp,cat和ps),它们被开发成在单一的源代码仓库中。<br />
目前BSD系列对硬件支持都集中在服务器,对普通电脑的支持相对落后于Linux,而且,软件交流社区也仍然集中在服务器领域,对桌面用户的交流比较弱势,不太适合桌面用户。<br />
<br />
==与其他的对比==<br />
===Arch 与 Zenwalk===<br />
Zenwalk是从Slackware衍生的,但是它更方便和现代。Arch和Zenwalk一个很大的不同是Zenwalk安装的包是开发者已经选好的。如果你喜欢他们的选择,这会节省你的时间,但如果你想有其他选择,这就成它的不便之处了。<br />
<br />
===Arch vs Gobolinux===<br />
Gobolinux 有一个独特的无为而治的包管理方法。其文件系统被组织成应用程序全部位于 /Programs 目录,并且通过符号链接使用。删除程序X只需 rm -rf /Programs/X http://www.gobolinux.org/index.php?page=at_a_glance<br />
It does not seem to focus on i686 binaries and does allow source-based package installs.<br />
其并不是针对i686平台优化的二进制程序,允许基于源码的软件安装。<br />
<br />
===Arch vs Minix 3===<br />
Arch 是一个拥有现代社区和硬件支持的完整发行版。Minix 3 是一个有一些有趣特性的微小而不稳定的高级研究用操作系统,例如用于 [http://en.wikipedia.org/wiki/Microkernel microkernel]。 http://www.minix3.org/<br />
<br />
===Arch 与 Frugalware===<br />
Arch 基于文本界面并且面向命令行操作, 而 Frugalware 提供了更佳的多语言支持. 同时 Frugalware 也提供了更多的本地化文档. 虽然同样使用 packman, 但是它们的包并不完全兼容. Frugalware 默认不支持 JFS 文件系统. Frugalware 不再基于 Slackware,更像是一个独立的发行版,并且它基于 i686 架构。<br />
<br />
===Arch 与 Rock===<br />
<br />
来自这篇介绍:http://www.rocklinux.org/wiki/About<br />
<br />
ROCK Linux是一个用来打造Linux发行版的灵活的开发工具包,即打造你自己的Linux发行版可用的工具链或框架。这个你也可以参考我们的目标描述。<br />
<br />
如果你不想打造你自己的Linux发行版,而只是对一个具有多用途的好的发行版感兴趣,你或许可以看一下 http://www.rocklinux.org/wiki/Crystal_ROCK<br />
<br />
它是一个作为开发工具而生的发行版。和Arch相比,它有和其他基于源码的发行版一样的问题,如编译所需的时间等。它可以运行在多种处理器上如SPARC, ARM等。<br />
<br />
===Arch 与 T2===<br />
来自FAQ http://www.t2-project.org/faq/<br />
<br />
问题:既然已经有Gentoo了为什么还需要T2?<br />
回答:T2,或者更精确的说,它的前身ROCK Linux,它在1998年就启动了,比Gentoo早几个月,而且比Gentoo更早在freshmeat注册--所以,这个问题如果能反过来问或许更好。<br />
同样,在技术方面T2支持商业强度的开发,坚持目标,交互编译,可选的嵌入式C开发库和多引导系统可选择。T2的包通常不包括任何代码,它是基于key-value的文本文件,这使得包的工作和更新在T2上非常快。<br />
Arch使用为i686优化的二进制包(由于不需要编译所有的东西,所以很快)来和T2竞争。T2在技术实力方面是一个强有力的竞争者。由于它能用于嵌入式设备,它有可能在某些应用方面击败Arch。T2值得关注。</div>Ly50247https://wiki.archlinux.org/index.php?title=Arch_compared_to_other_distributions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135277Arch compared to other distributions (简体中文)2011-03-29T05:46:05Z<p>Ly50247: /* Arch 与 Mandriva */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
{{i18n|Arch Compared to Other Distributions}}<br />
{{Article summary start|概述}}<br />
{{Article summary text|Arch Linux 和其他流行 GNU/Linux 发行版和BSDs的简明比较。}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch Linux}}<br />
{{Article summary wiki|The Arch Way}}<br />
{{Article summary heading|外部链接}}<br />
{{Article summary link|DistroWatch.com|http://distrowatch.com/}}<br />
{{Article summary end}}<br />
<br />
本文试图将 ArchLinux 和其他流行的 GNU/Linux 发行版和类UNIX系统作一个比较。下面的总结很简洁,但可以帮您决定 Arch Linux 是否符合自己的需求。尽管评论和叙述有一定作用,但亲身体验总是比较发行版的最好方法。<br />
<br />
==基于源码的发行版==<br />
基于源码的发行版是可度便捷的,拥有根据自己的机器架构和使用方案最优地控制和编译整个系统和所有软件的优势,但劣势是要在源码编译上消耗大量时间。Arch 的基础和所有软件包都为i686和x86-64平台编译,从而相比基于i386/i486/i586二进制包的发行版,更充分发挥硬件的性能优势。<br />
<br />
===ArchLinux 与 Gentoo===<br />
Arch Linux 和 Gentoo Linux 都是滚动升级的发行版,在上游软件发布后很短时间就制作完成可用的软件包。Gentoo的包和基本系统是直接从源码根据用户指定的USE标识构建。尽管Arch 基本系统被设计为安装预编译的 i686/x86_64 二进制包,它也提供类 ports 系统来从源码编译软件。这样 Arch 更易于构建和升级,而 Gentoo 更易于完全得定制。Arch 只支持 i686 和 x86_64 ,而 Gentoo 对 x86, ppc, sparc, alpha, amd64, arm, mips, hppa, s390, sh, 和 itanium架构提供官方支持。因为 Gentoo 和 Arch 的安装环境都只包含基本系统,二都都被认为是高度可定制的。Gentoo 用户会从 Arch 的大多数方面感到满意。<br />
<br />
=== Arch 与 Sorcerer/Lunar-Linux/Source Mage ===<br />
Sorcerer/Lunar-Linux/Source Mage (SLS)都是基于源码的发行版,它们最开始的时候都是有联系的。SLS使用一套非常简单的脚本文件来创建包描述,使用一个全局配置文件来配置编译过程,这很像 Arch 的[[Arch Build System]](ABS系统)。SLS工具提供完全依赖检查(包括处理可选特性)和包的跟踪、删除以及升级。SLS不提供二进制的包,但是它能很容易的回滚到以前安装的包。<br />
<br />
安装过程包括从文本和ncurses菜单配置一个简单基本系统,然后重新编译这个基本系统(可选)。和 Arch 一样,它们不提供缺省的WM/DE/DM(窗口管理器,桌面环境,桌面管理器),在安装时也没有安装Xorg。但是它们提供一种很简单的方法来安装可选的几个X server(包括X.Org 6.8或7, XFree86)。<br />
<br />
SLS的历史非常复杂。关于它是最好记录可以在这里找到:[http://wiki.sourcemage.org/SourceMage/History the SourceMage wiki]。<br />
<br />
相关链接:<br />
<br />
[http://lunar-linux.org/ Lunar Linux]<br />
<br />
[http://www.sourcemage.org/ SourceMage]<br />
<br />
[http://sorcerer.berlios.de/ Sorcerer]<br />
<br />
==极简派(Minimalist)==<br />
<br />
极简派发行版和 Arch 有相当的可比性,有一些共同之处。从技术层面都强调简洁的重要性。<br />
<br />
=== Arch 与 LFS ===<br />
LFS(Linux From Scratch), 是最个性化的系统,她不是一个发行版,只以文档形式存在。文档指导用户获得用于构建一个实用 GNU/Linux 系统的最少的基础源码包,以及如何手动编译(包括打补丁和配置编译选项等)。LFS就是这样小巧,并且提供优秀和富指导性的构建基本系统的过程。<br />
<br />
Arch基本系统同样提供这些软件包(为 i686/x86-64 优化),以及BSD风格的启动脚本、一些额外的辅助工具和功能强大的 [[pacman]] 包管理工具。LFS 并不提供在线软件仓库,源码要手动获取、编译和安装(使用 make )。(也存在一些手动的包管理方法,在 LFS 手册有提及。)基于Arch基本系统,社区和开发者提供并管理数以千计可供 pacman 安装的二进制包以及 [[Arch Build System]] 使用的 [[PKGBUILD]] 脚本。Arch 同时也包括 [[makepkg]] 工具用来方便地生成 {{Filename|.pkg.tar.xz}} 格式的软件包,然后可以用 pacman 安装。<br />
<br />
Judd Vinet从源码构建 ArchLinux,并用C写下 [[pacman]] 。历史原因,Arch 有时被人们形容成“带有一个优秀包管理系统的Linux“(Linux, with a nice package manager)。<br />
<br />
===Arch 与 CRUX===<br />
<br />
Arch是单独开发的,而不是基于其他任何 GNU/Linux 发行版。在构建 Arch 之前,Judd Vinet 使用并称赞 CRUX(Per Lidén构建的轻量级发行版)。最初的灵感和CRUX是相同的, Arch从源码构建,之后有了用C写成的 [[pacman]]。它们有着相同的指导原则,比如二者都对硬件架构优化,最小化并符合K.I.S.S原则。二者都有类ports系统,使用*BSD风格的初始化系统,而且像*BSD一样都提供可扩展的最小基本环境。[[pacman]] 是 Arch 的一大特色,它用来管理系统中的二进制包,并能很好地与 [[Arch Build System]] 协同工作。CRUX 用一个社区开发的 prt-get来配合自己的ports系统来处理依赖关系,但包是从源码生成的(尽管 CRUX 基本安装环境是二进制的)。Arch 只提供对 x86-64 和 i686 的官方支持,而 CURUX 有官方支持的i686以及社区开发的 x86-64、ppc 和 ppc64。<br />
<br />
Arch 使用滚动升级系统并提供大量二进制包和 [[Arch User Repository]]。相比之下 CRUX 提供一个缺乏官方支持的 ports 系统和比较逊色的软件仓库。<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?pid=133721#p133721 这个论坛的帖子]陈述了一位用户对这两个发行版的观点。<br />
<br />
===Arch 与 Slackware===<br />
Slackware 和 Arch 很相似,二者都是小巧优雅的发行版。Slackware以约束少和从内核开始的朴素的包著名。Arch 只有在避免出现严重问题或保证顺利打包时才使用补丁。两者都使用BSD 的初始化脚本。Arch 有一个健壮的包管理系统 [[pacman]]。与Slackware的标准工具不同,它可以自己处理依赖关系并提供更自动化的系统升级方式。Slackware用户更倾向于手动处理依赖关系,以尽可能控制自己的系统。Slackware也对预编译的库和依赖提供杰出的支持。Arch 是一个滚动升级的系统,Slackware的发布更为保守,更喜欢提供稳定的软件包。在这个方面,Arch更为“前卫”。Arch 软件仓库提供成千上万的二进制包,而相对之下Slackware的更为逊色。Arch提供 [[Arch Build System]](一个类ports系统)和[[AUR]](用户贡献的数以万计的PKGBUILD)。 Slackware提供一个相似的系统 [http://www.slackbuilds.org slackbuilds.org],它是半官方支持的Slackbuilds(和PKGBUILD相似)仓库。Slackware用户一般会对Arch的多数方面感到满意。<br />
<br />
==Arch 与 其他图形化的发行版==<br />
图形化的发行版之间有许多相同之处,而Arch和他们其中的任何一个都非常的不同。 Arch 是个基于文本和面向命令行的。 如果想真正学习Linux,Arch是个更好的选择。图形化的发行版往往装备有GUI安装器(像Fedora的Anaconda)和GUI的系统配置工具(像Suse的Yast)。特殊的不同之处在下面描述。<br />
<br />
=== Arch 与 Debian===<br />
Arch 比 Debian/迭变 更灵巧,Arch 的一开始安装的软件比较少。Debian追求稳定地运行和演化,也因此导致其软件包结构相对来说更为严谨和复杂,测试周期也较长,也不会象arch一样追新。两者都有强大的社区,但Debian特有的稳定性追求,使得其社区不够开放,新手不容易参与。而且 Arch 对于 GNU 定义的“非自由”(non-free)软件包态度更显宽容。相比Debian,Arch 软件包更加先锋(Arch 的 test 软件一般都比 Debian 的 unstable(不稳定版) 的新!)。两者都能够滚动升级,但Debian Stable为了追求稳定性,更多的是采用固定版本发行。<br />
<br />
=== Arch与 Ubuntu===<br />
Arch 是个为了省力地追新而设计的系统,而Ubuntu是为了更方便好用而设计的系统。所以,如果你喜欢自己定制、喜欢追逐软件最新版本,那么 Arch 更为合适。如果不想浪费太多时间在定制系统上,而是希望能够安装完成之后,少量定制就能满意使用,那么Ubuntu显然更擅长此道。一般而言,开发人员和产品设计人员可能喜欢 Arch 多一点。<br />
<br />
===Arch 与 基于 RPM 的发行版===<br />
RPM格式的软件包可以从很多地方得到,rpm可以非常灵活地处理依赖问题,但也因此导致第三方的包经常存在依赖问题,但目前几乎所有基于rpm的Linux系统都提供了非常完备的软件包管理系统,轻易解决了这个问题。另外,在RedHat 的 RPM 和 OpenSuse的RPM之间也经常造成混淆。<br />
<br />
===Arch 与 Fedora===<br />
Fedora 是 RedHat 发行版的技术前导版,对新技术的采用非常激进(比arch还激进),但也因此会导致很多不稳定。它有个坚实的社区和许多预先创建好的软件包,还有可获得的商业性技术支持。Fedora因为商业的原因,默认是不提供有专利方面限制的软件的。Fedora有图形界面安装。<br />
Arch使用基于ncurses文字界面安装。Fedora的图形界面设计友好。Arch相对Fedora是更为简单的系统,依赖于用户手动配置。Fedora有固定版本发布周期。Arch是滚动升级系统。Arch的设计理念是面向轻量级优雅,而Fedora目的是测试所引入的新技术,所以更加适合直接针对系统的开发人员。<br />
<br />
===Arch 与 Mandriva===<br />
<br />
Mandriva Linux(前身为 Mandrake Linux)创建于1998年,目标是使GNU/Linux对于每个人都易于使用。它使用基于RPM包,使用urpmi包管理软件。它与Arch的目标用户不尽相同。<br />
<br />
===Arch 与 openSUSE===<br />
openSUSE 一向号称是最漂亮的 Linux 发行版,默认已经把很多东西都配置好了,在美工方面下了很多功夫,对商业软件的支持也很好,而且还提供了一个非常优秀的使社区灵活性大大提高在线打包系统。但 openSUSE 近几年更新速度太慢(为了提高灵活度,openSUSE 已经开始试验滚动升级模式 Tumbleweed),最新的几个版本也不太稳定。和 arch 相比,openSUSE 更类似于 ubuntu。<br />
<br />
==与BSD系列的对比==<br />
===Arch vs FreeBSD===<br />
BSDs 起源于伯克利Unix. http://www.freebsd.org/about.html 因此Freebsd不是一个Linux发行版. 软件可以使用二进制或通过'ports'从源代码安装。BSD自我宣称它不仅仅是一个作为整体上的系统,并且会确认每个被移植到FreeBSD上的程序是否能工作正常。像Arch一样,软件包差不多是最新的。这大概是Arch最有意思的竞争者,因为它也醉心于追逐新软件,并且有一个规模比较可观,才华横溢,活跃和严肃的社区。其中其pkg部分,近似于arch的pacman,其port部分,近似于arch的abs,但好像因为其严谨,而缺乏类似arch的aur的东西。<br />
<br />
===Arch vs NetBSD===<br />
NetBSD名称来源于其发起和发展主要靠网络,它是一个自由,安全并且具有高度可移植性的类UNIX开源操作系统,从64位的Opteron机器和桌面系统到手持和嵌入式设备,它支持超过70种平台,可以说是支持平台最多的一个发行版,但它为了可移植性,不可避免牺牲了部分平台的功力,从而无法充分发挥特定平台的全部潜力。它设计简洁,并且那些高级特性使它同时成为优异的生产和研究环境,它也提供给用户所有的源代码。许多应用程序轻易地可以通过pkgsrc来获得,它就是NetBSD软件包集合。Arch不会像NetBSD那样可以用在那么多的设备上,但是对i686平台它会提供更多的应用程序。而且默认的pkgsrc安装方法是先取得软件包的源码再进行编译,而Arch是直接提供二进制软件包。Arch和NetBSD之间有很多相似之处;它们都使用/etc/rc.conf作为主配置文件,它们非常精简和轻巧,它们都提供ports系统和二进制软件,它们都有活跃,严谨的开发和社区。Arch还从*BSD那里借鉴了它的init系统的概念。<br />
<br />
===Arch vs OpenBSD===<br />
OpenBSD是个极端追求安全性的操作系统,自我宣称“大概是头等安全的操作系统“。它也是一个自由,用于多个平台的基于4.4BSD的类UNIX操作系统。相比之下,Arch更专注于简单,优美,精巧和最新的软件。OpenBSD支持大多数程序的二进制仿真,它们来自SVR4(Solaris),FreeBSD, GNU/Linux, BSD/OS, SunOS and HP-UX. 和Arch一样,OpenBSD提供了一个小而优美的基本安装并且使用一个ports系统和软件包系统来允许进行容易的安装和管理非基本系统的软件包。GNU/Linux系统比如说Arch,它和大多数基于BSD的操作系统一样,OpenBSD内核和用户空间的程序,比如说shell和常见的工具(像ls,cp,cat和ps),它们被开发成在单一的源代码仓库中。<br />
目前BSD系列对硬件支持都集中在服务器,对普通电脑的支持相对落后于Linux,而且,软件交流社区也仍然集中在服务器领域,对桌面用户的交流比较弱势,不太适合桌面用户。<br />
<br />
==与其他的对比==<br />
===Arch 与 Zenwalk===<br />
Zenwalk是从Slackware衍生的,但是它更方便和现代。Arch和Zenwalk一个很大的不同是Zenwalk安装的包是开发者已经选好的。如果你喜欢他们的选择,这会节省你的时间,但如果你想有其他选择,这就成它的不便之处了。<br />
<br />
===Arch vs Gobolinux===<br />
Gobolinux 有一个独特的无为而治的包管理方法。其文件系统被组织成应用程序全部位于 /Programs 目录,并且通过符号链接使用。删除程序X只需 rm -rf /Programs/X http://www.gobolinux.org/index.php?page=at_a_glance<br />
It does not seem to focus on i686 binaries and does allow source-based package installs.<br />
其并不是针对i686平台优化的二进制程序,允许基于源码的软件安装。<br />
<br />
===Arch vs Minix 3===<br />
Arch 是一个拥有现代社区和硬件支持的完整发行版。Minix 3 是一个有一些有趣特性的微小而不稳定的高级研究用操作系统,例如用于 [http://en.wikipedia.org/wiki/Microkernel microkernel]。 http://www.minix3.org/<br />
<br />
===Arch 与 Frugalware===<br />
Arch 基于文本界面并且面向命令行操作, 而 Frugalware 提供了更佳的多语言支持. 同时 Frugalware 也提供了更多的本地化文档. 虽然同样使用 packman, 但是它们的包并不完全兼容. Frugalware 默认不支持 JFS 文件系统. Frugalware 不再基于 Slackware,更像是一个独立的发行版,并且它基于 i686 架构。<br />
<br />
===Arch 与 Rock===<br />
<br />
来自这篇介绍:http://www.rocklinux.org/wiki/About<br />
<br />
ROCK Linux是一个用来打造Linux发行版的灵活的开发工具包,即打造你自己的Linux发行版可用的工具链或框架。这个你也可以参考我们的目标描述。<br />
<br />
如果你不想打造你自己的Linux发行版,而只是对一个具有多用途的好的发行版感兴趣,你或许可以看一下 http://www.rocklinux.org/wiki/Crystal_ROCK<br />
<br />
它是一个作为开发工具而生的发行版。和Arch相比,它有和其他基于源码的发行版一样的问题,如编译所需的时间等。它可以运行在多种处理器上如SPARC, ARM等。<br />
<br />
===Arch 与 T2===<br />
来自FAQ http://www.t2-project.org/faq/<br />
<br />
问题:既然已经有Gentoo了为什么还需要T2?<br />
回答:T2,或者更精确的说,它的前身ROCK Linux,它在1998年就启动了,比Gentoo早几个月,而且比Gentoo更早在freshmeat注册--所以,这个问题如果能反过来问或许更好。<br />
同样,在技术方面T2支持商业强度的开发,坚持目标,交互编译,可选的嵌入式C开发库和多引导系统可选择。T2的包通常不包括任何代码,它是基于key-value的文本文件,这使得包的工作和更新在T2上非常快。<br />
Arch使用为i686优化的二进制包(由于不需要编译所有的东西,所以很快)来和T2竞争。T2在技术实力方面是一个强有力的竞争者。由于它能用于嵌入式设备,它有可能在某些应用方面击败Arch。T2值得关注。</div>Ly50247https://wiki.archlinux.org/index.php?title=Arch_compared_to_other_distributions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135276Arch compared to other distributions (简体中文)2011-03-29T05:21:26Z<p>Ly50247: /* Arch 与 Slackware */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
{{i18n|Arch Compared to Other Distributions}}<br />
{{Article summary start|概述}}<br />
{{Article summary text|Arch Linux 和其他流行 GNU/Linux 发行版和BSDs的简明比较。}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch Linux}}<br />
{{Article summary wiki|The Arch Way}}<br />
{{Article summary heading|外部链接}}<br />
{{Article summary link|DistroWatch.com|http://distrowatch.com/}}<br />
{{Article summary end}}<br />
<br />
本文试图将 ArchLinux 和其他流行的 GNU/Linux 发行版和类UNIX系统作一个比较。下面的总结很简洁,但可以帮您决定 Arch Linux 是否符合自己的需求。尽管评论和叙述有一定作用,但亲身体验总是比较发行版的最好方法。<br />
<br />
==基于源码的发行版==<br />
基于源码的发行版是可度便捷的,拥有根据自己的机器架构和使用方案最优地控制和编译整个系统和所有软件的优势,但劣势是要在源码编译上消耗大量时间。Arch 的基础和所有软件包都为i686和x86-64平台编译,从而相比基于i386/i486/i586二进制包的发行版,更充分发挥硬件的性能优势。<br />
<br />
===ArchLinux 与 Gentoo===<br />
Arch Linux 和 Gentoo Linux 都是滚动升级的发行版,在上游软件发布后很短时间就制作完成可用的软件包。Gentoo的包和基本系统是直接从源码根据用户指定的USE标识构建。尽管Arch 基本系统被设计为安装预编译的 i686/x86_64 二进制包,它也提供类 ports 系统来从源码编译软件。这样 Arch 更易于构建和升级,而 Gentoo 更易于完全得定制。Arch 只支持 i686 和 x86_64 ,而 Gentoo 对 x86, ppc, sparc, alpha, amd64, arm, mips, hppa, s390, sh, 和 itanium架构提供官方支持。因为 Gentoo 和 Arch 的安装环境都只包含基本系统,二都都被认为是高度可定制的。Gentoo 用户会从 Arch 的大多数方面感到满意。<br />
<br />
=== Arch 与 Sorcerer/Lunar-Linux/Source Mage ===<br />
Sorcerer/Lunar-Linux/Source Mage (SLS)都是基于源码的发行版,它们最开始的时候都是有联系的。SLS使用一套非常简单的脚本文件来创建包描述,使用一个全局配置文件来配置编译过程,这很像 Arch 的[[Arch Build System]](ABS系统)。SLS工具提供完全依赖检查(包括处理可选特性)和包的跟踪、删除以及升级。SLS不提供二进制的包,但是它能很容易的回滚到以前安装的包。<br />
<br />
安装过程包括从文本和ncurses菜单配置一个简单基本系统,然后重新编译这个基本系统(可选)。和 Arch 一样,它们不提供缺省的WM/DE/DM(窗口管理器,桌面环境,桌面管理器),在安装时也没有安装Xorg。但是它们提供一种很简单的方法来安装可选的几个X server(包括X.Org 6.8或7, XFree86)。<br />
<br />
SLS的历史非常复杂。关于它是最好记录可以在这里找到:[http://wiki.sourcemage.org/SourceMage/History the SourceMage wiki]。<br />
<br />
相关链接:<br />
<br />
[http://lunar-linux.org/ Lunar Linux]<br />
<br />
[http://www.sourcemage.org/ SourceMage]<br />
<br />
[http://sorcerer.berlios.de/ Sorcerer]<br />
<br />
==极简派(Minimalist)==<br />
<br />
极简派发行版和 Arch 有相当的可比性,有一些共同之处。从技术层面都强调简洁的重要性。<br />
<br />
=== Arch 与 LFS ===<br />
LFS(Linux From Scratch), 是最个性化的系统,她不是一个发行版,只以文档形式存在。文档指导用户获得用于构建一个实用 GNU/Linux 系统的最少的基础源码包,以及如何手动编译(包括打补丁和配置编译选项等)。LFS就是这样小巧,并且提供优秀和富指导性的构建基本系统的过程。<br />
<br />
Arch基本系统同样提供这些软件包(为 i686/x86-64 优化),以及BSD风格的启动脚本、一些额外的辅助工具和功能强大的 [[pacman]] 包管理工具。LFS 并不提供在线软件仓库,源码要手动获取、编译和安装(使用 make )。(也存在一些手动的包管理方法,在 LFS 手册有提及。)基于Arch基本系统,社区和开发者提供并管理数以千计可供 pacman 安装的二进制包以及 [[Arch Build System]] 使用的 [[PKGBUILD]] 脚本。Arch 同时也包括 [[makepkg]] 工具用来方便地生成 {{Filename|.pkg.tar.xz}} 格式的软件包,然后可以用 pacman 安装。<br />
<br />
Judd Vinet从源码构建 ArchLinux,并用C写下 [[pacman]] 。历史原因,Arch 有时被人们形容成“带有一个优秀包管理系统的Linux“(Linux, with a nice package manager)。<br />
<br />
===Arch 与 CRUX===<br />
<br />
Arch是单独开发的,而不是基于其他任何 GNU/Linux 发行版。在构建 Arch 之前,Judd Vinet 使用并称赞 CRUX(Per Lidén构建的轻量级发行版)。最初的灵感和CRUX是相同的, Arch从源码构建,之后有了用C写成的 [[pacman]]。它们有着相同的指导原则,比如二者都对硬件架构优化,最小化并符合K.I.S.S原则。二者都有类ports系统,使用*BSD风格的初始化系统,而且像*BSD一样都提供可扩展的最小基本环境。[[pacman]] 是 Arch 的一大特色,它用来管理系统中的二进制包,并能很好地与 [[Arch Build System]] 协同工作。CRUX 用一个社区开发的 prt-get来配合自己的ports系统来处理依赖关系,但包是从源码生成的(尽管 CRUX 基本安装环境是二进制的)。Arch 只提供对 x86-64 和 i686 的官方支持,而 CURUX 有官方支持的i686以及社区开发的 x86-64、ppc 和 ppc64。<br />
<br />
Arch 使用滚动升级系统并提供大量二进制包和 [[Arch User Repository]]。相比之下 CRUX 提供一个缺乏官方支持的 ports 系统和比较逊色的软件仓库。<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?pid=133721#p133721 这个论坛的帖子]陈述了一位用户对这两个发行版的观点。<br />
<br />
===Arch 与 Slackware===<br />
Slackware 和 Arch 很相似,二者都是小巧优雅的发行版。Slackware以约束少和从内核开始的朴素的包著名。Arch 只有在避免出现严重问题或保证顺利打包时才使用补丁。两者都使用BSD 的初始化脚本。Arch 有一个健壮的包管理系统 [[pacman]]。与Slackware的标准工具不同,它可以自己处理依赖关系并提供更自动化的系统升级方式。Slackware用户更倾向于手动处理依赖关系,以尽可能控制自己的系统。Slackware也对预编译的库和依赖提供杰出的支持。Arch 是一个滚动升级的系统,Slackware的发布更为保守,更喜欢提供稳定的软件包。在这个方面,Arch更为“前卫”。Arch 软件仓库提供成千上万的二进制包,而相对之下Slackware的更为逊色。Arch提供 [[Arch Build System]](一个类ports系统)和[[AUR]](用户贡献的数以万计的PKGBUILD)。 Slackware提供一个相似的系统 [http://www.slackbuilds.org slackbuilds.org],它是半官方支持的Slackbuilds(和PKGBUILD相似)仓库。Slackware用户一般会对Arch的多数方面感到满意。<br />
<br />
==Arch 与 其他图形化的发行版==<br />
图形化的发行版之间有许多相同之处,而Arch和他们其中的任何一个都非常的不同。 Arch 是个基于文本和面向命令行的。 如果想真正学习Linux,Arch是个更好的选择。图形化的发行版往往装备有GUI安装器(像Fedora的Anaconda)和GUI的系统配置工具(像Suse的Yast)。特殊的不同之处在下面描述。<br />
<br />
=== Arch 与 Debian===<br />
Arch 比 Debian/迭变 更灵巧,Arch 的一开始安装的软件比较少。Debian追求稳定地运行和演化,也因此导致其软件包结构相对来说更为严谨和复杂,测试周期也较长,也不会象arch一样追新。两者都有强大的社区,但Debian特有的稳定性追求,使得其社区不够开放,新手不容易参与。而且 Arch 对于 GNU 定义的“非自由”(non-free)软件包态度更显宽容。相比Debian,Arch 软件包更加先锋(Arch 的 test 软件一般都比 Debian 的 unstable(不稳定版) 的新!)。两者都能够滚动升级,但Debian Stable为了追求稳定性,更多的是采用固定版本发行。<br />
<br />
=== Arch与 Ubuntu===<br />
Arch 是个为了省力地追新而设计的系统,而Ubuntu是为了更方便好用而设计的系统。所以,如果你喜欢自己定制、喜欢追逐软件最新版本,那么 Arch 更为合适。如果不想浪费太多时间在定制系统上,而是希望能够安装完成之后,少量定制就能满意使用,那么Ubuntu显然更擅长此道。一般而言,开发人员和产品设计人员可能喜欢 Arch 多一点。<br />
<br />
===Arch 与 基于 RPM 的发行版===<br />
RPM格式的软件包可以从很多地方得到,rpm可以非常灵活地处理依赖问题,但也因此导致第三方的包经常存在依赖问题,但目前几乎所有基于rpm的Linux系统都提供了非常完备的软件包管理系统,轻易解决了这个问题。另外,在RedHat 的 RPM 和 OpenSuse的RPM之间也经常造成混淆。<br />
<br />
===Arch 与 Fedora===<br />
Fedora 是 RedHat 发行版的技术前导版,对新技术的采用非常激进(比arch还激进),但也因此会导致很多不稳定。它有个坚实的社区和许多预先创建好的软件包,还有可获得的商业性技术支持。Fedora因为商业的原因,默认是不提供有专利方面限制的软件的。Fedora有图形界面安装。<br />
Arch使用基于ncurses文字界面安装。Fedora的图形界面设计友好。Arch相对Fedora是更为简单的系统,依赖于用户手动配置。Fedora有固定版本发布周期。Arch是滚动升级系统。Arch的设计理念是面向轻量级优雅,而Fedora目的是测试所引入的新技术,所以更加适合直接针对系统的开发人员。<br />
<br />
===Arch 与 Mandriva===<br />
Mandriva因其图形化方面的设置而出名,是非常自动化的发行版。默认使用了多线程下载的软件管理系统,更新上非常快速(arch也可以,安装powerpill就可实现),Mandriva有强大的社区和商业支持,对各种图形界面软件的打包非常专业,总体上优于ubuntu(比如gnome和kde都比ubuntu的稳定并且快速),但营销宣传上比ubuntu弱。和ubuntu类似,适合那些不需要太多定制,太过追新的人群。<br />
<br />
===Arch 与 openSUSE===<br />
openSUSE 一向号称是最漂亮的 Linux 发行版,默认已经把很多东西都配置好了,在美工方面下了很多功夫,对商业软件的支持也很好,而且还提供了一个非常优秀的使社区灵活性大大提高在线打包系统。但 openSUSE 近几年更新速度太慢(为了提高灵活度,openSUSE 已经开始试验滚动升级模式 Tumbleweed),最新的几个版本也不太稳定。和 arch 相比,openSUSE 更类似于 ubuntu。<br />
<br />
==与BSD系列的对比==<br />
===Arch vs FreeBSD===<br />
BSDs 起源于伯克利Unix. http://www.freebsd.org/about.html 因此Freebsd不是一个Linux发行版. 软件可以使用二进制或通过'ports'从源代码安装。BSD自我宣称它不仅仅是一个作为整体上的系统,并且会确认每个被移植到FreeBSD上的程序是否能工作正常。像Arch一样,软件包差不多是最新的。这大概是Arch最有意思的竞争者,因为它也醉心于追逐新软件,并且有一个规模比较可观,才华横溢,活跃和严肃的社区。其中其pkg部分,近似于arch的pacman,其port部分,近似于arch的abs,但好像因为其严谨,而缺乏类似arch的aur的东西。<br />
<br />
===Arch vs NetBSD===<br />
NetBSD名称来源于其发起和发展主要靠网络,它是一个自由,安全并且具有高度可移植性的类UNIX开源操作系统,从64位的Opteron机器和桌面系统到手持和嵌入式设备,它支持超过70种平台,可以说是支持平台最多的一个发行版,但它为了可移植性,不可避免牺牲了部分平台的功力,从而无法充分发挥特定平台的全部潜力。它设计简洁,并且那些高级特性使它同时成为优异的生产和研究环境,它也提供给用户所有的源代码。许多应用程序轻易地可以通过pkgsrc来获得,它就是NetBSD软件包集合。Arch不会像NetBSD那样可以用在那么多的设备上,但是对i686平台它会提供更多的应用程序。而且默认的pkgsrc安装方法是先取得软件包的源码再进行编译,而Arch是直接提供二进制软件包。Arch和NetBSD之间有很多相似之处;它们都使用/etc/rc.conf作为主配置文件,它们非常精简和轻巧,它们都提供ports系统和二进制软件,它们都有活跃,严谨的开发和社区。Arch还从*BSD那里借鉴了它的init系统的概念。<br />
<br />
===Arch vs OpenBSD===<br />
OpenBSD是个极端追求安全性的操作系统,自我宣称“大概是头等安全的操作系统“。它也是一个自由,用于多个平台的基于4.4BSD的类UNIX操作系统。相比之下,Arch更专注于简单,优美,精巧和最新的软件。OpenBSD支持大多数程序的二进制仿真,它们来自SVR4(Solaris),FreeBSD, GNU/Linux, BSD/OS, SunOS and HP-UX. 和Arch一样,OpenBSD提供了一个小而优美的基本安装并且使用一个ports系统和软件包系统来允许进行容易的安装和管理非基本系统的软件包。GNU/Linux系统比如说Arch,它和大多数基于BSD的操作系统一样,OpenBSD内核和用户空间的程序,比如说shell和常见的工具(像ls,cp,cat和ps),它们被开发成在单一的源代码仓库中。<br />
目前BSD系列对硬件支持都集中在服务器,对普通电脑的支持相对落后于Linux,而且,软件交流社区也仍然集中在服务器领域,对桌面用户的交流比较弱势,不太适合桌面用户。<br />
<br />
==与其他的对比==<br />
===Arch 与 Zenwalk===<br />
Zenwalk是从Slackware衍生的,但是它更方便和现代。Arch和Zenwalk一个很大的不同是Zenwalk安装的包是开发者已经选好的。如果你喜欢他们的选择,这会节省你的时间,但如果你想有其他选择,这就成它的不便之处了。<br />
<br />
===Arch vs Gobolinux===<br />
Gobolinux 有一个独特的无为而治的包管理方法。其文件系统被组织成应用程序全部位于 /Programs 目录,并且通过符号链接使用。删除程序X只需 rm -rf /Programs/X http://www.gobolinux.org/index.php?page=at_a_glance<br />
It does not seem to focus on i686 binaries and does allow source-based package installs.<br />
其并不是针对i686平台优化的二进制程序,允许基于源码的软件安装。<br />
<br />
===Arch vs Minix 3===<br />
Arch 是一个拥有现代社区和硬件支持的完整发行版。Minix 3 是一个有一些有趣特性的微小而不稳定的高级研究用操作系统,例如用于 [http://en.wikipedia.org/wiki/Microkernel microkernel]。 http://www.minix3.org/<br />
<br />
===Arch 与 Frugalware===<br />
Arch 基于文本界面并且面向命令行操作, 而 Frugalware 提供了更佳的多语言支持. 同时 Frugalware 也提供了更多的本地化文档. 虽然同样使用 packman, 但是它们的包并不完全兼容. Frugalware 默认不支持 JFS 文件系统. Frugalware 不再基于 Slackware,更像是一个独立的发行版,并且它基于 i686 架构。<br />
<br />
===Arch 与 Rock===<br />
<br />
来自这篇介绍:http://www.rocklinux.org/wiki/About<br />
<br />
ROCK Linux是一个用来打造Linux发行版的灵活的开发工具包,即打造你自己的Linux发行版可用的工具链或框架。这个你也可以参考我们的目标描述。<br />
<br />
如果你不想打造你自己的Linux发行版,而只是对一个具有多用途的好的发行版感兴趣,你或许可以看一下 http://www.rocklinux.org/wiki/Crystal_ROCK<br />
<br />
它是一个作为开发工具而生的发行版。和Arch相比,它有和其他基于源码的发行版一样的问题,如编译所需的时间等。它可以运行在多种处理器上如SPARC, ARM等。<br />
<br />
===Arch 与 T2===<br />
来自FAQ http://www.t2-project.org/faq/<br />
<br />
问题:既然已经有Gentoo了为什么还需要T2?<br />
回答:T2,或者更精确的说,它的前身ROCK Linux,它在1998年就启动了,比Gentoo早几个月,而且比Gentoo更早在freshmeat注册--所以,这个问题如果能反过来问或许更好。<br />
同样,在技术方面T2支持商业强度的开发,坚持目标,交互编译,可选的嵌入式C开发库和多引导系统可选择。T2的包通常不包括任何代码,它是基于key-value的文本文件,这使得包的工作和更新在T2上非常快。<br />
Arch使用为i686优化的二进制包(由于不需要编译所有的东西,所以很快)来和T2竞争。T2在技术实力方面是一个强有力的竞争者。由于它能用于嵌入式设备,它有可能在某些应用方面击败Arch。T2值得关注。</div>Ly50247https://wiki.archlinux.org/index.php?title=Arch_compared_to_other_distributions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135275Arch compared to other distributions (简体中文)2011-03-29T04:44:50Z<p>Ly50247: /* Arch 与 Crux */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
{{i18n|Arch Compared to Other Distributions}}<br />
{{Article summary start|概述}}<br />
{{Article summary text|Arch Linux 和其他流行 GNU/Linux 发行版和BSDs的简明比较。}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch Linux}}<br />
{{Article summary wiki|The Arch Way}}<br />
{{Article summary heading|外部链接}}<br />
{{Article summary link|DistroWatch.com|http://distrowatch.com/}}<br />
{{Article summary end}}<br />
<br />
本文试图将 ArchLinux 和其他流行的 GNU/Linux 发行版和类UNIX系统作一个比较。下面的总结很简洁,但可以帮您决定 Arch Linux 是否符合自己的需求。尽管评论和叙述有一定作用,但亲身体验总是比较发行版的最好方法。<br />
<br />
==基于源码的发行版==<br />
基于源码的发行版是可度便捷的,拥有根据自己的机器架构和使用方案最优地控制和编译整个系统和所有软件的优势,但劣势是要在源码编译上消耗大量时间。Arch 的基础和所有软件包都为i686和x86-64平台编译,从而相比基于i386/i486/i586二进制包的发行版,更充分发挥硬件的性能优势。<br />
<br />
===ArchLinux 与 Gentoo===<br />
Arch Linux 和 Gentoo Linux 都是滚动升级的发行版,在上游软件发布后很短时间就制作完成可用的软件包。Gentoo的包和基本系统是直接从源码根据用户指定的USE标识构建。尽管Arch 基本系统被设计为安装预编译的 i686/x86_64 二进制包,它也提供类 ports 系统来从源码编译软件。这样 Arch 更易于构建和升级,而 Gentoo 更易于完全得定制。Arch 只支持 i686 和 x86_64 ,而 Gentoo 对 x86, ppc, sparc, alpha, amd64, arm, mips, hppa, s390, sh, 和 itanium架构提供官方支持。因为 Gentoo 和 Arch 的安装环境都只包含基本系统,二都都被认为是高度可定制的。Gentoo 用户会从 Arch 的大多数方面感到满意。<br />
<br />
=== Arch 与 Sorcerer/Lunar-Linux/Source Mage ===<br />
Sorcerer/Lunar-Linux/Source Mage (SLS)都是基于源码的发行版,它们最开始的时候都是有联系的。SLS使用一套非常简单的脚本文件来创建包描述,使用一个全局配置文件来配置编译过程,这很像 Arch 的[[Arch Build System]](ABS系统)。SLS工具提供完全依赖检查(包括处理可选特性)和包的跟踪、删除以及升级。SLS不提供二进制的包,但是它能很容易的回滚到以前安装的包。<br />
<br />
安装过程包括从文本和ncurses菜单配置一个简单基本系统,然后重新编译这个基本系统(可选)。和 Arch 一样,它们不提供缺省的WM/DE/DM(窗口管理器,桌面环境,桌面管理器),在安装时也没有安装Xorg。但是它们提供一种很简单的方法来安装可选的几个X server(包括X.Org 6.8或7, XFree86)。<br />
<br />
SLS的历史非常复杂。关于它是最好记录可以在这里找到:[http://wiki.sourcemage.org/SourceMage/History the SourceMage wiki]。<br />
<br />
相关链接:<br />
<br />
[http://lunar-linux.org/ Lunar Linux]<br />
<br />
[http://www.sourcemage.org/ SourceMage]<br />
<br />
[http://sorcerer.berlios.de/ Sorcerer]<br />
<br />
==极简派(Minimalist)==<br />
<br />
极简派发行版和 Arch 有相当的可比性,有一些共同之处。从技术层面都强调简洁的重要性。<br />
<br />
=== Arch 与 LFS ===<br />
LFS(Linux From Scratch), 是最个性化的系统,她不是一个发行版,只以文档形式存在。文档指导用户获得用于构建一个实用 GNU/Linux 系统的最少的基础源码包,以及如何手动编译(包括打补丁和配置编译选项等)。LFS就是这样小巧,并且提供优秀和富指导性的构建基本系统的过程。<br />
<br />
Arch基本系统同样提供这些软件包(为 i686/x86-64 优化),以及BSD风格的启动脚本、一些额外的辅助工具和功能强大的 [[pacman]] 包管理工具。LFS 并不提供在线软件仓库,源码要手动获取、编译和安装(使用 make )。(也存在一些手动的包管理方法,在 LFS 手册有提及。)基于Arch基本系统,社区和开发者提供并管理数以千计可供 pacman 安装的二进制包以及 [[Arch Build System]] 使用的 [[PKGBUILD]] 脚本。Arch 同时也包括 [[makepkg]] 工具用来方便地生成 {{Filename|.pkg.tar.xz}} 格式的软件包,然后可以用 pacman 安装。<br />
<br />
Judd Vinet从源码构建 ArchLinux,并用C写下 [[pacman]] 。历史原因,Arch 有时被人们形容成“带有一个优秀包管理系统的Linux“(Linux, with a nice package manager)。<br />
<br />
===Arch 与 CRUX===<br />
<br />
Arch是单独开发的,而不是基于其他任何 GNU/Linux 发行版。在构建 Arch 之前,Judd Vinet 使用并称赞 CRUX(Per Lidén构建的轻量级发行版)。最初的灵感和CRUX是相同的, Arch从源码构建,之后有了用C写成的 [[pacman]]。它们有着相同的指导原则,比如二者都对硬件架构优化,最小化并符合K.I.S.S原则。二者都有类ports系统,使用*BSD风格的初始化系统,而且像*BSD一样都提供可扩展的最小基本环境。[[pacman]] 是 Arch 的一大特色,它用来管理系统中的二进制包,并能很好地与 [[Arch Build System]] 协同工作。CRUX 用一个社区开发的 prt-get来配合自己的ports系统来处理依赖关系,但包是从源码生成的(尽管 CRUX 基本安装环境是二进制的)。Arch 只提供对 x86-64 和 i686 的官方支持,而 CURUX 有官方支持的i686以及社区开发的 x86-64、ppc 和 ppc64。<br />
<br />
Arch 使用滚动升级系统并提供大量二进制包和 [[Arch User Repository]]。相比之下 CRUX 提供一个缺乏官方支持的 ports 系统和比较逊色的软件仓库。<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?pid=133721#p133721 这个论坛的帖子]陈述了一位用户对这两个发行版的观点。<br />
<br />
===Arch 与 Slackware===<br />
Slackware 和 Arch 两者都是“小巧”发行版。两者都使用类 BSD 的初始化脚本。Arch 有一个更健壮的包管理系统 pacman。与 Slackware的标准工具不同,这个工具可以很简单的进行系统的自动升级。从发布周期上来说,Slackware 的发布更为保守,更喜欢提供稳定的软件包。在这个方面,Arch 更为“前卫”。Arch 只是 i686和x86_64,而 Slackware 可以运行在i486系统上。两者除了常规的包管理外都有一个ports-like system──(非官方)Slackbuild系统和Arch Build System (ABS)十分相似,而后者更为自动化点。对于想得到更健壮的包管理或更多最近的包的 Slack用户,Arch 是个非常不错的系统。<br />
<br />
注意:Slackware项目在它的[http://www.slackware.com/info/ General Info page] 上声明道Slackware"使用-mcpu=i686优化参数可以在i686架构的机器上如P3、P4、和Duron/Athlon获得最佳性能",因此有可能两者都优化得一样很好。<br />
<br />
==Arch 与 其他图形化的发行版==<br />
图形化的发行版之间有许多相同之处,而Arch和他们其中的任何一个都非常的不同。 Arch 是个基于文本和面向命令行的。 如果想真正学习Linux,Arch是个更好的选择。图形化的发行版往往装备有GUI安装器(像Fedora的Anaconda)和GUI的系统配置工具(像Suse的Yast)。特殊的不同之处在下面描述。<br />
<br />
=== Arch 与 Debian===<br />
Arch 比 Debian/迭变 更灵巧,Arch 的一开始安装的软件比较少。Debian追求稳定地运行和演化,也因此导致其软件包结构相对来说更为严谨和复杂,测试周期也较长,也不会象arch一样追新。两者都有强大的社区,但Debian特有的稳定性追求,使得其社区不够开放,新手不容易参与。而且 Arch 对于 GNU 定义的“非自由”(non-free)软件包态度更显宽容。相比Debian,Arch 软件包更加先锋(Arch 的 test 软件一般都比 Debian 的 unstable(不稳定版) 的新!)。两者都能够滚动升级,但Debian Stable为了追求稳定性,更多的是采用固定版本发行。<br />
<br />
=== Arch与 Ubuntu===<br />
Arch 是个为了省力地追新而设计的系统,而Ubuntu是为了更方便好用而设计的系统。所以,如果你喜欢自己定制、喜欢追逐软件最新版本,那么 Arch 更为合适。如果不想浪费太多时间在定制系统上,而是希望能够安装完成之后,少量定制就能满意使用,那么Ubuntu显然更擅长此道。一般而言,开发人员和产品设计人员可能喜欢 Arch 多一点。<br />
<br />
===Arch 与 基于 RPM 的发行版===<br />
RPM格式的软件包可以从很多地方得到,rpm可以非常灵活地处理依赖问题,但也因此导致第三方的包经常存在依赖问题,但目前几乎所有基于rpm的Linux系统都提供了非常完备的软件包管理系统,轻易解决了这个问题。另外,在RedHat 的 RPM 和 OpenSuse的RPM之间也经常造成混淆。<br />
<br />
===Arch 与 Fedora===<br />
Fedora 是 RedHat 发行版的技术前导版,对新技术的采用非常激进(比arch还激进),但也因此会导致很多不稳定。它有个坚实的社区和许多预先创建好的软件包,还有可获得的商业性技术支持。Fedora因为商业的原因,默认是不提供有专利方面限制的软件的。Fedora有图形界面安装。<br />
Arch使用基于ncurses文字界面安装。Fedora的图形界面设计友好。Arch相对Fedora是更为简单的系统,依赖于用户手动配置。Fedora有固定版本发布周期。Arch是滚动升级系统。Arch的设计理念是面向轻量级优雅,而Fedora目的是测试所引入的新技术,所以更加适合直接针对系统的开发人员。<br />
<br />
===Arch 与 Mandriva===<br />
Mandriva因其图形化方面的设置而出名,是非常自动化的发行版。默认使用了多线程下载的软件管理系统,更新上非常快速(arch也可以,安装powerpill就可实现),Mandriva有强大的社区和商业支持,对各种图形界面软件的打包非常专业,总体上优于ubuntu(比如gnome和kde都比ubuntu的稳定并且快速),但营销宣传上比ubuntu弱。和ubuntu类似,适合那些不需要太多定制,太过追新的人群。<br />
<br />
===Arch 与 openSUSE===<br />
openSUSE 一向号称是最漂亮的 Linux 发行版,默认已经把很多东西都配置好了,在美工方面下了很多功夫,对商业软件的支持也很好,而且还提供了一个非常优秀的使社区灵活性大大提高在线打包系统。但 openSUSE 近几年更新速度太慢(为了提高灵活度,openSUSE 已经开始试验滚动升级模式 Tumbleweed),最新的几个版本也不太稳定。和 arch 相比,openSUSE 更类似于 ubuntu。<br />
<br />
==与BSD系列的对比==<br />
===Arch vs FreeBSD===<br />
BSDs 起源于伯克利Unix. http://www.freebsd.org/about.html 因此Freebsd不是一个Linux发行版. 软件可以使用二进制或通过'ports'从源代码安装。BSD自我宣称它不仅仅是一个作为整体上的系统,并且会确认每个被移植到FreeBSD上的程序是否能工作正常。像Arch一样,软件包差不多是最新的。这大概是Arch最有意思的竞争者,因为它也醉心于追逐新软件,并且有一个规模比较可观,才华横溢,活跃和严肃的社区。其中其pkg部分,近似于arch的pacman,其port部分,近似于arch的abs,但好像因为其严谨,而缺乏类似arch的aur的东西。<br />
<br />
===Arch vs NetBSD===<br />
NetBSD名称来源于其发起和发展主要靠网络,它是一个自由,安全并且具有高度可移植性的类UNIX开源操作系统,从64位的Opteron机器和桌面系统到手持和嵌入式设备,它支持超过70种平台,可以说是支持平台最多的一个发行版,但它为了可移植性,不可避免牺牲了部分平台的功力,从而无法充分发挥特定平台的全部潜力。它设计简洁,并且那些高级特性使它同时成为优异的生产和研究环境,它也提供给用户所有的源代码。许多应用程序轻易地可以通过pkgsrc来获得,它就是NetBSD软件包集合。Arch不会像NetBSD那样可以用在那么多的设备上,但是对i686平台它会提供更多的应用程序。而且默认的pkgsrc安装方法是先取得软件包的源码再进行编译,而Arch是直接提供二进制软件包。Arch和NetBSD之间有很多相似之处;它们都使用/etc/rc.conf作为主配置文件,它们非常精简和轻巧,它们都提供ports系统和二进制软件,它们都有活跃,严谨的开发和社区。Arch还从*BSD那里借鉴了它的init系统的概念。<br />
<br />
===Arch vs OpenBSD===<br />
OpenBSD是个极端追求安全性的操作系统,自我宣称“大概是头等安全的操作系统“。它也是一个自由,用于多个平台的基于4.4BSD的类UNIX操作系统。相比之下,Arch更专注于简单,优美,精巧和最新的软件。OpenBSD支持大多数程序的二进制仿真,它们来自SVR4(Solaris),FreeBSD, GNU/Linux, BSD/OS, SunOS and HP-UX. 和Arch一样,OpenBSD提供了一个小而优美的基本安装并且使用一个ports系统和软件包系统来允许进行容易的安装和管理非基本系统的软件包。GNU/Linux系统比如说Arch,它和大多数基于BSD的操作系统一样,OpenBSD内核和用户空间的程序,比如说shell和常见的工具(像ls,cp,cat和ps),它们被开发成在单一的源代码仓库中。<br />
目前BSD系列对硬件支持都集中在服务器,对普通电脑的支持相对落后于Linux,而且,软件交流社区也仍然集中在服务器领域,对桌面用户的交流比较弱势,不太适合桌面用户。<br />
<br />
==与其他的对比==<br />
===Arch 与 Zenwalk===<br />
Zenwalk是从Slackware衍生的,但是它更方便和现代。Arch和Zenwalk一个很大的不同是Zenwalk安装的包是开发者已经选好的。如果你喜欢他们的选择,这会节省你的时间,但如果你想有其他选择,这就成它的不便之处了。<br />
<br />
===Arch vs Gobolinux===<br />
Gobolinux 有一个独特的无为而治的包管理方法。其文件系统被组织成应用程序全部位于 /Programs 目录,并且通过符号链接使用。删除程序X只需 rm -rf /Programs/X http://www.gobolinux.org/index.php?page=at_a_glance<br />
It does not seem to focus on i686 binaries and does allow source-based package installs.<br />
其并不是针对i686平台优化的二进制程序,允许基于源码的软件安装。<br />
<br />
===Arch vs Minix 3===<br />
Arch 是一个拥有现代社区和硬件支持的完整发行版。Minix 3 是一个有一些有趣特性的微小而不稳定的高级研究用操作系统,例如用于 [http://en.wikipedia.org/wiki/Microkernel microkernel]。 http://www.minix3.org/<br />
<br />
===Arch 与 Frugalware===<br />
Arch 基于文本界面并且面向命令行操作, 而 Frugalware 提供了更佳的多语言支持. 同时 Frugalware 也提供了更多的本地化文档. 虽然同样使用 packman, 但是它们的包并不完全兼容. Frugalware 默认不支持 JFS 文件系统. Frugalware 不再基于 Slackware,更像是一个独立的发行版,并且它基于 i686 架构。<br />
<br />
===Arch 与 Rock===<br />
<br />
来自这篇介绍:http://www.rocklinux.org/wiki/About<br />
<br />
ROCK Linux是一个用来打造Linux发行版的灵活的开发工具包,即打造你自己的Linux发行版可用的工具链或框架。这个你也可以参考我们的目标描述。<br />
<br />
如果你不想打造你自己的Linux发行版,而只是对一个具有多用途的好的发行版感兴趣,你或许可以看一下 http://www.rocklinux.org/wiki/Crystal_ROCK<br />
<br />
它是一个作为开发工具而生的发行版。和Arch相比,它有和其他基于源码的发行版一样的问题,如编译所需的时间等。它可以运行在多种处理器上如SPARC, ARM等。<br />
<br />
===Arch 与 T2===<br />
来自FAQ http://www.t2-project.org/faq/<br />
<br />
问题:既然已经有Gentoo了为什么还需要T2?<br />
回答:T2,或者更精确的说,它的前身ROCK Linux,它在1998年就启动了,比Gentoo早几个月,而且比Gentoo更早在freshmeat注册--所以,这个问题如果能反过来问或许更好。<br />
同样,在技术方面T2支持商业强度的开发,坚持目标,交互编译,可选的嵌入式C开发库和多引导系统可选择。T2的包通常不包括任何代码,它是基于key-value的文本文件,这使得包的工作和更新在T2上非常快。<br />
Arch使用为i686优化的二进制包(由于不需要编译所有的东西,所以很快)来和T2竞争。T2在技术实力方面是一个强有力的竞争者。由于它能用于嵌入式设备,它有可能在某些应用方面击败Arch。T2值得关注。</div>Ly50247https://wiki.archlinux.org/index.php?title=User_talk:Ly50247&diff=135274User talk:Ly502472011-03-29T04:12:14Z<p>Ly50247: Created page with "讨论页。"</p>
<hr />
<div>讨论页。</div>Ly50247https://wiki.archlinux.org/index.php?title=User:Ly50247&diff=135273User:Ly502472011-03-29T04:11:32Z<p>Ly50247: osily</p>
<hr />
<div>Linux爱好者。<br />
<br />
blog: [http://ly50247.appspot.com/ ly50247]<br />
<br />
email: ly50247 at gmail dot com</div>Ly50247https://wiki.archlinux.org/index.php?title=User:Ly50247&diff=135272User:Ly502472011-03-29T04:11:08Z<p>Ly50247: osily</p>
<hr />
<div>Linux爱好者。<br />
blog: [http://ly50247.appspot.com/]<br />
email: ly50247 at gmail dot com</div>Ly50247https://wiki.archlinux.org/index.php?title=Localization_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Simplified_Chinese_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135264Localization (简体中文)/Simplified Chinese (简体中文)2011-03-29T03:01:58Z<p>Ly50247: /* windows分区下的中文文件是乱码? */</p>
<hr />
<div>[[Category:General (简体中文)]]<br />
[[Category:简体中文]]<br />
<br />
请再仔细看看Arch的哲学"[[Arch 之道 (简体中文)|Arch 之道]]":<br />
这意味着我们不会为你配置好一切,因为“喜好和需求,每人皆不同”,但是我们会尽量确保让你自行配置时,方便和简单。事实上,甚至远比你使用一些可能的Linux中文版本容易。<br />
<br />
第一次使用Arch Linux时,用户通常会遇上这些(典型)的问题:<br />
<br />
== '''怎么显示中文的界面?''' ==<br />
要正确实现中文,必需设置正确的locale和安装合适的中文字体。<br />
<br />
===locale的设定===<br />
Linux中通过locale来设置程序运行的不同环境。一般常用的中文locale有(最直观的分别是可显示字的数量):<br />
zh_CN.GB2312<br />
zh_CN.GB18030<br />
zh_CN.UTF-8<br />
推荐使用UTF8的locale。需要注意的是,对于glibc(>=2.3.6),需要修改/etc/locale.gen文件来设定系统中可以使用的locale<br />
en_US.UTF8 UTF-8<br />
zh_CN.UTF8 UTF-8<br />
zh_CN.GBK GBK<br />
zh_CN.GB2312 GB2312<br />
zh_CN.GB18030 GB18030<br />
然后执行locale-gen命令,这样便可以在系统中使用zh_CN.UTF8,zh_CN.GBK,zh_CN.GB2312,zh_CN.GB18030,en_US.UTF8等locale。可以通过locale命令来查看当前使用的locale<br />
locale<br />
可以通过locale命令来查看目前可以使用的locale<br />
locale -a<br />
<br />
Archlinux中,通过rc.conf文件可以设置全局有效的locale:<br />
LOCALE=en_US.UTF-8<br />
<br />
对于个人用户,还可以在.bashrc或.xprofile中设置自己的用户环境,不同之处在于:<br />
*.bashrc: 每次'''终端登录时'''读取并运用里面的设置。<br />
*.xinitrc: 每次'''startx启动X界面时'''读取并运用里面的设置<br />
*.xprofile: 每次'''使用gdm等图形登录时'''读取并运用里面的设置<br />
<br />
在终端(文字)界面下也可以显示和输入中文,但需要安装cce、zhcon或fbterm。<br />
<br />
===安装中文字体===<br />
除了设置好locale,你还需要安装中文字体:<br />
pacman -S wqy-zenhei<br />
<br />
常用的免费(GPL或兼容版权)中文字体有<br />
wqy-bitmapfont<br />
wqy-zenhei<br />
wqy-microhei (AUR中)<br />
wqy-microhei-lite(AUR中)<br />
ttf-arphic-ukai<br />
ttf-arphic-uming<br />
ttf-fireflysung<br />
<br />
<br />
系统字体将默认安装到/usr/share/fonts,如果你没有root权限或者只打算自己使用某些字体,你可以直接复制这些字体到~/.fonts(或者其他)目录下面,并把该路径加入/etc/fonts/local.conf中,参见后面章节。<br />
<br />
参考网点:<br />
*http://wiki.debian.org.hk/w/Where_can_I_find_fonts_for_GNU/Linux<br />
<br />
==fontconfig设置==<br />
安装好字体以后,你可能对中文字体的显示不太满意。这时需要对fontconfig做某些设置。你可以在~/.fonts.conf中设定,也可以在/etc/fonts/conf.d中设定。<br />
<br />
===重排字型的显示顺序===<br />
Serifs字型<br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Bitstream Vera Serif</family><br />
<family>Times New Roman</family><br />
<family>Nimbus Roman No9 L</family><br />
<family>Luxi Serif</family><br />
<family>Times</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
Sans字型<br />
<alias><br />
<family>sans-serif</family><br />
<prefer><br />
<family>Bitstream Vera Sans</family><br />
<family>Verdana</family><br />
<family>Arial</family><br />
<family>Tahoma</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Helvetica</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Gothic</family><br />
<family>Baekmuk Dotum</family><br />
</prefer><br />
</alias><br />
Mononspace字型 <br />
<alias><br />
<family>monospace</family><br />
<prefer><br />
<family>Bitstream Vera Sans Mono</family><br />
<family>Courier</family><br />
<family>Courier New</family><br />
<family>Andale Mono</family><br />
<family>Luxi Mono</family><br />
<family>Nimbus Mono L</family><br />
<family>WenQuanYi Bitmap Song</family><br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
<br />
===关闭小号字体的AA(反锯齿)===<br />
对于比较小的字体,关闭小号字体的反锯齿,会更加清晰。<br />
<match target="font" ><br />
<test compare="eq" name="family" qual="any" ><br />
<string>AR PL New Sung</string><br />
<string>AR PL ShanHeiSun Uni</string><br />
<string>AR PL ZenKai Uni</string><br />
<string>AR PL Mingti2L Big5</string><br />
<string>AR PL SungtiL Big5</string><br />
<string>MingLiu</string><br />
<string>PMingLiu</string><br />
</test><br />
<test compare="more_eq" name="pixelsize" ><br />
<double>8</double><br />
</test><br />
<test compare="less_eq" name="pixelsize" ><br />
<double>15</double><br />
</test><br />
<edit name="antialias" ><br />
<bool>false</bool><br />
</edit><br />
<edit name="hinting" ><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
'''Tips:'''可以到这里得到更详细的[[字体设置]]文档和完整的[[中文字体配置范例]]<br />
<br />
'''参考文档'''<br />
*Fontconfig用户手册 http://www.chinalinuxpub.com/read.php?wid=634<br />
*令Debian支援中文 http://wiki.linux.org.hk/w/Make_Debian_support_Chinese<br />
*http://www.higherorder.org/wiki/Fontconfig<br />
<br />
== '''怎么输入中文?''' ==<br />
安装相应的输入法 [[scim]] 、 [[fcitx]] 或 [[ibus]]。<br />
<br />
scim:<br />
pacman -S scim-pinyin<br />
简体中文的用户推荐:<br />
scim-pinyin 智能拼音<br />
scim-tables 五笔等基于码表的输入法<br />
繁体中文的用户推荐:<br />
scim-chewing<br />
<br />
要使用scim,还应该设置以下的环境变量(以scim为例),(可在~/.xinitrc, ~/.bashrc或~/.xprofile中设置)<br />
export XIM="SCIM"<br />
export XMODIFIERS=@im=SCIM #设置scim为xim默认输入法<br />
export GTK_IM_MODULE="scim" #设置scim为gtk程序默认的输入法<br />
export QT_IM_MODULE="scim" #设置scim为qt程序默认的输入法<br />
scim -d #使可以自动启动<br />
<br />
已知问题:<br />
*由于SCIM的ABI兼容性问题,目前可能会造成一些软件拒绝运行,这些软件包括但不限于:Acrobat Reader, 直接从mozilla.org下载的firefox, thunderbird,以及realplay。<br />
<br />
fcitx:<br />
与scim类似:<br />
pacman -S fcitx<br />
并将上述配置中的SCIM/scim 改成 FCITX/fcitx。<br />
<br />
== '''中文显示很模糊(淡),或没有中文粗体?''' ==<br />
在正常情况下,gnome本身已经转由cairo+pango来渲染字体,不存在这个问题了,但是你很可能在浏览一些网页时,还会发生这些问题。<br />
<br />
或者使用了下面的local.conf文件替换系统默认的local.conf文件。<br />
cp local.conf /etc/fonts/ <br />
或者,自行编译fontconfig2.3.92以上的版本,并打开local.conf中的autohint<br />
<br />
KDE环境:<br />
<br />
其他环境:见上。<br />
<br />
*官方新版本的mozila firefox(大于1.5.0.1)已经使用cairo+pango,但是在某些网站时会相当的慢。<br />
<br />
<br />
没有中文粗体解决方法:<br />
<br />
把下面的配置加入/etc/fonts/local.conf<br />
<pre><br />
<!--<br />
Synthetic emboldening for fonts that do not have bold face available<br />
--><br />
<br />
<match target="font"><br />
<!-- check to see if the font is just regular --><br />
<test name="weight" compare="less_eq"><br />
<const>medium</const><br />
</test><br />
<!-- check to see if the pattern requests bold --><br />
<test target="pattern" name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<!--<br />
set the embolden flag<br />
needed for applications using cairo, e.g. gucharmap, gedit, ...<br />
--><br />
<edit name="embolden" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
<!--<br />
set weight to bold<br />
needed for applications using Xft directly, e.g. Firefox, ...<br />
--><br />
<edit name="weight" mode="assign"><br />
<const>bold</const><br />
</edit><br />
</match><br />
</pre><br />
<br />
== '''如何显示影片的中文字幕?''' ==<br />
===mplayer===<br />
要使mplayer正确显示字幕,关键是要使字幕文件的编码和mplayer config里使用的编码相一致。字幕文件编码为gbk,则subcp=cp936;字幕文件编码为utf-8,则subcp=utf8。如果字幕文件编码为utf-8,而设置成subcp=cp936,则会出现部分乱码的情况。另一种更为简单的方法是设置成subcp=enca:zh:ucs-2,由enca负责字幕的编码显示问题。<br />
<br />
修改~/.mplayer/config<br />
font='文泉驿正黑'<br />
subcp=enca:zh:ucs-2<br />
<br />
可以使用下面的命令手动加载字幕<br />
mplayer xxx.avi -sub xxxxx.srt<br />
同时,你还可以设置mplayer自动加载字幕。如果你无法在gmplayer的选项中找到这个选项(天知道你会有这样粗心),直接修改~/.mplayer/gui.conf如下:<br />
sub_auto_load = "yes"<br />
sub_unicode = "yes"<br />
sub_pos = "100"<br />
sub_overlap = "no"<br />
sub_cp = "cp936"<br />
font_factor = "0.750000"<br />
font_encoding = "unicode"<br />
<br />
*mplayer cvs(2005.12以后)已经使用了gtk2的界面,但是很遗憾的是并没有完全利用gtk2良好的国际支持,甚至没有使用gtk.filechooser。<br />
*正体中文 codepage 为 cp950。<br />
<br />
===SMPlayer===<br />
SMPlayer 是一个基于QT的MPlayer前端。显示中文字幕很方便。只要在设置对话框里设定缺省字幕编码和字体即可。而且立即生效,无需重新启动程序。<br />
<br />
===xine===<br />
xine也可以显示中文字幕,但需要制作自己的中文字体。具体可以参考<br />
http://forum.ubuntu.org.cn/about2760.html<br />
<br />
===gstreamer===<br />
在totem 1.4.0,由于使用gstreamer0.10,应该是可以自动加载同名的srt字幕。<br />
<br />
== '''MP3文件在播放器中乱码''' ==<br />
对于所有用gstreamer做后端的播放器,如Rhythmbox,totem,设置如下的环境变量后即可正确读取mp3中GBK编码的id3 tag。<br />
export GST_ID3_TAG_ENCODING=GBK:UTF-8:GB18030<br />
export GST_ID3V2_TAG_ENCODING=GBK:UTF-8:GB18030<br />
<br />
对于Beep media player,可以在pefenrence->plugins->media中选中MPEG Audio plugin然后点击下方的Penfenrences,此时会出现一个对话框,选择title,将Disable ID3v2和Convert non-UTF8 ID3 tags to UTF8前的选择框选中。然后在ID3 encoding中填入 gbk。这样bmp就能正确显示GBK编码的ID3 tag。<br />
<br />
Quod Libet播放器支持tag编辑及设置id3v2编码。可以在~/.quodlibet/config中设置<br />
id3encoding = gbk<br />
注意:Quod Libet默认支持utf8编码<br />
<br />
最为彻底的解决方法为将编码为gbk的id3 tag转化为utf8编码。首先安装mutagen,然后利用下面的命令转化:<br />
mid3iconv -e gbk test.mp3<br />
<br />
== '''windows分区下的中文文件是乱码?''' ==<br />
<br />
一般是因为挂载的字符集与locale不同,可以修改/etc/fstab(如果不了解请仔细阅读相关文档)。如果locale是utf8,例如:<br />
/dev/hdc5 /media/win ntfs-3g defaults iocharset=utf8 0 0<br />
<br />
如果locale是GBK,则应该是<br />
iocharset=cp936<br />
<br />
=='''samba乱码'''==<br />
用Arch作为samba服务器时,在 /etc/samba/smb.conf 中加入下面一行就可以解决Windows客户端等乱码问题:<br />
unix charset=gb2312<br />
<br />
=='''ftp乱码'''==<br />
很多ftp站点是GBK编码,如果使用UTF8的locale,下载的文件名可能会乱码。对于lftp,在.lftp/rc下做如下设置<br />
set ftp:charset "gbk"<br />
set file:charset "UTF-8"<br />
对于gftp,可以在.gftp/gftprc中做如下设置即可正确显示服务器端gbk编码的文件名<br />
remote_charsets=gb2312<br />
但下载下来的文件名仍然是乱码,此时需要打补丁。补丁地址为:<br />
http://www.teatime.com.tw/%7Etommy/linux/gftp_remote_charsets.patch<br />
<br />
==JAVA界面乱码==<br />
对于java 1.5来说(同样适用于java 1.6),只要在<br />
/opt/java/jre/lib/fonts<br />
中建立fallback目录,然后链接或拷贝若干中文字体到该目录就能使java程序正确显示中文。例如,在已经安装 jre 和ttf-fireflysung 的情况下,执行下面的命令即可:<br />
ln -s /usr/share/fonts/TTF/odosung.ttc /opt/java/jre/lib/fonts/fallback/<br />
cd /opt/java/jre/lib/fonts/fallback/<br />
#以下两个命令要使用root权限<br />
mkfontdir<br />
mkfontscale<br />
<br />
<br />
如果是openjdk6 则需要复制这个文件:/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties.src 到/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties,并修改这个文件中的字体位置,因为文泉绎地址指错了。<br />
<br />
== '''Doc文件无法打开或显示不正常?''' ==<br />
安装openoffice。<br />
#pacman -Sy openoffice-base openoffice-zh-CN<br />
*如果你打算使用英文版的openoffice,你只需要安装openoffice-base包。<br />
*正体中文包 openoffice-zh_tw。<br />
*开启 amd_64 的 openoffice 时可能发生异常,此时可安装 libsndfile 进行修正。<br />
*目前,由于go-openoffice扩充了OpenOffice.org的功能(比如,完善了许多微软私有文档格式的兼容性),因此,我们推荐您使用go-openoffice。<br />
<br />
=='''正确显示中文PDF文件'''==<br />
<br />
'''Tips:''' 要正常显示所有的中文pdf(除了自定义字库外,比如文渊阁版四库全书),都需要安装poppler-data<br />
因为,linux下pdf大都以Poppler为解析PDF后端的,而Poppler已经提供了包含中文字体在内的包poppler-data,所以只要安装poppler-data,中文显示问题就可解决。 <br />
<br />
===okular===<br />
pacman -S kdegraphics-okular<br />
<br />
===arcobat===<br />
安装AUR里的acroread,并且安装相应中文包即可。<br />
<br />
=== Evince===<br />
<br />
pacman -S evince<br />
<br />
===xpdf===<br />
<br />
pacman -S xpdf-chinese-simplified<br />
<br />
===其他可用的pdf阅读器===<br />
比如foxit<br />
<br />
===另外的问题===<br />
在中国知网、万方数据库上下载的一些论文没有明确指定字体,系统选用英文字体显示它们,于是导致中文无法显示。要解决这一问题,需要修改系统的字体配置,<br />
下面的方法更加建议使用:修改/etc/fonts/conf.d/65-nonlatin.conf<br />
把里面自己想使用的字体位置提到前面就可以了。<br />
<br />
'''Tips:''' 下面的建议是以前对字体配置文件不熟悉的时候经常使用的方法,现在建议不要采纳(虽然网上绝大部分流行的教程都是这么做的)<br />
<br />
====================================================================<br />
一种比较简便的方法是直接删除/etc/fonts/conf.d/49-sansserif.conf:<br />
<br />
# rm /etc/fonts/conf.d/49-sansserif.conf<br />
<br />
建议不要这么做,也可以将/etc/fonts/conf.d/49-sansserif.conf的<br />
<br />
<edit name="family" mode="append_last"><br />
<string>sans-serif</string><br />
</edit><br />
<br />
改成<br />
<br />
<edit name="family" mode="append_last"><br />
<string>文泉驿正黑</string><br />
</edit><br />
<br />
其中“文泉驿正黑”也可被其它所安装的中文字体代替。<br />
<br />
=======================================================================<br />
<br />
==vim乱码==<br />
如果locale是utf8编码,用vim显示gbk编码的文件可能会乱码。因此需要在.virc做如下设置<br />
"Chinese GBK support<br />
set fileencodings=utf8,gbk<br />
<br />
==Latex中如何使用中文==<br />
首先需要安装CJK包,然后需要安装合适的字体。具体可以参考<br />
*http://www.ctex.org<br />
*http://www.newsmth.net 的Tex版<br />
<br />
==如何使用字典==<br />
首先请先安装stardict<br />
pacman -S stardict<br />
stardict默认是不带字典的,需要去http://stardict.sourceforge.net/ 下载字典安装。安装方法如下<br />
tar -xjvf testdict.tar.bz2<br />
mv testdict /usr/share/stardict/dic<br />
推荐使用<br />
*xdict英汉字典 <br />
*Merriam Webster 10th dictionary<br />
*牛津现代英汉双解辞典(正体中文)<br />
*朗道英汉词典(正体中文)</div>Ly50247https://wiki.archlinux.org/index.php?title=Localization_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Simplified_Chinese_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135263Localization (简体中文)/Simplified Chinese (简体中文)2011-03-29T02:56:29Z<p>Ly50247: /* 怎么输入中文? */</p>
<hr />
<div>[[Category:General (简体中文)]]<br />
[[Category:简体中文]]<br />
<br />
请再仔细看看Arch的哲学"[[Arch 之道 (简体中文)|Arch 之道]]":<br />
这意味着我们不会为你配置好一切,因为“喜好和需求,每人皆不同”,但是我们会尽量确保让你自行配置时,方便和简单。事实上,甚至远比你使用一些可能的Linux中文版本容易。<br />
<br />
第一次使用Arch Linux时,用户通常会遇上这些(典型)的问题:<br />
<br />
== '''怎么显示中文的界面?''' ==<br />
要正确实现中文,必需设置正确的locale和安装合适的中文字体。<br />
<br />
===locale的设定===<br />
Linux中通过locale来设置程序运行的不同环境。一般常用的中文locale有(最直观的分别是可显示字的数量):<br />
zh_CN.GB2312<br />
zh_CN.GB18030<br />
zh_CN.UTF-8<br />
推荐使用UTF8的locale。需要注意的是,对于glibc(>=2.3.6),需要修改/etc/locale.gen文件来设定系统中可以使用的locale<br />
en_US.UTF8 UTF-8<br />
zh_CN.UTF8 UTF-8<br />
zh_CN.GBK GBK<br />
zh_CN.GB2312 GB2312<br />
zh_CN.GB18030 GB18030<br />
然后执行locale-gen命令,这样便可以在系统中使用zh_CN.UTF8,zh_CN.GBK,zh_CN.GB2312,zh_CN.GB18030,en_US.UTF8等locale。可以通过locale命令来查看当前使用的locale<br />
locale<br />
可以通过locale命令来查看目前可以使用的locale<br />
locale -a<br />
<br />
Archlinux中,通过rc.conf文件可以设置全局有效的locale:<br />
LOCALE=en_US.UTF-8<br />
<br />
对于个人用户,还可以在.bashrc或.xprofile中设置自己的用户环境,不同之处在于:<br />
*.bashrc: 每次'''终端登录时'''读取并运用里面的设置。<br />
*.xinitrc: 每次'''startx启动X界面时'''读取并运用里面的设置<br />
*.xprofile: 每次'''使用gdm等图形登录时'''读取并运用里面的设置<br />
<br />
在终端(文字)界面下也可以显示和输入中文,但需要安装cce、zhcon或fbterm。<br />
<br />
===安装中文字体===<br />
除了设置好locale,你还需要安装中文字体:<br />
pacman -S wqy-zenhei<br />
<br />
常用的免费(GPL或兼容版权)中文字体有<br />
wqy-bitmapfont<br />
wqy-zenhei<br />
wqy-microhei (AUR中)<br />
wqy-microhei-lite(AUR中)<br />
ttf-arphic-ukai<br />
ttf-arphic-uming<br />
ttf-fireflysung<br />
<br />
<br />
系统字体将默认安装到/usr/share/fonts,如果你没有root权限或者只打算自己使用某些字体,你可以直接复制这些字体到~/.fonts(或者其他)目录下面,并把该路径加入/etc/fonts/local.conf中,参见后面章节。<br />
<br />
参考网点:<br />
*http://wiki.debian.org.hk/w/Where_can_I_find_fonts_for_GNU/Linux<br />
<br />
==fontconfig设置==<br />
安装好字体以后,你可能对中文字体的显示不太满意。这时需要对fontconfig做某些设置。你可以在~/.fonts.conf中设定,也可以在/etc/fonts/conf.d中设定。<br />
<br />
===重排字型的显示顺序===<br />
Serifs字型<br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Bitstream Vera Serif</family><br />
<family>Times New Roman</family><br />
<family>Nimbus Roman No9 L</family><br />
<family>Luxi Serif</family><br />
<family>Times</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
Sans字型<br />
<alias><br />
<family>sans-serif</family><br />
<prefer><br />
<family>Bitstream Vera Sans</family><br />
<family>Verdana</family><br />
<family>Arial</family><br />
<family>Tahoma</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Helvetica</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Gothic</family><br />
<family>Baekmuk Dotum</family><br />
</prefer><br />
</alias><br />
Mononspace字型 <br />
<alias><br />
<family>monospace</family><br />
<prefer><br />
<family>Bitstream Vera Sans Mono</family><br />
<family>Courier</family><br />
<family>Courier New</family><br />
<family>Andale Mono</family><br />
<family>Luxi Mono</family><br />
<family>Nimbus Mono L</family><br />
<family>WenQuanYi Bitmap Song</family><br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
<br />
===关闭小号字体的AA(反锯齿)===<br />
对于比较小的字体,关闭小号字体的反锯齿,会更加清晰。<br />
<match target="font" ><br />
<test compare="eq" name="family" qual="any" ><br />
<string>AR PL New Sung</string><br />
<string>AR PL ShanHeiSun Uni</string><br />
<string>AR PL ZenKai Uni</string><br />
<string>AR PL Mingti2L Big5</string><br />
<string>AR PL SungtiL Big5</string><br />
<string>MingLiu</string><br />
<string>PMingLiu</string><br />
</test><br />
<test compare="more_eq" name="pixelsize" ><br />
<double>8</double><br />
</test><br />
<test compare="less_eq" name="pixelsize" ><br />
<double>15</double><br />
</test><br />
<edit name="antialias" ><br />
<bool>false</bool><br />
</edit><br />
<edit name="hinting" ><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
'''Tips:'''可以到这里得到更详细的[[字体设置]]文档和完整的[[中文字体配置范例]]<br />
<br />
'''参考文档'''<br />
*Fontconfig用户手册 http://www.chinalinuxpub.com/read.php?wid=634<br />
*令Debian支援中文 http://wiki.linux.org.hk/w/Make_Debian_support_Chinese<br />
*http://www.higherorder.org/wiki/Fontconfig<br />
<br />
== '''怎么输入中文?''' ==<br />
安装相应的输入法 [[scim]] 、 [[fcitx]] 或 [[ibus]]。<br />
<br />
scim:<br />
pacman -S scim-pinyin<br />
简体中文的用户推荐:<br />
scim-pinyin 智能拼音<br />
scim-tables 五笔等基于码表的输入法<br />
繁体中文的用户推荐:<br />
scim-chewing<br />
<br />
要使用scim,还应该设置以下的环境变量(以scim为例),(可在~/.xinitrc, ~/.bashrc或~/.xprofile中设置)<br />
export XIM="SCIM"<br />
export XMODIFIERS=@im=SCIM #设置scim为xim默认输入法<br />
export GTK_IM_MODULE="scim" #设置scim为gtk程序默认的输入法<br />
export QT_IM_MODULE="scim" #设置scim为qt程序默认的输入法<br />
scim -d #使可以自动启动<br />
<br />
已知问题:<br />
*由于SCIM的ABI兼容性问题,目前可能会造成一些软件拒绝运行,这些软件包括但不限于:Acrobat Reader, 直接从mozilla.org下载的firefox, thunderbird,以及realplay。<br />
<br />
fcitx:<br />
与scim类似:<br />
pacman -S fcitx<br />
并将上述配置中的SCIM/scim 改成 FCITX/fcitx。<br />
<br />
== '''中文显示很模糊(淡),或没有中文粗体?''' ==<br />
在正常情况下,gnome本身已经转由cairo+pango来渲染字体,不存在这个问题了,但是你很可能在浏览一些网页时,还会发生这些问题。<br />
<br />
或者使用了下面的local.conf文件替换系统默认的local.conf文件。<br />
cp local.conf /etc/fonts/ <br />
或者,自行编译fontconfig2.3.92以上的版本,并打开local.conf中的autohint<br />
<br />
KDE环境:<br />
<br />
其他环境:见上。<br />
<br />
*官方新版本的mozila firefox(大于1.5.0.1)已经使用cairo+pango,但是在某些网站时会相当的慢。<br />
<br />
<br />
没有中文粗体解决方法:<br />
<br />
把下面的配置加入/etc/fonts/local.conf<br />
<pre><br />
<!--<br />
Synthetic emboldening for fonts that do not have bold face available<br />
--><br />
<br />
<match target="font"><br />
<!-- check to see if the font is just regular --><br />
<test name="weight" compare="less_eq"><br />
<const>medium</const><br />
</test><br />
<!-- check to see if the pattern requests bold --><br />
<test target="pattern" name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<!--<br />
set the embolden flag<br />
needed for applications using cairo, e.g. gucharmap, gedit, ...<br />
--><br />
<edit name="embolden" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
<!--<br />
set weight to bold<br />
needed for applications using Xft directly, e.g. Firefox, ...<br />
--><br />
<edit name="weight" mode="assign"><br />
<const>bold</const><br />
</edit><br />
</match><br />
</pre><br />
<br />
== '''如何显示影片的中文字幕?''' ==<br />
===mplayer===<br />
要使mplayer正确显示字幕,关键是要使字幕文件的编码和mplayer config里使用的编码相一致。字幕文件编码为gbk,则subcp=cp936;字幕文件编码为utf-8,则subcp=utf8。如果字幕文件编码为utf-8,而设置成subcp=cp936,则会出现部分乱码的情况。另一种更为简单的方法是设置成subcp=enca:zh:ucs-2,由enca负责字幕的编码显示问题。<br />
<br />
修改~/.mplayer/config<br />
font='文泉驿正黑'<br />
subcp=enca:zh:ucs-2<br />
<br />
可以使用下面的命令手动加载字幕<br />
mplayer xxx.avi -sub xxxxx.srt<br />
同时,你还可以设置mplayer自动加载字幕。如果你无法在gmplayer的选项中找到这个选项(天知道你会有这样粗心),直接修改~/.mplayer/gui.conf如下:<br />
sub_auto_load = "yes"<br />
sub_unicode = "yes"<br />
sub_pos = "100"<br />
sub_overlap = "no"<br />
sub_cp = "cp936"<br />
font_factor = "0.750000"<br />
font_encoding = "unicode"<br />
<br />
*mplayer cvs(2005.12以后)已经使用了gtk2的界面,但是很遗憾的是并没有完全利用gtk2良好的国际支持,甚至没有使用gtk.filechooser。<br />
*正体中文 codepage 为 cp950。<br />
<br />
===SMPlayer===<br />
SMPlayer 是一个基于QT的MPlayer前端。显示中文字幕很方便。只要在设置对话框里设定缺省字幕编码和字体即可。而且立即生效,无需重新启动程序。<br />
<br />
===xine===<br />
xine也可以显示中文字幕,但需要制作自己的中文字体。具体可以参考<br />
http://forum.ubuntu.org.cn/about2760.html<br />
<br />
===gstreamer===<br />
在totem 1.4.0,由于使用gstreamer0.10,应该是可以自动加载同名的srt字幕。<br />
<br />
== '''MP3文件在播放器中乱码''' ==<br />
对于所有用gstreamer做后端的播放器,如Rhythmbox,totem,设置如下的环境变量后即可正确读取mp3中GBK编码的id3 tag。<br />
export GST_ID3_TAG_ENCODING=GBK:UTF-8:GB18030<br />
export GST_ID3V2_TAG_ENCODING=GBK:UTF-8:GB18030<br />
<br />
对于Beep media player,可以在pefenrence->plugins->media中选中MPEG Audio plugin然后点击下方的Penfenrences,此时会出现一个对话框,选择title,将Disable ID3v2和Convert non-UTF8 ID3 tags to UTF8前的选择框选中。然后在ID3 encoding中填入 gbk。这样bmp就能正确显示GBK编码的ID3 tag。<br />
<br />
Quod Libet播放器支持tag编辑及设置id3v2编码。可以在~/.quodlibet/config中设置<br />
id3encoding = gbk<br />
注意:Quod Libet默认支持utf8编码<br />
<br />
最为彻底的解决方法为将编码为gbk的id3 tag转化为utf8编码。首先安装mutagen,然后利用下面的命令转化:<br />
mid3iconv -e gbk test.mp3<br />
<br />
== '''windows分区下的中文文件是乱码?''' ==<br />
如果使用了hal,应该是没有问题了,但是如果没有,请不妨试一下:<br />
在/etc/rc.conf中的daemon一段中添加hal。<br />
<br />
或者直接修改/etc/fstab,'''注意危险''',你如果不懂,就不要学我:-)。如果locale是utf8,挂载windows分区时应该做如下设置<br />
/dev/hdc5 / reiserfs defaults iocharset=utf8 0 0<br />
<br />
如果locale是GBK,则应该是<br />
iocharset=cp936 <br />
<br />
已知问题:<br />
<br />
=='''samba乱码'''==<br />
用Arch作为samba服务器时,在 /etc/samba/smb.conf 中加入下面一行就可以解决Windows客户端等乱码问题:<br />
unix charset=gb2312<br />
<br />
=='''ftp乱码'''==<br />
很多ftp站点是GBK编码,如果使用UTF8的locale,下载的文件名可能会乱码。对于lftp,在.lftp/rc下做如下设置<br />
set ftp:charset "gbk"<br />
set file:charset "UTF-8"<br />
对于gftp,可以在.gftp/gftprc中做如下设置即可正确显示服务器端gbk编码的文件名<br />
remote_charsets=gb2312<br />
但下载下来的文件名仍然是乱码,此时需要打补丁。补丁地址为:<br />
http://www.teatime.com.tw/%7Etommy/linux/gftp_remote_charsets.patch<br />
<br />
==JAVA界面乱码==<br />
对于java 1.5来说(同样适用于java 1.6),只要在<br />
/opt/java/jre/lib/fonts<br />
中建立fallback目录,然后链接或拷贝若干中文字体到该目录就能使java程序正确显示中文。例如,在已经安装 jre 和ttf-fireflysung 的情况下,执行下面的命令即可:<br />
ln -s /usr/share/fonts/TTF/odosung.ttc /opt/java/jre/lib/fonts/fallback/<br />
cd /opt/java/jre/lib/fonts/fallback/<br />
#以下两个命令要使用root权限<br />
mkfontdir<br />
mkfontscale<br />
<br />
<br />
如果是openjdk6 则需要复制这个文件:/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties.src 到/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties,并修改这个文件中的字体位置,因为文泉绎地址指错了。<br />
<br />
== '''Doc文件无法打开或显示不正常?''' ==<br />
安装openoffice。<br />
#pacman -Sy openoffice-base openoffice-zh-CN<br />
*如果你打算使用英文版的openoffice,你只需要安装openoffice-base包。<br />
*正体中文包 openoffice-zh_tw。<br />
*开启 amd_64 的 openoffice 时可能发生异常,此时可安装 libsndfile 进行修正。<br />
*目前,由于go-openoffice扩充了OpenOffice.org的功能(比如,完善了许多微软私有文档格式的兼容性),因此,我们推荐您使用go-openoffice。<br />
<br />
=='''正确显示中文PDF文件'''==<br />
<br />
'''Tips:''' 要正常显示所有的中文pdf(除了自定义字库外,比如文渊阁版四库全书),都需要安装poppler-data<br />
因为,linux下pdf大都以Poppler为解析PDF后端的,而Poppler已经提供了包含中文字体在内的包poppler-data,所以只要安装poppler-data,中文显示问题就可解决。 <br />
<br />
===okular===<br />
pacman -S kdegraphics-okular<br />
<br />
===arcobat===<br />
安装AUR里的acroread,并且安装相应中文包即可。<br />
<br />
=== Evince===<br />
<br />
pacman -S evince<br />
<br />
===xpdf===<br />
<br />
pacman -S xpdf-chinese-simplified<br />
<br />
===其他可用的pdf阅读器===<br />
比如foxit<br />
<br />
===另外的问题===<br />
在中国知网、万方数据库上下载的一些论文没有明确指定字体,系统选用英文字体显示它们,于是导致中文无法显示。要解决这一问题,需要修改系统的字体配置,<br />
下面的方法更加建议使用:修改/etc/fonts/conf.d/65-nonlatin.conf<br />
把里面自己想使用的字体位置提到前面就可以了。<br />
<br />
'''Tips:''' 下面的建议是以前对字体配置文件不熟悉的时候经常使用的方法,现在建议不要采纳(虽然网上绝大部分流行的教程都是这么做的)<br />
<br />
====================================================================<br />
一种比较简便的方法是直接删除/etc/fonts/conf.d/49-sansserif.conf:<br />
<br />
# rm /etc/fonts/conf.d/49-sansserif.conf<br />
<br />
建议不要这么做,也可以将/etc/fonts/conf.d/49-sansserif.conf的<br />
<br />
<edit name="family" mode="append_last"><br />
<string>sans-serif</string><br />
</edit><br />
<br />
改成<br />
<br />
<edit name="family" mode="append_last"><br />
<string>文泉驿正黑</string><br />
</edit><br />
<br />
其中“文泉驿正黑”也可被其它所安装的中文字体代替。<br />
<br />
=======================================================================<br />
<br />
==vim乱码==<br />
如果locale是utf8编码,用vim显示gbk编码的文件可能会乱码。因此需要在.virc做如下设置<br />
"Chinese GBK support<br />
set fileencodings=utf8,gbk<br />
<br />
==Latex中如何使用中文==<br />
首先需要安装CJK包,然后需要安装合适的字体。具体可以参考<br />
*http://www.ctex.org<br />
*http://www.newsmth.net 的Tex版<br />
<br />
==如何使用字典==<br />
首先请先安装stardict<br />
pacman -S stardict<br />
stardict默认是不带字典的,需要去http://stardict.sourceforge.net/ 下载字典安装。安装方法如下<br />
tar -xjvf testdict.tar.bz2<br />
mv testdict /usr/share/stardict/dic<br />
推荐使用<br />
*xdict英汉字典 <br />
*Merriam Webster 10th dictionary<br />
*牛津现代英汉双解辞典(正体中文)<br />
*朗道英汉词典(正体中文)</div>Ly50247https://wiki.archlinux.org/index.php?title=Localization_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Simplified_Chinese_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135262Localization (简体中文)/Simplified Chinese (简体中文)2011-03-29T02:55:55Z<p>Ly50247: /* 怎么输入中文? */</p>
<hr />
<div>[[Category:General (简体中文)]]<br />
[[Category:简体中文]]<br />
<br />
请再仔细看看Arch的哲学"[[Arch 之道 (简体中文)|Arch 之道]]":<br />
这意味着我们不会为你配置好一切,因为“喜好和需求,每人皆不同”,但是我们会尽量确保让你自行配置时,方便和简单。事实上,甚至远比你使用一些可能的Linux中文版本容易。<br />
<br />
第一次使用Arch Linux时,用户通常会遇上这些(典型)的问题:<br />
<br />
== '''怎么显示中文的界面?''' ==<br />
要正确实现中文,必需设置正确的locale和安装合适的中文字体。<br />
<br />
===locale的设定===<br />
Linux中通过locale来设置程序运行的不同环境。一般常用的中文locale有(最直观的分别是可显示字的数量):<br />
zh_CN.GB2312<br />
zh_CN.GB18030<br />
zh_CN.UTF-8<br />
推荐使用UTF8的locale。需要注意的是,对于glibc(>=2.3.6),需要修改/etc/locale.gen文件来设定系统中可以使用的locale<br />
en_US.UTF8 UTF-8<br />
zh_CN.UTF8 UTF-8<br />
zh_CN.GBK GBK<br />
zh_CN.GB2312 GB2312<br />
zh_CN.GB18030 GB18030<br />
然后执行locale-gen命令,这样便可以在系统中使用zh_CN.UTF8,zh_CN.GBK,zh_CN.GB2312,zh_CN.GB18030,en_US.UTF8等locale。可以通过locale命令来查看当前使用的locale<br />
locale<br />
可以通过locale命令来查看目前可以使用的locale<br />
locale -a<br />
<br />
Archlinux中,通过rc.conf文件可以设置全局有效的locale:<br />
LOCALE=en_US.UTF-8<br />
<br />
对于个人用户,还可以在.bashrc或.xprofile中设置自己的用户环境,不同之处在于:<br />
*.bashrc: 每次'''终端登录时'''读取并运用里面的设置。<br />
*.xinitrc: 每次'''startx启动X界面时'''读取并运用里面的设置<br />
*.xprofile: 每次'''使用gdm等图形登录时'''读取并运用里面的设置<br />
<br />
在终端(文字)界面下也可以显示和输入中文,但需要安装cce、zhcon或fbterm。<br />
<br />
===安装中文字体===<br />
除了设置好locale,你还需要安装中文字体:<br />
pacman -S wqy-zenhei<br />
<br />
常用的免费(GPL或兼容版权)中文字体有<br />
wqy-bitmapfont<br />
wqy-zenhei<br />
wqy-microhei (AUR中)<br />
wqy-microhei-lite(AUR中)<br />
ttf-arphic-ukai<br />
ttf-arphic-uming<br />
ttf-fireflysung<br />
<br />
<br />
系统字体将默认安装到/usr/share/fonts,如果你没有root权限或者只打算自己使用某些字体,你可以直接复制这些字体到~/.fonts(或者其他)目录下面,并把该路径加入/etc/fonts/local.conf中,参见后面章节。<br />
<br />
参考网点:<br />
*http://wiki.debian.org.hk/w/Where_can_I_find_fonts_for_GNU/Linux<br />
<br />
==fontconfig设置==<br />
安装好字体以后,你可能对中文字体的显示不太满意。这时需要对fontconfig做某些设置。你可以在~/.fonts.conf中设定,也可以在/etc/fonts/conf.d中设定。<br />
<br />
===重排字型的显示顺序===<br />
Serifs字型<br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Bitstream Vera Serif</family><br />
<family>Times New Roman</family><br />
<family>Nimbus Roman No9 L</family><br />
<family>Luxi Serif</family><br />
<family>Times</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
Sans字型<br />
<alias><br />
<family>sans-serif</family><br />
<prefer><br />
<family>Bitstream Vera Sans</family><br />
<family>Verdana</family><br />
<family>Arial</family><br />
<family>Tahoma</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Helvetica</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Gothic</family><br />
<family>Baekmuk Dotum</family><br />
</prefer><br />
</alias><br />
Mononspace字型 <br />
<alias><br />
<family>monospace</family><br />
<prefer><br />
<family>Bitstream Vera Sans Mono</family><br />
<family>Courier</family><br />
<family>Courier New</family><br />
<family>Andale Mono</family><br />
<family>Luxi Mono</family><br />
<family>Nimbus Mono L</family><br />
<family>WenQuanYi Bitmap Song</family><br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
<br />
===关闭小号字体的AA(反锯齿)===<br />
对于比较小的字体,关闭小号字体的反锯齿,会更加清晰。<br />
<match target="font" ><br />
<test compare="eq" name="family" qual="any" ><br />
<string>AR PL New Sung</string><br />
<string>AR PL ShanHeiSun Uni</string><br />
<string>AR PL ZenKai Uni</string><br />
<string>AR PL Mingti2L Big5</string><br />
<string>AR PL SungtiL Big5</string><br />
<string>MingLiu</string><br />
<string>PMingLiu</string><br />
</test><br />
<test compare="more_eq" name="pixelsize" ><br />
<double>8</double><br />
</test><br />
<test compare="less_eq" name="pixelsize" ><br />
<double>15</double><br />
</test><br />
<edit name="antialias" ><br />
<bool>false</bool><br />
</edit><br />
<edit name="hinting" ><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
'''Tips:'''可以到这里得到更详细的[[字体设置]]文档和完整的[[中文字体配置范例]]<br />
<br />
'''参考文档'''<br />
*Fontconfig用户手册 http://www.chinalinuxpub.com/read.php?wid=634<br />
*令Debian支援中文 http://wiki.linux.org.hk/w/Make_Debian_support_Chinese<br />
*http://www.higherorder.org/wiki/Fontconfig<br />
<br />
== '''怎么输入中文?''' ==<br />
安装相应的输入法 [[scim]] 、 [[fcitx]] 或 [[ibus]]。<br />
scim:<br />
pacman -S scim-pinyin<br />
简体中文的用户推荐:<br />
scim-pinyin 智能拼音<br />
scim-tables 五笔等基于码表的输入法<br />
繁体中文的用户推荐:<br />
scim-chewing<br />
<br />
要使用scim,还应该设置以下的环境变量(以scim为例),(可在~/.xinitrc, ~/.bashrc或~/.xprofile中设置)<br />
export XIM="SCIM"<br />
export XMODIFIERS=@im=SCIM #设置scim为xim默认输入法<br />
export GTK_IM_MODULE="scim" #设置scim为gtk程序默认的输入法<br />
export QT_IM_MODULE="scim" #设置scim为qt程序默认的输入法<br />
scim -d #使可以自动启动<br />
<br />
已知问题:<br />
*由于SCIM的ABI兼容性问题,目前可能会造成一些软件拒绝运行,这些软件包括但不限于:Acrobat Reader, 直接从mozilla.org下载的firefox, thunderbird,以及realplay。<br />
<br />
fcitx:<br />
与scim类似:<br />
pacman -S fcitx<br />
并将上述配置中的SCIM/scim 改成 FCITX/fcitx。<br />
<br />
== '''中文显示很模糊(淡),或没有中文粗体?''' ==<br />
在正常情况下,gnome本身已经转由cairo+pango来渲染字体,不存在这个问题了,但是你很可能在浏览一些网页时,还会发生这些问题。<br />
<br />
或者使用了下面的local.conf文件替换系统默认的local.conf文件。<br />
cp local.conf /etc/fonts/ <br />
或者,自行编译fontconfig2.3.92以上的版本,并打开local.conf中的autohint<br />
<br />
KDE环境:<br />
<br />
其他环境:见上。<br />
<br />
*官方新版本的mozila firefox(大于1.5.0.1)已经使用cairo+pango,但是在某些网站时会相当的慢。<br />
<br />
<br />
没有中文粗体解决方法:<br />
<br />
把下面的配置加入/etc/fonts/local.conf<br />
<pre><br />
<!--<br />
Synthetic emboldening for fonts that do not have bold face available<br />
--><br />
<br />
<match target="font"><br />
<!-- check to see if the font is just regular --><br />
<test name="weight" compare="less_eq"><br />
<const>medium</const><br />
</test><br />
<!-- check to see if the pattern requests bold --><br />
<test target="pattern" name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<!--<br />
set the embolden flag<br />
needed for applications using cairo, e.g. gucharmap, gedit, ...<br />
--><br />
<edit name="embolden" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
<!--<br />
set weight to bold<br />
needed for applications using Xft directly, e.g. Firefox, ...<br />
--><br />
<edit name="weight" mode="assign"><br />
<const>bold</const><br />
</edit><br />
</match><br />
</pre><br />
<br />
== '''如何显示影片的中文字幕?''' ==<br />
===mplayer===<br />
要使mplayer正确显示字幕,关键是要使字幕文件的编码和mplayer config里使用的编码相一致。字幕文件编码为gbk,则subcp=cp936;字幕文件编码为utf-8,则subcp=utf8。如果字幕文件编码为utf-8,而设置成subcp=cp936,则会出现部分乱码的情况。另一种更为简单的方法是设置成subcp=enca:zh:ucs-2,由enca负责字幕的编码显示问题。<br />
<br />
修改~/.mplayer/config<br />
font='文泉驿正黑'<br />
subcp=enca:zh:ucs-2<br />
<br />
可以使用下面的命令手动加载字幕<br />
mplayer xxx.avi -sub xxxxx.srt<br />
同时,你还可以设置mplayer自动加载字幕。如果你无法在gmplayer的选项中找到这个选项(天知道你会有这样粗心),直接修改~/.mplayer/gui.conf如下:<br />
sub_auto_load = "yes"<br />
sub_unicode = "yes"<br />
sub_pos = "100"<br />
sub_overlap = "no"<br />
sub_cp = "cp936"<br />
font_factor = "0.750000"<br />
font_encoding = "unicode"<br />
<br />
*mplayer cvs(2005.12以后)已经使用了gtk2的界面,但是很遗憾的是并没有完全利用gtk2良好的国际支持,甚至没有使用gtk.filechooser。<br />
*正体中文 codepage 为 cp950。<br />
<br />
===SMPlayer===<br />
SMPlayer 是一个基于QT的MPlayer前端。显示中文字幕很方便。只要在设置对话框里设定缺省字幕编码和字体即可。而且立即生效,无需重新启动程序。<br />
<br />
===xine===<br />
xine也可以显示中文字幕,但需要制作自己的中文字体。具体可以参考<br />
http://forum.ubuntu.org.cn/about2760.html<br />
<br />
===gstreamer===<br />
在totem 1.4.0,由于使用gstreamer0.10,应该是可以自动加载同名的srt字幕。<br />
<br />
== '''MP3文件在播放器中乱码''' ==<br />
对于所有用gstreamer做后端的播放器,如Rhythmbox,totem,设置如下的环境变量后即可正确读取mp3中GBK编码的id3 tag。<br />
export GST_ID3_TAG_ENCODING=GBK:UTF-8:GB18030<br />
export GST_ID3V2_TAG_ENCODING=GBK:UTF-8:GB18030<br />
<br />
对于Beep media player,可以在pefenrence->plugins->media中选中MPEG Audio plugin然后点击下方的Penfenrences,此时会出现一个对话框,选择title,将Disable ID3v2和Convert non-UTF8 ID3 tags to UTF8前的选择框选中。然后在ID3 encoding中填入 gbk。这样bmp就能正确显示GBK编码的ID3 tag。<br />
<br />
Quod Libet播放器支持tag编辑及设置id3v2编码。可以在~/.quodlibet/config中设置<br />
id3encoding = gbk<br />
注意:Quod Libet默认支持utf8编码<br />
<br />
最为彻底的解决方法为将编码为gbk的id3 tag转化为utf8编码。首先安装mutagen,然后利用下面的命令转化:<br />
mid3iconv -e gbk test.mp3<br />
<br />
== '''windows分区下的中文文件是乱码?''' ==<br />
如果使用了hal,应该是没有问题了,但是如果没有,请不妨试一下:<br />
在/etc/rc.conf中的daemon一段中添加hal。<br />
<br />
或者直接修改/etc/fstab,'''注意危险''',你如果不懂,就不要学我:-)。如果locale是utf8,挂载windows分区时应该做如下设置<br />
/dev/hdc5 / reiserfs defaults iocharset=utf8 0 0<br />
<br />
如果locale是GBK,则应该是<br />
iocharset=cp936 <br />
<br />
已知问题:<br />
<br />
=='''samba乱码'''==<br />
用Arch作为samba服务器时,在 /etc/samba/smb.conf 中加入下面一行就可以解决Windows客户端等乱码问题:<br />
unix charset=gb2312<br />
<br />
=='''ftp乱码'''==<br />
很多ftp站点是GBK编码,如果使用UTF8的locale,下载的文件名可能会乱码。对于lftp,在.lftp/rc下做如下设置<br />
set ftp:charset "gbk"<br />
set file:charset "UTF-8"<br />
对于gftp,可以在.gftp/gftprc中做如下设置即可正确显示服务器端gbk编码的文件名<br />
remote_charsets=gb2312<br />
但下载下来的文件名仍然是乱码,此时需要打补丁。补丁地址为:<br />
http://www.teatime.com.tw/%7Etommy/linux/gftp_remote_charsets.patch<br />
<br />
==JAVA界面乱码==<br />
对于java 1.5来说(同样适用于java 1.6),只要在<br />
/opt/java/jre/lib/fonts<br />
中建立fallback目录,然后链接或拷贝若干中文字体到该目录就能使java程序正确显示中文。例如,在已经安装 jre 和ttf-fireflysung 的情况下,执行下面的命令即可:<br />
ln -s /usr/share/fonts/TTF/odosung.ttc /opt/java/jre/lib/fonts/fallback/<br />
cd /opt/java/jre/lib/fonts/fallback/<br />
#以下两个命令要使用root权限<br />
mkfontdir<br />
mkfontscale<br />
<br />
<br />
如果是openjdk6 则需要复制这个文件:/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties.src 到/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties,并修改这个文件中的字体位置,因为文泉绎地址指错了。<br />
<br />
== '''Doc文件无法打开或显示不正常?''' ==<br />
安装openoffice。<br />
#pacman -Sy openoffice-base openoffice-zh-CN<br />
*如果你打算使用英文版的openoffice,你只需要安装openoffice-base包。<br />
*正体中文包 openoffice-zh_tw。<br />
*开启 amd_64 的 openoffice 时可能发生异常,此时可安装 libsndfile 进行修正。<br />
*目前,由于go-openoffice扩充了OpenOffice.org的功能(比如,完善了许多微软私有文档格式的兼容性),因此,我们推荐您使用go-openoffice。<br />
<br />
=='''正确显示中文PDF文件'''==<br />
<br />
'''Tips:''' 要正常显示所有的中文pdf(除了自定义字库外,比如文渊阁版四库全书),都需要安装poppler-data<br />
因为,linux下pdf大都以Poppler为解析PDF后端的,而Poppler已经提供了包含中文字体在内的包poppler-data,所以只要安装poppler-data,中文显示问题就可解决。 <br />
<br />
===okular===<br />
pacman -S kdegraphics-okular<br />
<br />
===arcobat===<br />
安装AUR里的acroread,并且安装相应中文包即可。<br />
<br />
=== Evince===<br />
<br />
pacman -S evince<br />
<br />
===xpdf===<br />
<br />
pacman -S xpdf-chinese-simplified<br />
<br />
===其他可用的pdf阅读器===<br />
比如foxit<br />
<br />
===另外的问题===<br />
在中国知网、万方数据库上下载的一些论文没有明确指定字体,系统选用英文字体显示它们,于是导致中文无法显示。要解决这一问题,需要修改系统的字体配置,<br />
下面的方法更加建议使用:修改/etc/fonts/conf.d/65-nonlatin.conf<br />
把里面自己想使用的字体位置提到前面就可以了。<br />
<br />
'''Tips:''' 下面的建议是以前对字体配置文件不熟悉的时候经常使用的方法,现在建议不要采纳(虽然网上绝大部分流行的教程都是这么做的)<br />
<br />
====================================================================<br />
一种比较简便的方法是直接删除/etc/fonts/conf.d/49-sansserif.conf:<br />
<br />
# rm /etc/fonts/conf.d/49-sansserif.conf<br />
<br />
建议不要这么做,也可以将/etc/fonts/conf.d/49-sansserif.conf的<br />
<br />
<edit name="family" mode="append_last"><br />
<string>sans-serif</string><br />
</edit><br />
<br />
改成<br />
<br />
<edit name="family" mode="append_last"><br />
<string>文泉驿正黑</string><br />
</edit><br />
<br />
其中“文泉驿正黑”也可被其它所安装的中文字体代替。<br />
<br />
=======================================================================<br />
<br />
==vim乱码==<br />
如果locale是utf8编码,用vim显示gbk编码的文件可能会乱码。因此需要在.virc做如下设置<br />
"Chinese GBK support<br />
set fileencodings=utf8,gbk<br />
<br />
==Latex中如何使用中文==<br />
首先需要安装CJK包,然后需要安装合适的字体。具体可以参考<br />
*http://www.ctex.org<br />
*http://www.newsmth.net 的Tex版<br />
<br />
==如何使用字典==<br />
首先请先安装stardict<br />
pacman -S stardict<br />
stardict默认是不带字典的,需要去http://stardict.sourceforge.net/ 下载字典安装。安装方法如下<br />
tar -xjvf testdict.tar.bz2<br />
mv testdict /usr/share/stardict/dic<br />
推荐使用<br />
*xdict英汉字典 <br />
*Merriam Webster 10th dictionary<br />
*牛津现代英汉双解辞典(正体中文)<br />
*朗道英汉词典(正体中文)</div>Ly50247https://wiki.archlinux.org/index.php?title=Localization_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Simplified_Chinese_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135261Localization (简体中文)/Simplified Chinese (简体中文)2011-03-29T02:49:47Z<p>Ly50247: /* 安装中文字体 */</p>
<hr />
<div>[[Category:General (简体中文)]]<br />
[[Category:简体中文]]<br />
<br />
请再仔细看看Arch的哲学"[[Arch 之道 (简体中文)|Arch 之道]]":<br />
这意味着我们不会为你配置好一切,因为“喜好和需求,每人皆不同”,但是我们会尽量确保让你自行配置时,方便和简单。事实上,甚至远比你使用一些可能的Linux中文版本容易。<br />
<br />
第一次使用Arch Linux时,用户通常会遇上这些(典型)的问题:<br />
<br />
== '''怎么显示中文的界面?''' ==<br />
要正确实现中文,必需设置正确的locale和安装合适的中文字体。<br />
<br />
===locale的设定===<br />
Linux中通过locale来设置程序运行的不同环境。一般常用的中文locale有(最直观的分别是可显示字的数量):<br />
zh_CN.GB2312<br />
zh_CN.GB18030<br />
zh_CN.UTF-8<br />
推荐使用UTF8的locale。需要注意的是,对于glibc(>=2.3.6),需要修改/etc/locale.gen文件来设定系统中可以使用的locale<br />
en_US.UTF8 UTF-8<br />
zh_CN.UTF8 UTF-8<br />
zh_CN.GBK GBK<br />
zh_CN.GB2312 GB2312<br />
zh_CN.GB18030 GB18030<br />
然后执行locale-gen命令,这样便可以在系统中使用zh_CN.UTF8,zh_CN.GBK,zh_CN.GB2312,zh_CN.GB18030,en_US.UTF8等locale。可以通过locale命令来查看当前使用的locale<br />
locale<br />
可以通过locale命令来查看目前可以使用的locale<br />
locale -a<br />
<br />
Archlinux中,通过rc.conf文件可以设置全局有效的locale:<br />
LOCALE=en_US.UTF-8<br />
<br />
对于个人用户,还可以在.bashrc或.xprofile中设置自己的用户环境,不同之处在于:<br />
*.bashrc: 每次'''终端登录时'''读取并运用里面的设置。<br />
*.xinitrc: 每次'''startx启动X界面时'''读取并运用里面的设置<br />
*.xprofile: 每次'''使用gdm等图形登录时'''读取并运用里面的设置<br />
<br />
在终端(文字)界面下也可以显示和输入中文,但需要安装cce、zhcon或fbterm。<br />
<br />
===安装中文字体===<br />
除了设置好locale,你还需要安装中文字体:<br />
pacman -S wqy-zenhei<br />
<br />
常用的免费(GPL或兼容版权)中文字体有<br />
wqy-bitmapfont<br />
wqy-zenhei<br />
wqy-microhei (AUR中)<br />
wqy-microhei-lite(AUR中)<br />
ttf-arphic-ukai<br />
ttf-arphic-uming<br />
ttf-fireflysung<br />
<br />
<br />
系统字体将默认安装到/usr/share/fonts,如果你没有root权限或者只打算自己使用某些字体,你可以直接复制这些字体到~/.fonts(或者其他)目录下面,并把该路径加入/etc/fonts/local.conf中,参见后面章节。<br />
<br />
参考网点:<br />
*http://wiki.debian.org.hk/w/Where_can_I_find_fonts_for_GNU/Linux<br />
<br />
==fontconfig设置==<br />
安装好字体以后,你可能对中文字体的显示不太满意。这时需要对fontconfig做某些设置。你可以在~/.fonts.conf中设定,也可以在/etc/fonts/conf.d中设定。<br />
<br />
===重排字型的显示顺序===<br />
Serifs字型<br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Bitstream Vera Serif</family><br />
<family>Times New Roman</family><br />
<family>Nimbus Roman No9 L</family><br />
<family>Luxi Serif</family><br />
<family>Times</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
Sans字型<br />
<alias><br />
<family>sans-serif</family><br />
<prefer><br />
<family>Bitstream Vera Sans</family><br />
<family>Verdana</family><br />
<family>Arial</family><br />
<family>Tahoma</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Helvetica</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Gothic</family><br />
<family>Baekmuk Dotum</family><br />
</prefer><br />
</alias><br />
Mononspace字型 <br />
<alias><br />
<family>monospace</family><br />
<prefer><br />
<family>Bitstream Vera Sans Mono</family><br />
<family>Courier</family><br />
<family>Courier New</family><br />
<family>Andale Mono</family><br />
<family>Luxi Mono</family><br />
<family>Nimbus Mono L</family><br />
<family>WenQuanYi Bitmap Song</family><br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
<br />
===关闭小号字体的AA(反锯齿)===<br />
对于比较小的字体,关闭小号字体的反锯齿,会更加清晰。<br />
<match target="font" ><br />
<test compare="eq" name="family" qual="any" ><br />
<string>AR PL New Sung</string><br />
<string>AR PL ShanHeiSun Uni</string><br />
<string>AR PL ZenKai Uni</string><br />
<string>AR PL Mingti2L Big5</string><br />
<string>AR PL SungtiL Big5</string><br />
<string>MingLiu</string><br />
<string>PMingLiu</string><br />
</test><br />
<test compare="more_eq" name="pixelsize" ><br />
<double>8</double><br />
</test><br />
<test compare="less_eq" name="pixelsize" ><br />
<double>15</double><br />
</test><br />
<edit name="antialias" ><br />
<bool>false</bool><br />
</edit><br />
<edit name="hinting" ><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
'''Tips:'''可以到这里得到更详细的[[字体设置]]文档和完整的[[中文字体配置范例]]<br />
<br />
'''参考文档'''<br />
*Fontconfig用户手册 http://www.chinalinuxpub.com/read.php?wid=634<br />
*令Debian支援中文 http://wiki.linux.org.hk/w/Make_Debian_support_Chinese<br />
*http://www.higherorder.org/wiki/Fontconfig<br />
<br />
== '''怎么输入中文?''' ==<br />
安装相应的输入法 [[scim]] 或者 [[fcitx]]。推荐使用scim:<br />
pacman -S scim-pinyin<br />
简体中文的用户推荐:<br />
scim-pinyin 智能拼音<br />
scim-tables 五笔<br />
繁体中文的用户推荐:<br />
scim-chewing<br />
<br />
要使用scim,还应该设置以下的环境变量(以scim为例),(可在xinitrc, .bashrc或.xprofile中设置)<br />
export XIM="SCIM"<br />
export XMODIFIERS=@im=SCIM #设置scim为xim默认输入法<br />
export GTK_IM_MODULE="scim" #设置scim为gtk程序默认的输入法<br />
export QT_IM_MODULE="scim" #设置scim为qt程序默认的输入法<br />
scim -d #使可以自动启动<br />
<br />
已知问题:<br />
*由于SCIM的ABI兼容性问题,目前可能会造成一些软件拒绝运行,这些软件包括但不限于:Acrobat Reader, 直接从mozilla.org下载的firefox, thunderbird,以及realplay。权宜之计: 在程序的启动文件头输入:<br />
<br />
'''Tip''':为什么推荐使用SCIM?<br />
*因为到目前为止,SCIM是惟一的“傻瓜式”输入法(感谢作者付出的很多努力,最终让我们打包和维护相当的轻松,而且对于用户来说,也基本不需要什么设置)。<br />
<br />
== '''中文显示很模糊(淡),或没有中文粗体?''' ==<br />
在正常情况下,gnome本身已经转由cairo+pango来渲染字体,不存在这个问题了,但是你很可能在浏览一些网页时,还会发生这些问题。<br />
<br />
或者使用了下面的local.conf文件替换系统默认的local.conf文件。<br />
cp local.conf /etc/fonts/ <br />
或者,自行编译fontconfig2.3.92以上的版本,并打开local.conf中的autohint<br />
<br />
KDE环境:<br />
<br />
其他环境:见上。<br />
<br />
*官方新版本的mozila firefox(大于1.5.0.1)已经使用cairo+pango,但是在某些网站时会相当的慢。<br />
<br />
<br />
没有中文粗体解决方法:<br />
<br />
把下面的配置加入/etc/fonts/local.conf<br />
<pre><br />
<!--<br />
Synthetic emboldening for fonts that do not have bold face available<br />
--><br />
<br />
<match target="font"><br />
<!-- check to see if the font is just regular --><br />
<test name="weight" compare="less_eq"><br />
<const>medium</const><br />
</test><br />
<!-- check to see if the pattern requests bold --><br />
<test target="pattern" name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<!--<br />
set the embolden flag<br />
needed for applications using cairo, e.g. gucharmap, gedit, ...<br />
--><br />
<edit name="embolden" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
<!--<br />
set weight to bold<br />
needed for applications using Xft directly, e.g. Firefox, ...<br />
--><br />
<edit name="weight" mode="assign"><br />
<const>bold</const><br />
</edit><br />
</match><br />
</pre><br />
<br />
== '''如何显示影片的中文字幕?''' ==<br />
===mplayer===<br />
要使mplayer正确显示字幕,关键是要使字幕文件的编码和mplayer config里使用的编码相一致。字幕文件编码为gbk,则subcp=cp936;字幕文件编码为utf-8,则subcp=utf8。如果字幕文件编码为utf-8,而设置成subcp=cp936,则会出现部分乱码的情况。另一种更为简单的方法是设置成subcp=enca:zh:ucs-2,由enca负责字幕的编码显示问题。<br />
<br />
修改~/.mplayer/config<br />
font='文泉驿正黑'<br />
subcp=enca:zh:ucs-2<br />
<br />
可以使用下面的命令手动加载字幕<br />
mplayer xxx.avi -sub xxxxx.srt<br />
同时,你还可以设置mplayer自动加载字幕。如果你无法在gmplayer的选项中找到这个选项(天知道你会有这样粗心),直接修改~/.mplayer/gui.conf如下:<br />
sub_auto_load = "yes"<br />
sub_unicode = "yes"<br />
sub_pos = "100"<br />
sub_overlap = "no"<br />
sub_cp = "cp936"<br />
font_factor = "0.750000"<br />
font_encoding = "unicode"<br />
<br />
*mplayer cvs(2005.12以后)已经使用了gtk2的界面,但是很遗憾的是并没有完全利用gtk2良好的国际支持,甚至没有使用gtk.filechooser。<br />
*正体中文 codepage 为 cp950。<br />
<br />
===SMPlayer===<br />
SMPlayer 是一个基于QT的MPlayer前端。显示中文字幕很方便。只要在设置对话框里设定缺省字幕编码和字体即可。而且立即生效,无需重新启动程序。<br />
<br />
===xine===<br />
xine也可以显示中文字幕,但需要制作自己的中文字体。具体可以参考<br />
http://forum.ubuntu.org.cn/about2760.html<br />
<br />
===gstreamer===<br />
在totem 1.4.0,由于使用gstreamer0.10,应该是可以自动加载同名的srt字幕。<br />
<br />
== '''MP3文件在播放器中乱码''' ==<br />
对于所有用gstreamer做后端的播放器,如Rhythmbox,totem,设置如下的环境变量后即可正确读取mp3中GBK编码的id3 tag。<br />
export GST_ID3_TAG_ENCODING=GBK:UTF-8:GB18030<br />
export GST_ID3V2_TAG_ENCODING=GBK:UTF-8:GB18030<br />
<br />
对于Beep media player,可以在pefenrence->plugins->media中选中MPEG Audio plugin然后点击下方的Penfenrences,此时会出现一个对话框,选择title,将Disable ID3v2和Convert non-UTF8 ID3 tags to UTF8前的选择框选中。然后在ID3 encoding中填入 gbk。这样bmp就能正确显示GBK编码的ID3 tag。<br />
<br />
Quod Libet播放器支持tag编辑及设置id3v2编码。可以在~/.quodlibet/config中设置<br />
id3encoding = gbk<br />
注意:Quod Libet默认支持utf8编码<br />
<br />
最为彻底的解决方法为将编码为gbk的id3 tag转化为utf8编码。首先安装mutagen,然后利用下面的命令转化:<br />
mid3iconv -e gbk test.mp3<br />
<br />
== '''windows分区下的中文文件是乱码?''' ==<br />
如果使用了hal,应该是没有问题了,但是如果没有,请不妨试一下:<br />
在/etc/rc.conf中的daemon一段中添加hal。<br />
<br />
或者直接修改/etc/fstab,'''注意危险''',你如果不懂,就不要学我:-)。如果locale是utf8,挂载windows分区时应该做如下设置<br />
/dev/hdc5 / reiserfs defaults iocharset=utf8 0 0<br />
<br />
如果locale是GBK,则应该是<br />
iocharset=cp936 <br />
<br />
已知问题:<br />
<br />
=='''samba乱码'''==<br />
用Arch作为samba服务器时,在 /etc/samba/smb.conf 中加入下面一行就可以解决Windows客户端等乱码问题:<br />
unix charset=gb2312<br />
<br />
=='''ftp乱码'''==<br />
很多ftp站点是GBK编码,如果使用UTF8的locale,下载的文件名可能会乱码。对于lftp,在.lftp/rc下做如下设置<br />
set ftp:charset "gbk"<br />
set file:charset "UTF-8"<br />
对于gftp,可以在.gftp/gftprc中做如下设置即可正确显示服务器端gbk编码的文件名<br />
remote_charsets=gb2312<br />
但下载下来的文件名仍然是乱码,此时需要打补丁。补丁地址为:<br />
http://www.teatime.com.tw/%7Etommy/linux/gftp_remote_charsets.patch<br />
<br />
==JAVA界面乱码==<br />
对于java 1.5来说(同样适用于java 1.6),只要在<br />
/opt/java/jre/lib/fonts<br />
中建立fallback目录,然后链接或拷贝若干中文字体到该目录就能使java程序正确显示中文。例如,在已经安装 jre 和ttf-fireflysung 的情况下,执行下面的命令即可:<br />
ln -s /usr/share/fonts/TTF/odosung.ttc /opt/java/jre/lib/fonts/fallback/<br />
cd /opt/java/jre/lib/fonts/fallback/<br />
#以下两个命令要使用root权限<br />
mkfontdir<br />
mkfontscale<br />
<br />
<br />
如果是openjdk6 则需要复制这个文件:/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties.src 到/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties,并修改这个文件中的字体位置,因为文泉绎地址指错了。<br />
<br />
== '''Doc文件无法打开或显示不正常?''' ==<br />
安装openoffice。<br />
#pacman -Sy openoffice-base openoffice-zh-CN<br />
*如果你打算使用英文版的openoffice,你只需要安装openoffice-base包。<br />
*正体中文包 openoffice-zh_tw。<br />
*开启 amd_64 的 openoffice 时可能发生异常,此时可安装 libsndfile 进行修正。<br />
*目前,由于go-openoffice扩充了OpenOffice.org的功能(比如,完善了许多微软私有文档格式的兼容性),因此,我们推荐您使用go-openoffice。<br />
<br />
=='''正确显示中文PDF文件'''==<br />
<br />
'''Tips:''' 要正常显示所有的中文pdf(除了自定义字库外,比如文渊阁版四库全书),都需要安装poppler-data<br />
因为,linux下pdf大都以Poppler为解析PDF后端的,而Poppler已经提供了包含中文字体在内的包poppler-data,所以只要安装poppler-data,中文显示问题就可解决。 <br />
<br />
===okular===<br />
pacman -S kdegraphics-okular<br />
<br />
===arcobat===<br />
安装AUR里的acroread,并且安装相应中文包即可。<br />
<br />
=== Evince===<br />
<br />
pacman -S evince<br />
<br />
===xpdf===<br />
<br />
pacman -S xpdf-chinese-simplified<br />
<br />
===其他可用的pdf阅读器===<br />
比如foxit<br />
<br />
===另外的问题===<br />
在中国知网、万方数据库上下载的一些论文没有明确指定字体,系统选用英文字体显示它们,于是导致中文无法显示。要解决这一问题,需要修改系统的字体配置,<br />
下面的方法更加建议使用:修改/etc/fonts/conf.d/65-nonlatin.conf<br />
把里面自己想使用的字体位置提到前面就可以了。<br />
<br />
'''Tips:''' 下面的建议是以前对字体配置文件不熟悉的时候经常使用的方法,现在建议不要采纳(虽然网上绝大部分流行的教程都是这么做的)<br />
<br />
====================================================================<br />
一种比较简便的方法是直接删除/etc/fonts/conf.d/49-sansserif.conf:<br />
<br />
# rm /etc/fonts/conf.d/49-sansserif.conf<br />
<br />
建议不要这么做,也可以将/etc/fonts/conf.d/49-sansserif.conf的<br />
<br />
<edit name="family" mode="append_last"><br />
<string>sans-serif</string><br />
</edit><br />
<br />
改成<br />
<br />
<edit name="family" mode="append_last"><br />
<string>文泉驿正黑</string><br />
</edit><br />
<br />
其中“文泉驿正黑”也可被其它所安装的中文字体代替。<br />
<br />
=======================================================================<br />
<br />
==vim乱码==<br />
如果locale是utf8编码,用vim显示gbk编码的文件可能会乱码。因此需要在.virc做如下设置<br />
"Chinese GBK support<br />
set fileencodings=utf8,gbk<br />
<br />
==Latex中如何使用中文==<br />
首先需要安装CJK包,然后需要安装合适的字体。具体可以参考<br />
*http://www.ctex.org<br />
*http://www.newsmth.net 的Tex版<br />
<br />
==如何使用字典==<br />
首先请先安装stardict<br />
pacman -S stardict<br />
stardict默认是不带字典的,需要去http://stardict.sourceforge.net/ 下载字典安装。安装方法如下<br />
tar -xjvf testdict.tar.bz2<br />
mv testdict /usr/share/stardict/dic<br />
推荐使用<br />
*xdict英汉字典 <br />
*Merriam Webster 10th dictionary<br />
*牛津现代英汉双解辞典(正体中文)<br />
*朗道英汉词典(正体中文)</div>Ly50247https://wiki.archlinux.org/index.php?title=Localization_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Simplified_Chinese_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135260Localization (简体中文)/Simplified Chinese (简体中文)2011-03-29T02:47:53Z<p>Ly50247: /* locale的设定 */</p>
<hr />
<div>[[Category:General (简体中文)]]<br />
[[Category:简体中文]]<br />
<br />
请再仔细看看Arch的哲学"[[Arch 之道 (简体中文)|Arch 之道]]":<br />
这意味着我们不会为你配置好一切,因为“喜好和需求,每人皆不同”,但是我们会尽量确保让你自行配置时,方便和简单。事实上,甚至远比你使用一些可能的Linux中文版本容易。<br />
<br />
第一次使用Arch Linux时,用户通常会遇上这些(典型)的问题:<br />
<br />
== '''怎么显示中文的界面?''' ==<br />
要正确实现中文,必需设置正确的locale和安装合适的中文字体。<br />
<br />
===locale的设定===<br />
Linux中通过locale来设置程序运行的不同环境。一般常用的中文locale有(最直观的分别是可显示字的数量):<br />
zh_CN.GB2312<br />
zh_CN.GB18030<br />
zh_CN.UTF-8<br />
推荐使用UTF8的locale。需要注意的是,对于glibc(>=2.3.6),需要修改/etc/locale.gen文件来设定系统中可以使用的locale<br />
en_US.UTF8 UTF-8<br />
zh_CN.UTF8 UTF-8<br />
zh_CN.GBK GBK<br />
zh_CN.GB2312 GB2312<br />
zh_CN.GB18030 GB18030<br />
然后执行locale-gen命令,这样便可以在系统中使用zh_CN.UTF8,zh_CN.GBK,zh_CN.GB2312,zh_CN.GB18030,en_US.UTF8等locale。可以通过locale命令来查看当前使用的locale<br />
locale<br />
可以通过locale命令来查看目前可以使用的locale<br />
locale -a<br />
<br />
Archlinux中,通过rc.conf文件可以设置全局有效的locale:<br />
LOCALE=en_US.UTF-8<br />
<br />
对于个人用户,还可以在.bashrc或.xprofile中设置自己的用户环境,不同之处在于:<br />
*.bashrc: 每次'''终端登录时'''读取并运用里面的设置。<br />
*.xinitrc: 每次'''startx启动X界面时'''读取并运用里面的设置<br />
*.xprofile: 每次'''使用gdm等图形登录时'''读取并运用里面的设置<br />
<br />
在终端(文字)界面下也可以显示和输入中文,但需要安装cce、zhcon或fbterm。<br />
<br />
===安装中文字体===<br />
除了设置好locale,你还需要安装中文字体:<br />
pacman -S wqy-zenhei<br />
<br />
常用的免费(GPL或兼容版权)中文字体有<br />
wqy-bitmapfont<br />
wqy-zenhei<br />
wqy-microhei (AUR中)<br />
wqy-microhei-lite(AUR中)<br />
ttf-arphic-ukai<br />
ttf-arphic-uming<br />
ttf-fireflysung<br />
<br />
<br />
系统字体将默认安装到/usr/share/fonts,如果你没有root权限或者只打算自己使用某些字体,你可以直接复制这些字体到.fonts(或者其他)目录下面,并把该路径加入/etc/fonts/local.conf中,参见后面章节。<br />
<br />
参考网点:<br />
*http://wiki.debian.org.hk/w/Where_can_I_find_fonts_for_GNU/Linux<br />
<br />
==fontconfig设置==<br />
安装好字体以后,你可能对中文字体的显示不太满意。这时需要对fontconfig做某些设置。你可以在~/.fonts.conf中设定,也可以在/etc/fonts/conf.d中设定。<br />
<br />
===重排字型的显示顺序===<br />
Serifs字型<br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Bitstream Vera Serif</family><br />
<family>Times New Roman</family><br />
<family>Nimbus Roman No9 L</family><br />
<family>Luxi Serif</family><br />
<family>Times</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
Sans字型<br />
<alias><br />
<family>sans-serif</family><br />
<prefer><br />
<family>Bitstream Vera Sans</family><br />
<family>Verdana</family><br />
<family>Arial</family><br />
<family>Tahoma</family><br />
<family>WenQuanYi Bitmap Song</family> <br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Helvetica</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Gothic</family><br />
<family>Baekmuk Dotum</family><br />
</prefer><br />
</alias><br />
Mononspace字型 <br />
<alias><br />
<family>monospace</family><br />
<prefer><br />
<family>Bitstream Vera Sans Mono</family><br />
<family>Courier</family><br />
<family>Courier New</family><br />
<family>Andale Mono</family><br />
<family>Luxi Mono</family><br />
<family>Nimbus Mono L</family><br />
<family>WenQuanYi Bitmap Song</family><br />
<family>AR PL ShanHeiSun Uni</family><br />
<family>AR PL New Sung</family><br />
<family>AR PL ZenKai Uni</family><br />
<family>Ming(ISO10646)</family><br />
<family>Kochi Mincho</family><br />
<family>Baekmuk Batung</family><br />
</prefer><br />
</alias><br />
<br />
===关闭小号字体的AA(反锯齿)===<br />
对于比较小的字体,关闭小号字体的反锯齿,会更加清晰。<br />
<match target="font" ><br />
<test compare="eq" name="family" qual="any" ><br />
<string>AR PL New Sung</string><br />
<string>AR PL ShanHeiSun Uni</string><br />
<string>AR PL ZenKai Uni</string><br />
<string>AR PL Mingti2L Big5</string><br />
<string>AR PL SungtiL Big5</string><br />
<string>MingLiu</string><br />
<string>PMingLiu</string><br />
</test><br />
<test compare="more_eq" name="pixelsize" ><br />
<double>8</double><br />
</test><br />
<test compare="less_eq" name="pixelsize" ><br />
<double>15</double><br />
</test><br />
<edit name="antialias" ><br />
<bool>false</bool><br />
</edit><br />
<edit name="hinting" ><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
'''Tips:'''可以到这里得到更详细的[[字体设置]]文档和完整的[[中文字体配置范例]]<br />
<br />
'''参考文档'''<br />
*Fontconfig用户手册 http://www.chinalinuxpub.com/read.php?wid=634<br />
*令Debian支援中文 http://wiki.linux.org.hk/w/Make_Debian_support_Chinese<br />
*http://www.higherorder.org/wiki/Fontconfig<br />
<br />
== '''怎么输入中文?''' ==<br />
安装相应的输入法 [[scim]] 或者 [[fcitx]]。推荐使用scim:<br />
pacman -S scim-pinyin<br />
简体中文的用户推荐:<br />
scim-pinyin 智能拼音<br />
scim-tables 五笔<br />
繁体中文的用户推荐:<br />
scim-chewing<br />
<br />
要使用scim,还应该设置以下的环境变量(以scim为例),(可在xinitrc, .bashrc或.xprofile中设置)<br />
export XIM="SCIM"<br />
export XMODIFIERS=@im=SCIM #设置scim为xim默认输入法<br />
export GTK_IM_MODULE="scim" #设置scim为gtk程序默认的输入法<br />
export QT_IM_MODULE="scim" #设置scim为qt程序默认的输入法<br />
scim -d #使可以自动启动<br />
<br />
已知问题:<br />
*由于SCIM的ABI兼容性问题,目前可能会造成一些软件拒绝运行,这些软件包括但不限于:Acrobat Reader, 直接从mozilla.org下载的firefox, thunderbird,以及realplay。权宜之计: 在程序的启动文件头输入:<br />
<br />
'''Tip''':为什么推荐使用SCIM?<br />
*因为到目前为止,SCIM是惟一的“傻瓜式”输入法(感谢作者付出的很多努力,最终让我们打包和维护相当的轻松,而且对于用户来说,也基本不需要什么设置)。<br />
<br />
== '''中文显示很模糊(淡),或没有中文粗体?''' ==<br />
在正常情况下,gnome本身已经转由cairo+pango来渲染字体,不存在这个问题了,但是你很可能在浏览一些网页时,还会发生这些问题。<br />
<br />
或者使用了下面的local.conf文件替换系统默认的local.conf文件。<br />
cp local.conf /etc/fonts/ <br />
或者,自行编译fontconfig2.3.92以上的版本,并打开local.conf中的autohint<br />
<br />
KDE环境:<br />
<br />
其他环境:见上。<br />
<br />
*官方新版本的mozila firefox(大于1.5.0.1)已经使用cairo+pango,但是在某些网站时会相当的慢。<br />
<br />
<br />
没有中文粗体解决方法:<br />
<br />
把下面的配置加入/etc/fonts/local.conf<br />
<pre><br />
<!--<br />
Synthetic emboldening for fonts that do not have bold face available<br />
--><br />
<br />
<match target="font"><br />
<!-- check to see if the font is just regular --><br />
<test name="weight" compare="less_eq"><br />
<const>medium</const><br />
</test><br />
<!-- check to see if the pattern requests bold --><br />
<test target="pattern" name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<!--<br />
set the embolden flag<br />
needed for applications using cairo, e.g. gucharmap, gedit, ...<br />
--><br />
<edit name="embolden" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
<!--<br />
set weight to bold<br />
needed for applications using Xft directly, e.g. Firefox, ...<br />
--><br />
<edit name="weight" mode="assign"><br />
<const>bold</const><br />
</edit><br />
</match><br />
</pre><br />
<br />
== '''如何显示影片的中文字幕?''' ==<br />
===mplayer===<br />
要使mplayer正确显示字幕,关键是要使字幕文件的编码和mplayer config里使用的编码相一致。字幕文件编码为gbk,则subcp=cp936;字幕文件编码为utf-8,则subcp=utf8。如果字幕文件编码为utf-8,而设置成subcp=cp936,则会出现部分乱码的情况。另一种更为简单的方法是设置成subcp=enca:zh:ucs-2,由enca负责字幕的编码显示问题。<br />
<br />
修改~/.mplayer/config<br />
font='文泉驿正黑'<br />
subcp=enca:zh:ucs-2<br />
<br />
可以使用下面的命令手动加载字幕<br />
mplayer xxx.avi -sub xxxxx.srt<br />
同时,你还可以设置mplayer自动加载字幕。如果你无法在gmplayer的选项中找到这个选项(天知道你会有这样粗心),直接修改~/.mplayer/gui.conf如下:<br />
sub_auto_load = "yes"<br />
sub_unicode = "yes"<br />
sub_pos = "100"<br />
sub_overlap = "no"<br />
sub_cp = "cp936"<br />
font_factor = "0.750000"<br />
font_encoding = "unicode"<br />
<br />
*mplayer cvs(2005.12以后)已经使用了gtk2的界面,但是很遗憾的是并没有完全利用gtk2良好的国际支持,甚至没有使用gtk.filechooser。<br />
*正体中文 codepage 为 cp950。<br />
<br />
===SMPlayer===<br />
SMPlayer 是一个基于QT的MPlayer前端。显示中文字幕很方便。只要在设置对话框里设定缺省字幕编码和字体即可。而且立即生效,无需重新启动程序。<br />
<br />
===xine===<br />
xine也可以显示中文字幕,但需要制作自己的中文字体。具体可以参考<br />
http://forum.ubuntu.org.cn/about2760.html<br />
<br />
===gstreamer===<br />
在totem 1.4.0,由于使用gstreamer0.10,应该是可以自动加载同名的srt字幕。<br />
<br />
== '''MP3文件在播放器中乱码''' ==<br />
对于所有用gstreamer做后端的播放器,如Rhythmbox,totem,设置如下的环境变量后即可正确读取mp3中GBK编码的id3 tag。<br />
export GST_ID3_TAG_ENCODING=GBK:UTF-8:GB18030<br />
export GST_ID3V2_TAG_ENCODING=GBK:UTF-8:GB18030<br />
<br />
对于Beep media player,可以在pefenrence->plugins->media中选中MPEG Audio plugin然后点击下方的Penfenrences,此时会出现一个对话框,选择title,将Disable ID3v2和Convert non-UTF8 ID3 tags to UTF8前的选择框选中。然后在ID3 encoding中填入 gbk。这样bmp就能正确显示GBK编码的ID3 tag。<br />
<br />
Quod Libet播放器支持tag编辑及设置id3v2编码。可以在~/.quodlibet/config中设置<br />
id3encoding = gbk<br />
注意:Quod Libet默认支持utf8编码<br />
<br />
最为彻底的解决方法为将编码为gbk的id3 tag转化为utf8编码。首先安装mutagen,然后利用下面的命令转化:<br />
mid3iconv -e gbk test.mp3<br />
<br />
== '''windows分区下的中文文件是乱码?''' ==<br />
如果使用了hal,应该是没有问题了,但是如果没有,请不妨试一下:<br />
在/etc/rc.conf中的daemon一段中添加hal。<br />
<br />
或者直接修改/etc/fstab,'''注意危险''',你如果不懂,就不要学我:-)。如果locale是utf8,挂载windows分区时应该做如下设置<br />
/dev/hdc5 / reiserfs defaults iocharset=utf8 0 0<br />
<br />
如果locale是GBK,则应该是<br />
iocharset=cp936 <br />
<br />
已知问题:<br />
<br />
=='''samba乱码'''==<br />
用Arch作为samba服务器时,在 /etc/samba/smb.conf 中加入下面一行就可以解决Windows客户端等乱码问题:<br />
unix charset=gb2312<br />
<br />
=='''ftp乱码'''==<br />
很多ftp站点是GBK编码,如果使用UTF8的locale,下载的文件名可能会乱码。对于lftp,在.lftp/rc下做如下设置<br />
set ftp:charset "gbk"<br />
set file:charset "UTF-8"<br />
对于gftp,可以在.gftp/gftprc中做如下设置即可正确显示服务器端gbk编码的文件名<br />
remote_charsets=gb2312<br />
但下载下来的文件名仍然是乱码,此时需要打补丁。补丁地址为:<br />
http://www.teatime.com.tw/%7Etommy/linux/gftp_remote_charsets.patch<br />
<br />
==JAVA界面乱码==<br />
对于java 1.5来说(同样适用于java 1.6),只要在<br />
/opt/java/jre/lib/fonts<br />
中建立fallback目录,然后链接或拷贝若干中文字体到该目录就能使java程序正确显示中文。例如,在已经安装 jre 和ttf-fireflysung 的情况下,执行下面的命令即可:<br />
ln -s /usr/share/fonts/TTF/odosung.ttc /opt/java/jre/lib/fonts/fallback/<br />
cd /opt/java/jre/lib/fonts/fallback/<br />
#以下两个命令要使用root权限<br />
mkfontdir<br />
mkfontscale<br />
<br />
<br />
如果是openjdk6 则需要复制这个文件:/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties.src 到/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties,并修改这个文件中的字体位置,因为文泉绎地址指错了。<br />
<br />
== '''Doc文件无法打开或显示不正常?''' ==<br />
安装openoffice。<br />
#pacman -Sy openoffice-base openoffice-zh-CN<br />
*如果你打算使用英文版的openoffice,你只需要安装openoffice-base包。<br />
*正体中文包 openoffice-zh_tw。<br />
*开启 amd_64 的 openoffice 时可能发生异常,此时可安装 libsndfile 进行修正。<br />
*目前,由于go-openoffice扩充了OpenOffice.org的功能(比如,完善了许多微软私有文档格式的兼容性),因此,我们推荐您使用go-openoffice。<br />
<br />
=='''正确显示中文PDF文件'''==<br />
<br />
'''Tips:''' 要正常显示所有的中文pdf(除了自定义字库外,比如文渊阁版四库全书),都需要安装poppler-data<br />
因为,linux下pdf大都以Poppler为解析PDF后端的,而Poppler已经提供了包含中文字体在内的包poppler-data,所以只要安装poppler-data,中文显示问题就可解决。 <br />
<br />
===okular===<br />
pacman -S kdegraphics-okular<br />
<br />
===arcobat===<br />
安装AUR里的acroread,并且安装相应中文包即可。<br />
<br />
=== Evince===<br />
<br />
pacman -S evince<br />
<br />
===xpdf===<br />
<br />
pacman -S xpdf-chinese-simplified<br />
<br />
===其他可用的pdf阅读器===<br />
比如foxit<br />
<br />
===另外的问题===<br />
在中国知网、万方数据库上下载的一些论文没有明确指定字体,系统选用英文字体显示它们,于是导致中文无法显示。要解决这一问题,需要修改系统的字体配置,<br />
下面的方法更加建议使用:修改/etc/fonts/conf.d/65-nonlatin.conf<br />
把里面自己想使用的字体位置提到前面就可以了。<br />
<br />
'''Tips:''' 下面的建议是以前对字体配置文件不熟悉的时候经常使用的方法,现在建议不要采纳(虽然网上绝大部分流行的教程都是这么做的)<br />
<br />
====================================================================<br />
一种比较简便的方法是直接删除/etc/fonts/conf.d/49-sansserif.conf:<br />
<br />
# rm /etc/fonts/conf.d/49-sansserif.conf<br />
<br />
建议不要这么做,也可以将/etc/fonts/conf.d/49-sansserif.conf的<br />
<br />
<edit name="family" mode="append_last"><br />
<string>sans-serif</string><br />
</edit><br />
<br />
改成<br />
<br />
<edit name="family" mode="append_last"><br />
<string>文泉驿正黑</string><br />
</edit><br />
<br />
其中“文泉驿正黑”也可被其它所安装的中文字体代替。<br />
<br />
=======================================================================<br />
<br />
==vim乱码==<br />
如果locale是utf8编码,用vim显示gbk编码的文件可能会乱码。因此需要在.virc做如下设置<br />
"Chinese GBK support<br />
set fileencodings=utf8,gbk<br />
<br />
==Latex中如何使用中文==<br />
首先需要安装CJK包,然后需要安装合适的字体。具体可以参考<br />
*http://www.ctex.org<br />
*http://www.newsmth.net 的Tex版<br />
<br />
==如何使用字典==<br />
首先请先安装stardict<br />
pacman -S stardict<br />
stardict默认是不带字典的,需要去http://stardict.sourceforge.net/ 下载字典安装。安装方法如下<br />
tar -xjvf testdict.tar.bz2<br />
mv testdict /usr/share/stardict/dic<br />
推荐使用<br />
*xdict英汉字典 <br />
*Merriam Webster 10th dictionary<br />
*牛津现代英汉双解辞典(正体中文)<br />
*朗道英汉词典(正体中文)</div>Ly50247https://wiki.archlinux.org/index.php?title=Frequently_asked_questions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135205Frequently asked questions (简体中文)2011-03-28T14:48:33Z<p>Ly50247: /* Q) Arch 需要一个商业实体来支持 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:FAQs (简体中文)]]<br />
{{i18n|FAQ}}<br />
<br />
请首先阅读[[The Arch Way]] 、 [[Arch Linux]] 和 [[Devland|开发者天地]] 。这三个地方包含有大量关于 Arch Linux 的相关信息。<br />
<br />
==Q) 我是一个彻头彻尾的 Linux 新手,我应该用 Arch 吗?==<br />
'''A)''' 这个问题有诸多争议。Arch 的目标用户是比较熟悉 Linux 的用户,但是一些人也认为"Arch 是一个很好的开始”。如果你是一名新手,并打算使用 Arch, 仅仅提醒你,你必须是愿意学习的。在开始问任何问题之前,自己先通过google、Wiki或者论坛进行搜索(以及阅读过去的常见问题集)。如果你这样做了,就没什么可说的。你也应该知道很多人不想一遍又一遍的回答同样的基础问题,所以在那种情况下你很可能碰一鼻子灰。 这是为什么我们为你创建了这些资源并让你可以随时访问。你应当参考 [[Beginners Guide]] <br />
<br />
----<br />
<br />
==Q) 我发现X软件包有一个错误,我应该做什么?==<br />
'''A)''' 首先你需要搞清楚Arch队伍是否能够解决这个错误。有时并非如此(Firefox崩溃也许是Mozilla开发团队的错误) - 这便是所谓的“上游错误” 。 如果确实是Arch的问题,你可以采取以下步骤:<br />
#在论坛中搜索有关信息。看是否有人已经注意到过。<br />
#提醒软件包的维护者。试着使用 "pacman -Qi <软件包名>" 参看信息。<br />
#提交 bug 报告,并在 http://bugs.archlinux.org 上包含详细的信息。 <br />
#如果你喜欢,也可在论坛中贴篇帖子。问题细节和你已经报告过。这会帮助其他人避免重复报告同样的问题。<br />
----<br />
<br />
==Q) pacman会使用数据库吗?==<br />
'''A)''' pacman至少在一定时间内不会使用 sqlite、Berkeley DB 之类的数据库,因为这与 Arch 的原则相背。但目前正在用压缩包来取代众多分散小文件中以提升效率。<br />
<br />
==Q) Pacman太慢了!怎样才能加快它初始化启动速度呢?==<br />
'''A)''' 目前由于/var/lib/pacman/sync目录已经用单独的db(实为tgz格式)文件取代了之前的分散文件,所以速度有了明显的提高。而/var/lib/pacman/local目录下文件将会在之后时间改变成可行的格式(因为其下文件要读写,情况要复杂些),以提高效率。另外,当你感觉pacman运行缓慢时可以运行<tt>pacman-optimize</tt>看是否有所好转。<br />
如果对速度仍然不满意,可以为/var/lib/pacman单独分区(建议reiserfs格式),或者将其挂在一个loop文件上。<br />
<br />
==Q) Arch软件包需要用一个独特的命名方式。.pkg.tar.xz太长了,而且,令人困惑==<br />
'''A)''' 在Arch邮件列表曾有过讨论。一些用户提议.pac作为文件扩展名。但就目前所知而言,没有计划改变软件包的扩展名。<br />
正如Tobias Kieslich(Arch开发者一员)所说, "一个软件包 '''就是''' 一个压缩包!它可以被很多软件打开、研究和操作。此外,这种 mime-type 也可以被大多数软件自动的正确识别。"<br />
<br />
----<br />
<br />
==Q) Pacman需要一个函数库,这样其他软件就可容易的获得软件包信息。==<br />
'''A)''' libalpm正是你要找的。<br />
<br />
----<br />
<br />
==Q) Pacman需要一个前端吗==<br />
'''A)''' 你看过 [[The Arch Way]] 和 [[Arch Linux]] 以及 [[Devland]]了吗?<br />
回答很简单,Arch开发团队不会提供。尽请使用用户提供的一个前端吧。在[https://wiki.archlinux.org/index.php/Pacman_GUI_Frontends Pacman_GUI_Frontends]中有个很好的清单。<br />
<br />
<br />
----<br />
<br />
==Q) Pacman需要某某功能!==<br />
'''A)''' Arch 的哲学是 "保持简单"。但如果你认为这个功能确实是必要的,可以在官方论坛说出来让大家讨论,或者直接与开发者联系。如果不是的话你可以去找找是否有工具已经实现了这个功能,也可以自己动手来写。<br />
<br />
如果它认为这对pacman特别重要甚至是一个bug,可以来 [http://bugs.archlinux.org Arch Bugs] 反应。<br />
<br />
----<br />
<br />
==Q) Arch需要一个更好的安装程序,也许一个有图形界面的。==<br />
'''A)''' 可以参考问题7和问题8。pacman是Arch的核心,不可替代。但目前有许多基于它的前端,也包括一些GUI软件,可以尝试。但既然用Arch,就应尽可能适应它的风格,或者说文化。<br />
<br />
----<br />
<br />
==Q) Arch需要更多的新闻曝光(换句话说,广告时间) ==<br />
'''A)''' Arch已经得到应得的新闻曝光机会。Arch Linux 的目标不是为了变大。我们的目标是使它变得更好。让它自然增长吧。试图强迫它成长得更快会造成诸多问题。<br />
<br />
----<br />
<br />
==Q) Arch需要减少新闻曝光==<br />
'''A)''' 同理如上。不要试图限制自然的增长。更多的用户也许意味着更多的开发者为Arch Linux工作。这也许会带来一些“上层”组织方面的问题,但是既来之则安之。据我所知<br />
<br />
----<br />
<br />
==Q) Arch需要更多的开发者==<br />
'''A)''' 也许如此。尽请自愿贡献你的时间!访问论坛, irc channel, 邮件列表, 看看有什么需要做的。<br />
文档永远需要的人手,参见 [[DocumentRequests]] 。<br />
<br />
----<br />
<br />
==Q) Arch需要一个稳定软件包分支==<br />
'''A)''' 如果你需要足够的稳定性,首先确保没有打开testing unstable staging 等仓库。如果还是感觉不够稳定,可以找到出现的bugs,去 [https://bugs.archlinux.org/ Arch Bugs] 查查是否有解决方法,或者去Gentoo等网站看有没有相应的补丁,然后自己编译问题包。如果bug非常多,那么你需要的是换一个稳定的发行版(如Debian和Gentoo的稳定分支),Arch基本不可能开辟一个稳定软件包分支。<br />
<br />
----<br />
<br />
==Q) Arch需要更多的文档==<br />
'''A)''' 在搜索过论坛,Wiki以后,可以扩大搜索范围(如Gentoo Wiki,软件主页,或者直接用google搜索),如果你还是不能找到你需要的内容,可以在论坛寻求帮助,相信有经验的用户会提供有用的信息。如果问题解决了,作为回报你可以在Wiki上开始一个页面,或者在论坛中发个帖子讲述完整的解决方法,很可能使其他人也有过相同经历的人受益。<br />
<br />
欢迎更多的人来完善文档,参见 [[DocumentRequests]] 。<br />
<br />
<br />
----<br />
<br />
==Q) Arch需要对“新手”更为友好==<br />
'''A)''' 在问这个问题之前,或许你已经把自己归为新手之列,但恐怕你不想永远都是所谓的新手。所以Arch非常有助于提高你的能力。慢慢得你会发现对Arch由最初的排斥慢慢转变对喜欢。如果你无法让Arch正常工作,请详细阅读相关Wiki,如果还是困难也许说明你经验比较匮乏,可以现用Ubuntu之类对新手比较友好的发行版直到某天你想到了Arch。<br />
<br />
----<br />
<br />
==Q) 新手实在令人讨厌,把他们赶走。==<br />
<br />
'''A)''' <br />
最重要的是学习换位思考,每个人都经历过逐步学习的过程。所以要乐于奉献出自己的经验。如果有人坚持自己的成见并试图挑起争端,不要以同样的态度对待,因为这不会解决任何问题,你可以转而去做自己喜欢的事。<br />
----<br />
<哲学讨论开始><br />
要被他人人道对待的一部分是也人道待人。<br />
</哲学讨论结束><br />
<br />
其实新手并不令人讨厌,带有偏见的新手才是争吵的根源。<br />
对付新手的最佳方法是不要先有成见。有些人可能会有某个普遍的问题,即便他们已经阅读过文档;<br />
任何人都又闹糊涂的时候。对他们大吼大叫没有帮助。最好的行为是忽略你不喜欢的那种人,而不是挑起一场战斗。<br />
最好的帮助新手的方式是引导他们找到正确的信息。特别是一些从Windows转过来的新手可能会在寻找信息时有一段困难的时期。这些信息并不总是在他们期望的地方。比较一下为正确找到正确的词。<br />
例子:你可能问过老师某个你正查找的词的词义,而你总是忘记它的意思。但是,如果你是自己去在字典里去查找的词义,你会余生不忘。<br />
<br />
----</div>Ly50247https://wiki.archlinux.org/index.php?title=Frequently_asked_questions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135204Frequently asked questions (简体中文)2011-03-28T14:46:30Z<p>Ly50247: /* Q) 新手实在令人讨厌,把他们赶走。 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:FAQs (简体中文)]]<br />
{{i18n|FAQ}}<br />
<br />
请首先阅读[[The Arch Way]] 、 [[Arch Linux]] 和 [[Devland|开发者天地]] 。这三个地方包含有大量关于 Arch Linux 的相关信息。<br />
<br />
==Q) 我是一个彻头彻尾的 Linux 新手,我应该用 Arch 吗?==<br />
'''A)''' 这个问题有诸多争议。Arch 的目标用户是比较熟悉 Linux 的用户,但是一些人也认为"Arch 是一个很好的开始”。如果你是一名新手,并打算使用 Arch, 仅仅提醒你,你必须是愿意学习的。在开始问任何问题之前,自己先通过google、Wiki或者论坛进行搜索(以及阅读过去的常见问题集)。如果你这样做了,就没什么可说的。你也应该知道很多人不想一遍又一遍的回答同样的基础问题,所以在那种情况下你很可能碰一鼻子灰。 这是为什么我们为你创建了这些资源并让你可以随时访问。你应当参考 [[Beginners Guide]] <br />
<br />
----<br />
<br />
==Q) 我发现X软件包有一个错误,我应该做什么?==<br />
'''A)''' 首先你需要搞清楚Arch队伍是否能够解决这个错误。有时并非如此(Firefox崩溃也许是Mozilla开发团队的错误) - 这便是所谓的“上游错误” 。 如果确实是Arch的问题,你可以采取以下步骤:<br />
#在论坛中搜索有关信息。看是否有人已经注意到过。<br />
#提醒软件包的维护者。试着使用 "pacman -Qi <软件包名>" 参看信息。<br />
#提交 bug 报告,并在 http://bugs.archlinux.org 上包含详细的信息。 <br />
#如果你喜欢,也可在论坛中贴篇帖子。问题细节和你已经报告过。这会帮助其他人避免重复报告同样的问题。<br />
----<br />
<br />
==Q) pacman会使用数据库吗?==<br />
'''A)''' pacman至少在一定时间内不会使用 sqlite、Berkeley DB 之类的数据库,因为这与 Arch 的原则相背。但目前正在用压缩包来取代众多分散小文件中以提升效率。<br />
<br />
==Q) Pacman太慢了!怎样才能加快它初始化启动速度呢?==<br />
'''A)''' 目前由于/var/lib/pacman/sync目录已经用单独的db(实为tgz格式)文件取代了之前的分散文件,所以速度有了明显的提高。而/var/lib/pacman/local目录下文件将会在之后时间改变成可行的格式(因为其下文件要读写,情况要复杂些),以提高效率。另外,当你感觉pacman运行缓慢时可以运行<tt>pacman-optimize</tt>看是否有所好转。<br />
如果对速度仍然不满意,可以为/var/lib/pacman单独分区(建议reiserfs格式),或者将其挂在一个loop文件上。<br />
<br />
==Q) Arch软件包需要用一个独特的命名方式。.pkg.tar.xz太长了,而且,令人困惑==<br />
'''A)''' 在Arch邮件列表曾有过讨论。一些用户提议.pac作为文件扩展名。但就目前所知而言,没有计划改变软件包的扩展名。<br />
正如Tobias Kieslich(Arch开发者一员)所说, "一个软件包 '''就是''' 一个压缩包!它可以被很多软件打开、研究和操作。此外,这种 mime-type 也可以被大多数软件自动的正确识别。"<br />
<br />
----<br />
<br />
==Q) Pacman需要一个函数库,这样其他软件就可容易的获得软件包信息。==<br />
'''A)''' libalpm正是你要找的。<br />
<br />
----<br />
<br />
==Q) Pacman需要一个前端吗==<br />
'''A)''' 你看过 [[The Arch Way]] 和 [[Arch Linux]] 以及 [[Devland]]了吗?<br />
回答很简单,Arch开发团队不会提供。尽请使用用户提供的一个前端吧。在[https://wiki.archlinux.org/index.php/Pacman_GUI_Frontends Pacman_GUI_Frontends]中有个很好的清单。<br />
<br />
<br />
----<br />
<br />
==Q) Pacman需要某某功能!==<br />
'''A)''' Arch 的哲学是 "保持简单"。但如果你认为这个功能确实是必要的,可以在官方论坛说出来让大家讨论,或者直接与开发者联系。如果不是的话你可以去找找是否有工具已经实现了这个功能,也可以自己动手来写。<br />
<br />
如果它认为这对pacman特别重要甚至是一个bug,可以来 [http://bugs.archlinux.org Arch Bugs] 反应。<br />
<br />
----<br />
<br />
==Q) Arch需要一个更好的安装程序,也许一个有图形界面的。==<br />
'''A)''' 可以参考问题7和问题8。pacman是Arch的核心,不可替代。但目前有许多基于它的前端,也包括一些GUI软件,可以尝试。但既然用Arch,就应尽可能适应它的风格,或者说文化。<br />
<br />
----<br />
<br />
==Q) Arch需要更多的新闻曝光(换句话说,广告时间) ==<br />
'''A)''' Arch已经得到应得的新闻曝光机会。Arch Linux 的目标不是为了变大。我们的目标是使它变得更好。让它自然增长吧。试图强迫它成长得更快会造成诸多问题。<br />
<br />
----<br />
<br />
==Q) Arch需要减少新闻曝光==<br />
'''A)''' 同理如上。不要试图限制自然的增长。更多的用户也许意味着更多的开发者为Arch Linux工作。这也许会带来一些“上层”组织方面的问题,但是既来之则安之。据我所知<br />
<br />
----<br />
<br />
==Q) Arch需要更多的开发者==<br />
'''A)''' 也许如此。尽请自愿贡献你的时间!访问论坛, irc channel, 邮件列表, 看看有什么需要做的。<br />
文档永远需要的人手,参见 [[DocumentRequests]] 。<br />
<br />
----<br />
<br />
==Q) Arch需要一个稳定软件包分支==<br />
'''A)''' 如果你需要足够的稳定性,首先确保没有打开testing unstable staging 等仓库。如果还是感觉不够稳定,可以找到出现的bugs,去 [https://bugs.archlinux.org/ Arch Bugs] 查查是否有解决方法,或者去Gentoo等网站看有没有相应的补丁,然后自己编译问题包。如果bug非常多,那么你需要的是换一个稳定的发行版(如Debian和Gentoo的稳定分支),Arch基本不可能开辟一个稳定软件包分支。<br />
<br />
----<br />
<br />
==Q) Arch需要更多的文档==<br />
'''A)''' 在搜索过论坛,Wiki以后,可以扩大搜索范围(如Gentoo Wiki,软件主页,或者直接用google搜索),如果你还是不能找到你需要的内容,可以在论坛寻求帮助,相信有经验的用户会提供有用的信息。如果问题解决了,作为回报你可以在Wiki上开始一个页面,或者在论坛中发个帖子讲述完整的解决方法,很可能使其他人也有过相同经历的人受益。<br />
<br />
欢迎更多的人来完善文档,参见 [[DocumentRequests]] 。<br />
<br />
<br />
----<br />
<br />
==Q) Arch需要对“新手”更为友好==<br />
'''A)''' 在问这个问题之前,或许你已经把自己归为新手之列,但恐怕你不想永远都是所谓的新手。所以Arch非常有助于提高你的能力。慢慢得你会发现对Arch由最初的排斥慢慢转变对喜欢。如果你无法让Arch正常工作,请详细阅读相关Wiki,如果还是困难也许说明你经验比较匮乏,可以现用Ubuntu之类对新手比较友好的发行版直到某天你想到了Arch。<br />
<br />
----<br />
<br />
==Q) 新手实在令人讨厌,把他们赶走。==<br />
<br />
'''A)''' <br />
最重要的是学习换位思考,每个人都经历过逐步学习的过程。所以要乐于奉献出自己的经验。如果有人坚持自己的成见并试图挑起争端,不要以同样的态度对待,因为这不会解决任何问题,你可以转而去做自己喜欢的事。<br />
----<br />
<哲学讨论开始><br />
要被他人人道对待的一部分是也人道待人。<br />
</哲学讨论结束><br />
<br />
其实新手并不令人讨厌,带有偏见的新手才是争吵的根源。<br />
对付新手的最佳方法是不要先有成见。有些人可能会有某个普遍的问题,即便他们已经阅读过文档;<br />
任何人都又闹糊涂的时候。对他们大吼大叫没有帮助。最好的行为是忽略你不喜欢的那种人,而不是挑起一场战斗。<br />
最好的帮助新手的方式是引导他们找到正确的信息。特别是一些从Windows转过来的新手可能会在寻找信息时有一段困难的时期。这些信息并不总是在他们期望的地方。比较一下为正确找到正确的词。<br />
例子:你可能问过老师某个你正查找的词的词义,而你总是忘记它的意思。但是,如果你是自己去在字典里去查找的词义,你会余生不忘。<br />
<br />
----<br />
<br />
==Q) Arch 需要一个商业实体来支持==<br />
'''A)''' <请于此处添加信息></div>Ly50247https://wiki.archlinux.org/index.php?title=Frequently_asked_questions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135203Frequently asked questions (简体中文)2011-03-28T14:45:21Z<p>Ly50247: /* Q) 新手实在令人讨厌,把他们赶走。 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:FAQs (简体中文)]]<br />
{{i18n|FAQ}}<br />
<br />
请首先阅读[[The Arch Way]] 、 [[Arch Linux]] 和 [[Devland|开发者天地]] 。这三个地方包含有大量关于 Arch Linux 的相关信息。<br />
<br />
==Q) 我是一个彻头彻尾的 Linux 新手,我应该用 Arch 吗?==<br />
'''A)''' 这个问题有诸多争议。Arch 的目标用户是比较熟悉 Linux 的用户,但是一些人也认为"Arch 是一个很好的开始”。如果你是一名新手,并打算使用 Arch, 仅仅提醒你,你必须是愿意学习的。在开始问任何问题之前,自己先通过google、Wiki或者论坛进行搜索(以及阅读过去的常见问题集)。如果你这样做了,就没什么可说的。你也应该知道很多人不想一遍又一遍的回答同样的基础问题,所以在那种情况下你很可能碰一鼻子灰。 这是为什么我们为你创建了这些资源并让你可以随时访问。你应当参考 [[Beginners Guide]] <br />
<br />
----<br />
<br />
==Q) 我发现X软件包有一个错误,我应该做什么?==<br />
'''A)''' 首先你需要搞清楚Arch队伍是否能够解决这个错误。有时并非如此(Firefox崩溃也许是Mozilla开发团队的错误) - 这便是所谓的“上游错误” 。 如果确实是Arch的问题,你可以采取以下步骤:<br />
#在论坛中搜索有关信息。看是否有人已经注意到过。<br />
#提醒软件包的维护者。试着使用 "pacman -Qi <软件包名>" 参看信息。<br />
#提交 bug 报告,并在 http://bugs.archlinux.org 上包含详细的信息。 <br />
#如果你喜欢,也可在论坛中贴篇帖子。问题细节和你已经报告过。这会帮助其他人避免重复报告同样的问题。<br />
----<br />
<br />
==Q) pacman会使用数据库吗?==<br />
'''A)''' pacman至少在一定时间内不会使用 sqlite、Berkeley DB 之类的数据库,因为这与 Arch 的原则相背。但目前正在用压缩包来取代众多分散小文件中以提升效率。<br />
<br />
==Q) Pacman太慢了!怎样才能加快它初始化启动速度呢?==<br />
'''A)''' 目前由于/var/lib/pacman/sync目录已经用单独的db(实为tgz格式)文件取代了之前的分散文件,所以速度有了明显的提高。而/var/lib/pacman/local目录下文件将会在之后时间改变成可行的格式(因为其下文件要读写,情况要复杂些),以提高效率。另外,当你感觉pacman运行缓慢时可以运行<tt>pacman-optimize</tt>看是否有所好转。<br />
如果对速度仍然不满意,可以为/var/lib/pacman单独分区(建议reiserfs格式),或者将其挂在一个loop文件上。<br />
<br />
==Q) Arch软件包需要用一个独特的命名方式。.pkg.tar.xz太长了,而且,令人困惑==<br />
'''A)''' 在Arch邮件列表曾有过讨论。一些用户提议.pac作为文件扩展名。但就目前所知而言,没有计划改变软件包的扩展名。<br />
正如Tobias Kieslich(Arch开发者一员)所说, "一个软件包 '''就是''' 一个压缩包!它可以被很多软件打开、研究和操作。此外,这种 mime-type 也可以被大多数软件自动的正确识别。"<br />
<br />
----<br />
<br />
==Q) Pacman需要一个函数库,这样其他软件就可容易的获得软件包信息。==<br />
'''A)''' libalpm正是你要找的。<br />
<br />
----<br />
<br />
==Q) Pacman需要一个前端吗==<br />
'''A)''' 你看过 [[The Arch Way]] 和 [[Arch Linux]] 以及 [[Devland]]了吗?<br />
回答很简单,Arch开发团队不会提供。尽请使用用户提供的一个前端吧。在[https://wiki.archlinux.org/index.php/Pacman_GUI_Frontends Pacman_GUI_Frontends]中有个很好的清单。<br />
<br />
<br />
----<br />
<br />
==Q) Pacman需要某某功能!==<br />
'''A)''' Arch 的哲学是 "保持简单"。但如果你认为这个功能确实是必要的,可以在官方论坛说出来让大家讨论,或者直接与开发者联系。如果不是的话你可以去找找是否有工具已经实现了这个功能,也可以自己动手来写。<br />
<br />
如果它认为这对pacman特别重要甚至是一个bug,可以来 [http://bugs.archlinux.org Arch Bugs] 反应。<br />
<br />
----<br />
<br />
==Q) Arch需要一个更好的安装程序,也许一个有图形界面的。==<br />
'''A)''' 可以参考问题7和问题8。pacman是Arch的核心,不可替代。但目前有许多基于它的前端,也包括一些GUI软件,可以尝试。但既然用Arch,就应尽可能适应它的风格,或者说文化。<br />
<br />
----<br />
<br />
==Q) Arch需要更多的新闻曝光(换句话说,广告时间) ==<br />
'''A)''' Arch已经得到应得的新闻曝光机会。Arch Linux 的目标不是为了变大。我们的目标是使它变得更好。让它自然增长吧。试图强迫它成长得更快会造成诸多问题。<br />
<br />
----<br />
<br />
==Q) Arch需要减少新闻曝光==<br />
'''A)''' 同理如上。不要试图限制自然的增长。更多的用户也许意味着更多的开发者为Arch Linux工作。这也许会带来一些“上层”组织方面的问题,但是既来之则安之。据我所知<br />
<br />
----<br />
<br />
==Q) Arch需要更多的开发者==<br />
'''A)''' 也许如此。尽请自愿贡献你的时间!访问论坛, irc channel, 邮件列表, 看看有什么需要做的。<br />
文档永远需要的人手,参见 [[DocumentRequests]] 。<br />
<br />
----<br />
<br />
==Q) Arch需要一个稳定软件包分支==<br />
'''A)''' 如果你需要足够的稳定性,首先确保没有打开testing unstable staging 等仓库。如果还是感觉不够稳定,可以找到出现的bugs,去 [https://bugs.archlinux.org/ Arch Bugs] 查查是否有解决方法,或者去Gentoo等网站看有没有相应的补丁,然后自己编译问题包。如果bug非常多,那么你需要的是换一个稳定的发行版(如Debian和Gentoo的稳定分支),Arch基本不可能开辟一个稳定软件包分支。<br />
<br />
----<br />
<br />
==Q) Arch需要更多的文档==<br />
'''A)''' 在搜索过论坛,Wiki以后,可以扩大搜索范围(如Gentoo Wiki,软件主页,或者直接用google搜索),如果你还是不能找到你需要的内容,可以在论坛寻求帮助,相信有经验的用户会提供有用的信息。如果问题解决了,作为回报你可以在Wiki上开始一个页面,或者在论坛中发个帖子讲述完整的解决方法,很可能使其他人也有过相同经历的人受益。<br />
<br />
欢迎更多的人来完善文档,参见 [[DocumentRequests]] 。<br />
<br />
<br />
----<br />
<br />
==Q) Arch需要对“新手”更为友好==<br />
'''A)''' 在问这个问题之前,或许你已经把自己归为新手之列,但恐怕你不想永远都是所谓的新手。所以Arch非常有助于提高你的能力。慢慢得你会发现对Arch由最初的排斥慢慢转变对喜欢。如果你无法让Arch正常工作,请详细阅读相关Wiki,如果还是困难也许说明你经验比较匮乏,可以现用Ubuntu之类对新手比较友好的发行版直到某天你想到了Arch。<br />
<br />
----<br />
<br />
==Q) 新手实在令人讨厌,把他们赶走。==<br />
<br />
'''A)''' <br />
最重要的是学习换位思考,每个人都经历过逐步学习的过程。所以要乐于奉献出自己的经验。如果有人坚持自己的成见并试图挑起争端,不要以同样的态度对待,因为这不会解决任何问题,你可以转而去做自己喜欢的事。<br />
---<br />
<哲学讨论开始><br />
要被他人人道对待的一部分是也人道待人。<br />
</哲学讨论结束><br />
<br />
其实新手并不令人讨厌,带有偏见的新手才是争吵的根源。<br />
对付新手的最佳方法是不要先有成见。有些人可能会有某个普遍的问题,即便他们已经阅读过文档;<br />
任何人都又闹糊涂的时候。对他们大吼大叫没有帮助。最好的行为是忽略你不喜欢的那种人,而不是挑起一场战斗。<br />
最好的帮助新手的方式是引导他们找到正确的信息。特别是一些从Windows转过来的新手可能会在寻找信息时有一段困难的时期。这些信息并不总是在他们期望的地方。比较一下为正确找到正确的词。<br />
例子:你可能问过老师某个你正查找的词的词义,而你总是忘记它的意思。但是,如果你是自己去在字典里去查找的词义,你会余生不忘。<br />
<br />
----<br />
<br />
==Q) Arch 需要一个商业实体来支持==<br />
'''A)''' <请于此处添加信息></div>Ly50247https://wiki.archlinux.org/index.php?title=Frequently_asked_questions_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=135202Frequently asked questions (简体中文)2011-03-28T14:39:51Z<p>Ly50247: /* Q) Arch需要对“新手”更为友好 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:FAQs (简体中文)]]<br />
{{i18n|FAQ}}<br />
<br />
请首先阅读[[The Arch Way]] 、 [[Arch Linux]] 和 [[Devland|开发者天地]] 。这三个地方包含有大量关于 Arch Linux 的相关信息。<br />
<br />
==Q) 我是一个彻头彻尾的 Linux 新手,我应该用 Arch 吗?==<br />
'''A)''' 这个问题有诸多争议。Arch 的目标用户是比较熟悉 Linux 的用户,但是一些人也认为"Arch 是一个很好的开始”。如果你是一名新手,并打算使用 Arch, 仅仅提醒你,你必须是愿意学习的。在开始问任何问题之前,自己先通过google、Wiki或者论坛进行搜索(以及阅读过去的常见问题集)。如果你这样做了,就没什么可说的。你也应该知道很多人不想一遍又一遍的回答同样的基础问题,所以在那种情况下你很可能碰一鼻子灰。 这是为什么我们为你创建了这些资源并让你可以随时访问。你应当参考 [[Beginners Guide]] <br />
<br />
----<br />
<br />
==Q) 我发现X软件包有一个错误,我应该做什么?==<br />
'''A)''' 首先你需要搞清楚Arch队伍是否能够解决这个错误。有时并非如此(Firefox崩溃也许是Mozilla开发团队的错误) - 这便是所谓的“上游错误” 。 如果确实是Arch的问题,你可以采取以下步骤:<br />
#在论坛中搜索有关信息。看是否有人已经注意到过。<br />
#提醒软件包的维护者。试着使用 "pacman -Qi <软件包名>" 参看信息。<br />
#提交 bug 报告,并在 http://bugs.archlinux.org 上包含详细的信息。 <br />
#如果你喜欢,也可在论坛中贴篇帖子。问题细节和你已经报告过。这会帮助其他人避免重复报告同样的问题。<br />
----<br />
<br />
==Q) pacman会使用数据库吗?==<br />
'''A)''' pacman至少在一定时间内不会使用 sqlite、Berkeley DB 之类的数据库,因为这与 Arch 的原则相背。但目前正在用压缩包来取代众多分散小文件中以提升效率。<br />
<br />
==Q) Pacman太慢了!怎样才能加快它初始化启动速度呢?==<br />
'''A)''' 目前由于/var/lib/pacman/sync目录已经用单独的db(实为tgz格式)文件取代了之前的分散文件,所以速度有了明显的提高。而/var/lib/pacman/local目录下文件将会在之后时间改变成可行的格式(因为其下文件要读写,情况要复杂些),以提高效率。另外,当你感觉pacman运行缓慢时可以运行<tt>pacman-optimize</tt>看是否有所好转。<br />
如果对速度仍然不满意,可以为/var/lib/pacman单独分区(建议reiserfs格式),或者将其挂在一个loop文件上。<br />
<br />
==Q) Arch软件包需要用一个独特的命名方式。.pkg.tar.xz太长了,而且,令人困惑==<br />
'''A)''' 在Arch邮件列表曾有过讨论。一些用户提议.pac作为文件扩展名。但就目前所知而言,没有计划改变软件包的扩展名。<br />
正如Tobias Kieslich(Arch开发者一员)所说, "一个软件包 '''就是''' 一个压缩包!它可以被很多软件打开、研究和操作。此外,这种 mime-type 也可以被大多数软件自动的正确识别。"<br />
<br />
----<br />
<br />
==Q) Pacman需要一个函数库,这样其他软件就可容易的获得软件包信息。==<br />
'''A)''' libalpm正是你要找的。<br />
<br />
----<br />
<br />
==Q) Pacman需要一个前端吗==<br />
'''A)''' 你看过 [[The Arch Way]] 和 [[Arch Linux]] 以及 [[Devland]]了吗?<br />
回答很简单,Arch开发团队不会提供。尽请使用用户提供的一个前端吧。在[https://wiki.archlinux.org/index.php/Pacman_GUI_Frontends Pacman_GUI_Frontends]中有个很好的清单。<br />
<br />
<br />
----<br />
<br />
==Q) Pacman需要某某功能!==<br />
'''A)''' Arch 的哲学是 "保持简单"。但如果你认为这个功能确实是必要的,可以在官方论坛说出来让大家讨论,或者直接与开发者联系。如果不是的话你可以去找找是否有工具已经实现了这个功能,也可以自己动手来写。<br />
<br />
如果它认为这对pacman特别重要甚至是一个bug,可以来 [http://bugs.archlinux.org Arch Bugs] 反应。<br />
<br />
----<br />
<br />
==Q) Arch需要一个更好的安装程序,也许一个有图形界面的。==<br />
'''A)''' 可以参考问题7和问题8。pacman是Arch的核心,不可替代。但目前有许多基于它的前端,也包括一些GUI软件,可以尝试。但既然用Arch,就应尽可能适应它的风格,或者说文化。<br />
<br />
----<br />
<br />
==Q) Arch需要更多的新闻曝光(换句话说,广告时间) ==<br />
'''A)''' Arch已经得到应得的新闻曝光机会。Arch Linux 的目标不是为了变大。我们的目标是使它变得更好。让它自然增长吧。试图强迫它成长得更快会造成诸多问题。<br />
<br />
----<br />
<br />
==Q) Arch需要减少新闻曝光==<br />
'''A)''' 同理如上。不要试图限制自然的增长。更多的用户也许意味着更多的开发者为Arch Linux工作。这也许会带来一些“上层”组织方面的问题,但是既来之则安之。据我所知<br />
<br />
----<br />
<br />
==Q) Arch需要更多的开发者==<br />
'''A)''' 也许如此。尽请自愿贡献你的时间!访问论坛, irc channel, 邮件列表, 看看有什么需要做的。<br />
文档永远需要的人手,参见 [[DocumentRequests]] 。<br />
<br />
----<br />
<br />
==Q) Arch需要一个稳定软件包分支==<br />
'''A)''' 如果你需要足够的稳定性,首先确保没有打开testing unstable staging 等仓库。如果还是感觉不够稳定,可以找到出现的bugs,去 [https://bugs.archlinux.org/ Arch Bugs] 查查是否有解决方法,或者去Gentoo等网站看有没有相应的补丁,然后自己编译问题包。如果bug非常多,那么你需要的是换一个稳定的发行版(如Debian和Gentoo的稳定分支),Arch基本不可能开辟一个稳定软件包分支。<br />
<br />
----<br />
<br />
==Q) Arch需要更多的文档==<br />
'''A)''' 在搜索过论坛,Wiki以后,可以扩大搜索范围(如Gentoo Wiki,软件主页,或者直接用google搜索),如果你还是不能找到你需要的内容,可以在论坛寻求帮助,相信有经验的用户会提供有用的信息。如果问题解决了,作为回报你可以在Wiki上开始一个页面,或者在论坛中发个帖子讲述完整的解决方法,很可能使其他人也有过相同经历的人受益。<br />
<br />
欢迎更多的人来完善文档,参见 [[DocumentRequests]] 。<br />
<br />
<br />
----<br />
<br />
==Q) Arch需要对“新手”更为友好==<br />
'''A)''' 在问这个问题之前,或许你已经把自己归为新手之列,但恐怕你不想永远都是所谓的新手。所以Arch非常有助于提高你的能力。慢慢得你会发现对Arch由最初的排斥慢慢转变对喜欢。如果你无法让Arch正常工作,请详细阅读相关Wiki,如果还是困难也许说明你经验比较匮乏,可以现用Ubuntu之类对新手比较友好的发行版直到某天你想到了Arch。<br />
<br />
----<br />
<br />
==Q) 新手实在令人讨厌,把他们赶走。==<br />
<br />
<br />
'''A)''' <哲学讨论开始><br />
要被他人人道对待的一部分是也人道待人。<br />
</哲学讨论结束><br />
<br />
其实新手并不令人讨厌, 带有偏见的新手才是争吵的根源。<br />
对付新手的最佳方法是不要先有成见。有些人可能会有某个普遍的问题,即便他们已经阅读过文档;<br />
任何人都又闹糊涂的时候。对他们大吼大叫没有帮助。最好的行为是忽略你不喜欢的那种人,而不是挑起一场战斗。<br />
最好的帮助新手的方式是引导他们找到正确的信息。特别是一些从Windows转过来的新手可能会在寻找信息时有一段困难的时期。这些信息并不总是在他们期望的地方。比较一下为正确找到正确的词。<br />
例子:你可能问过老师某个你正查找的词的词义,而你总是忘记它的意思。但是,如果你是自己去在字典里去查找的词义,你会余生不忘。<br />
<br />
----<br />
<br />
==Q) Arch 需要一个商业实体来支持==<br />
'''A)''' <请于此处添加信息></div>Ly50247