Open Sound System

出自 Arch Linux 中文维基

本文內容或本節內容已經過期。

原因: 請提供模板的第一個位置參數以概括原因。 (在Talk:Open Sound System討論)

本文或本節需要翻譯。要貢獻翻譯,請訪問簡體中文翻譯團隊

附註: 請提供模板的第一個位置參數以更詳細的指示。(在 Talk:Open Sound System# 中討論)

這篇文章講述如果在你的電腦上安裝和配置Open Sound System (OSS)。

Open Sound System 是一個類Unix和POSIX兼容系統上一個可選的聲音架構。OSSv3是Linux下原始的聲音系統併集成在內核裡,但是OSSv4在2002年OSS成為商業軟件時它地位被ALSA所取代。OSSv4在2007年又成為了開源軟件 ,4Front Technologies 以GPL協議發佈了它的源碼。

與ALSA驅動對比[編輯 | 編輯原始碼]

OSS與ALSA相比的一些優缺點。

OSS的優點(對用户來説)[編輯 | 編輯原始碼]

  • 在內核空間(kernel space)裡面包含了一個透明軟件混音器(vmix)。這樣多個程序就可以同時使用聲音設備而且沒有任何問題。
  • 這個混音器可以讓你單獨調節各個程序的音量。
  • 對某些老聲卡有着更好的支持比如創新(Creative)的X-Fi。
  • 聲音程序的初始反應時間一般更好。
  • 對使用OSS的應用程式接口(API)的程序有更好的支持,很多程序都支持OSS的API,而不需要ALSA的模擬。

OSS的優點(對開發者來説)[編輯 | 編輯原始碼]

  • 清晰的API文檔,更易於使用。
  • 支持用户空間的聲音驅動。
  • 可移植性強,OSS也可以在BSDs和Solaris下運行。
  • 本身可以跨平台,可以更方便移植到新的作業系統。

ALSA的優點[編輯 | 編輯原始碼]

  • ALSA對USB音頻設備支持更好,而OSS的輸出還在試驗中,輸入還未實現。
  • ALSA支持藍牙聲音設備。
  • ALSA支持AC'97和HDAudio dial-up soft-modems (比如Si3055)。
  • ALSA對MIDI支持得更好,但用OSS你只能通過軟件合成器(如timidity和fluidsynth)來使用MIDI。
  • ALSA對待機支持更好,而用OSS,你需要在待機前使用soundoff來停止OSS驅動,在恢復後使用soundon來啟動OSS。
  • OSS的jack檢測目前在某些HDAudio-powered主板上不能正常工作。也就是説在某些型號的主板上,你可能需要在插入耳機的時候手動關閉外置揚聲器。而ALSA沒這個問題。

安裝[編輯 | 編輯原始碼]

AUR 安裝 ossAUR.

這會安裝OSS並運行其啟動腳本,它會暫時使ALSA模塊失效,並安裝OSS內核模塊。因為ALSA在引導過程中默認開啟,你需要關閉它以免引導時它與OSS發生衝突。可以編輯{Filename|rc.conf}} 文件並添加:

MODULES=(!soundcore ...

然後將OSS加入守護進程中:

DAEMONS=(crond hal @oss...

如果用户不在audio組裏,把他加進去:

# gpasswd -a username audio
  • 運行下面的命令啟動oss:
# /etc/rc.d/oss start

如果OSS無法檢測到你的聲卡,運行:

# ossdetect -v

然後運行 soundoff && soundon 來重新激活它。

測試[編輯 | 編輯原始碼]

要注意默認的音量很高,不要戴耳機,並且調低揚聲器的音量(如果可以),然後再進行測試:

測試OSS:

$ osstest

你應該能在測試過程中聽到音樂,如果沒有,嘗試在接下來的步驟裡調節音量。

如果你要讓多個程序同時發聲,可以用OSS的軟件混音器——vmix。

檢查vmix是否開啟了:

$ ossmix -a | grep -i vmix

你應該能看到類似'vmix0-enable ON|OFF (currently ON)'.的一行。如果你沒看到任何含'vmix'的行,很可能vmix沒有依附到你的聲音設備上,運行下面命令:

$ vmixctl attach device

其中device是你的聲音設備,比如/dev/oss/oss_envy240/pcm0。

為了避免將來手動運行這個命令,可以把它加到/usr/lib/oss/soundon.user裡,像[1]中建議的。

如果你看到了"Device or resource busy"(設備或資源繁忙)的錯誤,需要把"vmix_no_autoattach=1"加到/usr/lib/oss/conf/osscore.conf中,然後重啟。

查看哪個設置被檢測到了:

$ ossinfo

你應該能夠看到你的設備列在Device objects 或 Audio Devices下。如果你要用的設備不在其中,需要編輯 /usr/lib/oss/etc/installed_drivers 。設備的驅動應該在更上邊。而後可能需要運行soundoff, soundon。如果還不工作,註釋掉所有不必要的驅動。

聲音控制[編輯 | 編輯原始碼]

為了控制不同設備,你要設置混音器。命令行工具是 ossmix,它很像BSD聲音混音器(mixerctl)。還有一個更友好的基於圖形界面的混音器 ossxmix ,運行時依賴gtk2

ossxmix的基本界面和控制功能如下:

 / High Definition Audio ALC262 \    --------------------------------> 1
/________________________________\________________________________
|                                                                 \
| [x] vmix0-enable [vmix0-rate: 48.000kHz]      vmix0-channels    |--> 2
|                                               [ Stereo [v] ]    |
|                                                                 |
|  __codec1______________________________________________________ |
| |  _jack______________________________________________________ ||--> 3
| | |  _int-speaker_________________   _green_________________  |||
| | | |                             | |                       | |||
| | | |  _mode_____ | |             | |  _mode_____   | |     | |||
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix  [v] ]  o o [x] | |||
| | | |             | |             | |               | |     | |||
| | | |_____________________________| |_______________________| |||
| | |___________________________________________________________|||
| |______________________________________________________________||
| ___vmix0______________________________________________________  |
| |  __mocp___  O O   _firefox_  O O  __pcm7___  O O            | |--> 4
| | |         | O O  |         | x x |         | O O            | |
| | | | |     | x O  | | |     | x x | | |     | O O            | |
| | | o o [x] | x x  | o o [x] | x x | o o [x] | O O            | |
| | | | |     | x x  | | |     | x x | | |     | O O            | |
| | |_________| x x  |_________| x x |_________| O O            | |
| |_____________________________________________________________| |
|_________________________________________________________________|
  1. 一個聲卡一個標籤頁。
  2. Vmix (虛擬混音器) 的特別配置,包括採樣率和混音器優先級。
  3. 這是你聲卡的插孔(輸入和輸出)的配置。聲卡提供的每一個混音器控制都在這裏顯示。
  4. 應用程式vmix混音器和音量控制。如果程序不在播放聲音它會用pcm08, pcm09...標記,當播放時會顯示程序名稱。

顏色定義[編輯 | 編輯原始碼]

對於high definition (HD) audio,ossxmix會用預定義的顏色顯示jack的設置:

Color Type Connector
green front channels (stereo output) 3.5mm TRS
black rear channels (stereo output) 3.5mm TRS
grey side channels (stereo output) 3.5mm TRS
gold center and subwoofer (dual output) 3.5mm TRS
blue line level (stereo input) 3.5mm TRS
pink microphone (mono input) 3.5mm TS

保存和恢復混音器設置[編輯 | 編輯原始碼]

混音器設置在關機時會保存,如果你現在就要保存,可以運行:

# savemixer

savemixer 可以用來把音量記錄在文件中(用 -f 選項)然後用 -L 選項恢復。

其他的混音器程序[編輯 | 編輯原始碼]

其他支持OSS的混音器程序有:

  • GNOME - Gnome volume control
  • KDE - Kmix - OSS的支持正在開發中。

配置程序來使用OSS[編輯 | 編輯原始碼]

Skype[編輯 | 編輯原始碼]

skype包只支持ALSA ,獲得支持OSS的Skype,安裝 skype-oss 包:

# pacman -S skype-oss

如果你用的是x86_64,可以用bin32-skype-ossAUR[損壞的連結:package not found]

Wine[編輯 | 編輯原始碼]

  • 運行 winecfg
$ winecfg
  • Audio(音頻) 選項卡。
  • 選擇OSS Driver(OSS驅動)

Gajim[編輯 | 編輯原始碼]

Gajim缺省用 aplay -q放聲音。可以在Advanced Settings(高級設置)裡搜索soundplayer變量。oss提供的ossplay程序是一個好的替換:ossplay -qq

MOC[編輯 | 編輯原始碼]

讓MOC支持OSS4,你必須把配置文件"$HOME"/.moc中的 OSSMixerDevice 改成/dev/ossmix。 然後MOC就可以正常工作。或者你可以編譯AUR中的moc-svn包(它支持新的vmix)。 在界面下更改OSSMixerChannel可以在mocp中按'w'。

使用Gstreamer的程序[編輯 | 編輯原始碼]

移除pulseaudio和gstreamer*-pulse的程序和庫。

要將gstreamer的輸出設置成OSS而不是缺省的ALSA,運行:

gstreamer-properties

Default Output(缺省輸出)選成 custom(自定義),並把文本框中內容改成:

oss4sink

對於輸入:

oss4src
注意: oss4src不一定比osssrc聽起來更好,所以只有在發現確實這樣時再改。
注意: 對於一些程序 (像 Rhythmbox, Totem) ,gstreamer-properties沒作用,因為它們依賴 "musicaudiosink" 而不是 "audiosink"(gstreamer-properties修改的)。用gstreamer-properties設置完Workaround後用gconf-editor把"/system/gstreamer/0.10/default/audiosink"值拷貝到"musicaudiosink"(在一個位置)中

如果你用gstreamer作為phonon的後端,要設置環境變量,對於當前用户:

export PHONON_GST_AUDIOSINK=oss4sink

把它加到 ~/.bashrc 來登錄自動加載。

firefox(火狐)>=3.5[編輯 | 編輯原始碼]

Firefox 3.5 新引進的<video>和<audio>標籤支持直接播放ogg媒體。然而它不能同時支持ALSA和OSS,所以你需要安裝[community]中的xulrunner-oss包。

1. 关闭 firefox。
2. 安装[community]中的xulrunner-oss包。
3. 启动firefox。

Mplayer[編輯 | 編輯原始碼]

如果你用GUI外殼(如smplayer)。你會發現在音頻設置中有oss輸出選項。如果用它本身,可以播放時指定mplayer -ao oss /some/file/to/play.mkv,如果嫌麻煩可以在"$HOME"/.mplayer/config中加入 "ao=oss"。

Music Player Daemon(MPD)[編輯 | 編輯原始碼]

MPD的配置文件是 /etc/mpd.conf 和 ~/.mpdconf,檢查這兩個文件,找到這樣的東西:

 audio_output {
       type           "alsa"
       name           "Some Device Name"
 }

如果你發現一個像上邊的未註釋的ALSA配置,註釋或刪掉,並加入下邊的內容:

 audio_output {
       type           "oss"
       name           "My OSS Device"
 }
注意: 我必須把這個配置寫到 ~/.mpdconf 才能正常工作,按理預改/etc/mpd.conf也行。(應該是~/.mpdconf把優先級高或者把/etc/mpd.conf配置覆蓋了)

對於大多數用户可以不需要進一步的配置了。然而如果你的MPD重啟後不成正常工作,或者你更具體地配置,OSS音頻輸出可以像這樣更詳細地配置: 首先運行:

 ossinfo | grep /dev/dsp

找到類似這樣/dev/dsp -> /dev/oss/<SOME_CARD_IDENTIFIER>/pcm0的行。注意你的 <SOME_CARD_IDENTIFIER> ,然後加入下邊粗體的部分到你的MPD配置文件:

 audio_output {
       type            "oss"
       name            "My OSS Device"
       device          "/dev/oss/<SOME_CARD_IDENTIFIER>/pcm0"
       mixer_device    "/dev/oss/<SOME_CARD_IDENTIFIER>/mix0"
 }

其他程序[編輯 | 編輯原始碼]

  • 如果你不能讓其他程序發出聲音,試試看為程序設置OSSv4這裏
  • 用{Codeline|pacman -Ss -- -oss}} 和 AUR中 搜索特定的包。

問題以及解決[編輯 | 編輯原始碼]

HDAudio硬件的問題解決[編輯 | 編輯原始碼]

問題如何產生[編輯 | 編輯原始碼]

如果你有一個HDAudio聲音設備,有可能你必須調整一些設置你的聲卡才能正常工作。

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上包含的很多小器件)。這些控制對混音器是外露的,例如,可以被用來把耳機聲音輸出功能改到聲音輸入功能。

但是,這可能導致問題,主要因為HDAudio標準比理想中應該有的標準來説太靈活了,也因為計算機開發商經常支持關注怎麼讓官方驅動正常工作。

所以你才會在使用HDAudio設備的時候,發現控制是混亂的,必須自己嘗試手動調整每一個控制條直到可以工作,因為默認根本不會正常工作。你需要在前台調整ossxmix混音器設定的時候,後台有個程序錄製/播放聲音(比如 ossrecord - | ossplay - 來錄製或者 osstest -lV來播放)。

如何解決[編輯 | 編輯原始碼]

打開ossxmix,嘗試改變每個控制條到中間位置,這包含在聲卡特殊設定,就如上面"混音器"説到的一樣。

  • 把每個音量控制條往上調整Raise every volume control slider.
  • 在每個選擇框裏面,嘗試改變選項,一定要嘗試每個可能的選項
  • 如果你聽到有噪音,一個一個嘗試把某些控制往下調整或者靜音,直到你找到噪音的來源。

請注意,你不必調整頂部區域和底部區域的有關虛擬vmix混音器控制的部分控制條。

解決其他問題[編輯 | 編輯原始碼]

  • 類似ALSA的,你需要降低main音量和PCM音量來一定程序上減少噪音(這根據你晶片情況而定。我使用vol=65,pcm=65,晶片為via8237)
  • 這裏[失效連結 2021-05-17 ⓘ]了解如何設定默認聲卡,因為默認的選擇不是最優的。
  • 如果一個程序播放聲音遇到困難, 4front的wiki裏面可能有解決辦法.

提示和小技巧[編輯 | 編輯原始碼]

OSS與多媒體鍵[編輯 | 編輯原始碼]

一個簡單的靜音/恢復和增減音量的方法是使用AUR中的 ossvol 腳本。 如果你的多媒體鍵默認不工作,查看 使用多媒體鍵控制OSS

安裝好了這樣在開關聲音:

$ ossvol -t

輸入ossvol -h查看其他命令:

如果你不如果怎麼把命令綁定到多媒體鍵上,看Extra keyboard keys

ossvol的問題解決[編輯 | 編輯原始碼]

如果你看到這樣的錯誤:

Bad mixer control name(987) 'vol'

你需要編輯/usr/bin/ossvolCHANNEL變量的值,它在腳本的開始處。例如我的是CHANNEL="vmix0-outvol"

  • 注意 如果你用xbindkeys來綁定快捷鍵,把
"ossmix vmix0-outvol -- +1"

raise volume

"ossmix vmix0-outvol -- -1"

lower volume

加到.xbindkeysrc中的traise/lower volume section是調整音量的好方法。

改變採樣率[編輯 | 編輯原始碼]

改變採樣率不是那麼簡單的事,它只能通過root用户改變並且改變時vmix不能被任何程序使用。在接下來的操作之前,檢查一下你的receiver/amplifier(接收器/放大器)並且使用高質量的揚聲器而不是普通的電腦揚聲器。因為如果你用的是普通的電腦揚聲器,下邊的任何改動都不會讓你感覺到任何變化。

缺省的採樣率是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 → 48000hz). There is an article about this issue in "Stereophile" which was discussed on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue.

Some example sample rates:

  • 44100hz - Sample rate of standard Red Book audio cds.
  • 88000hz - Sample rate of SACD high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.
  • 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an AC'97 motherboard, this is likely to be your highest bitrate.
  • 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 Intel HDA audio.

To check what your sample rate is currently set to:

  1. Run "ossmix | grep rate".

You are likely to see "vmix0-rate <decimal value> (currently 48000) (Read-only)".

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 does not 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.

Steps to affect the change:

  1. 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.
  2. As root, run "/usr/lib/oss/scripts/killprocs.sh". 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).
  3. After all programs occupying vmix are terminated, run as root: "vmixctl rate /dev/dsp 96000" replacing the rate with your desired sample rate.
  4. Run "ossmix | grep rate" and check for "vmix0-rate <decimal value> (currently 96000) (Read-only)" to see if you were successful.
  5. Make changes permanent use the soundon.user file to set the rate for every soundon
write "vmixctl rate /dev/dsp 96000" in the file /usr/lib/oss/soundon.user and make it executable.

Changing the Default Sound Output[編輯 | 編輯原始碼]

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.

      *** Scanning sound adapter #-1 ***
      /dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front
      - Performing audio playback test... 
      <left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> 

The left sounded good, the right and stereo were the distorted ones.

Let the test continue until you get a working output:

      /dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out 
      - Performing audio playback test... 
      <left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> 

If this passed the test on all left, right and stereo, proceed to next step.

So from here: Changing_the_default_sound_output you get the command to change the default output; change according to what works for you

      sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich

With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.

Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB[編輯 | 編輯原始碼]

This information is completely from 4front-tech.com ; courtesy of kristian and Maxa. Thanks!!

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.

To fix this, a recompile of oss is nessasary, for now.

1. Grab the latest oss from the AUR

ossAUR

2. Extract it

3. cd to the folder, I renamed the folder to oss

4. run makepkg --nobuild

5. cd to src/kernel/drv/oss_usb/ ; edit the ossusb_audio.c ; add a Return 1 ; should look like so and SAVE

  static int
 write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,
            int ctl, int l, unsigned int v)
 {
   return 1;

6. cd to src/kernel/setup and edit srcconf_linux.inc, search for -Werror and remove it, otherwise OSS will not compile.

7. do a makepkg --noextract

Now you must install the package with pacman -U ; remove oss first if already installed (pacman -Rd oss)

簡單的系統托盤小工具[編輯 | 編輯原始碼]

想要一個GNOME那樣的控制音量小工具?W 在這裏我得到一個可用的 工具

下載 這個腳本 重命名(例如 ossvolctl),運行:

$ chmod +x ossvolctl
# cp ossvolctl /usr/bin/ossvolctl

or

# install -Dm755 ossvolctl /usr/bin/ossvolctl

開機自啟動ossxmix托盤[編輯 | 編輯原始碼]

KDE 4

~/.local/share/applications/創建一個啟動器ossxmix.desktop

[Desktop Entry]
Name=Open Sound System Mixer
GenericName=Audio Mixer
Exec=ossxmix -b
Icon=audio-card
Categories=Application;GTK;AudioVideo;Player;
Terminal=false
Type=Application
Encoding=UTF-8

讓它隨桌面環境啟動:

System Settings(系統設置) > Advanced tab(高級) > Autostart(自啟動),然後點擊add program(添加程序)並選擇 'Multimedia' (多媒體)。

Gnome

  • 以root用户創建/usr/local/bin/ossxmix_bg:
#!/bin/sh
exec /usr/bin/ossxmix -b

到 System(系統)> Preferences(屬性) > Start Up Applications(啟動程序)

  • 點擊Add(添加),在Name(名稱)中輸入 OSSMIX ,field(內容)中輸入/usr/local/bin/ossxmix_bg然後點擊Add(添加)按鈕。
  • 重新登錄生效。

錄製一個程序的聲音[編輯 | 編輯原始碼]

Suspend and Hibernation[編輯 | 編輯原始碼]

OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.

OSS provides soundon and soundoff to enable and disable OSS, although any processes that use sound must be terminated first.

The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.

#!/bin/sh
. "${PM_FUNCTIONS}"

suspend_osssound()
{
 /usr/lib/oss/scripts/killprocs.sh
 /usr/sbin/soundoff
}

resume_osssound()
{
 /usr/sbin/soundon
}

case "$1" in
 hibernate|suspend)
 suspend_osssound
	;;
 thaw|resume)
	resume_osssound
	;;
 *) exit $NA
	;;
esac

Save the contents of the script (as root) into /etc/pm/sleep.d/50ossound and make it executable. chmod a+x /etc/pm/sleep.d/50ossound

注意: This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.

OSS does not support suspending but we do not care or better s2ram works fine without stopping OSS. Just create a nice suspend script to /sbin/suspend and make it executable.

 #!/bin/sh

 ## Checking if you are a root or not
 if ! [ -w / ]; then
   echo >&2 "This script must be run as root"
   exit 1
 fi

 s2ram -f

 sleep 2

 /etc/rc.d/oss restart 2>/tmp/oss.txt ||
 echo "OSS restart failed, check /tmp/oss.txt for advice"

That's all your apps are fine and suspend works. \o/

注意: If you are using Opera you must kill operapluginwrapper before suspend. To do this add pid=$(pidof operapluginwrapper) && kill $pid before s2ram -f.

ALSA 模擬器[編輯 | 編輯原始碼]

你可以讓alsa-lib用OSS作為聲音輸出系統,這是一種ALSA模擬器。

但是注意,這個方法可能在你聲音輸出的時候造成額外的延遲,而且模擬器也不完善,無法保證能讓所有程序發聲。例如如果軟件通過ALSA檢測設備,這個軟件就不能正常工作。

所以,因為大多數應用直接支持OSSS,這個方法只是最後的解決方案。

將來會有更完善的ALSA模擬器,像libsalsacuckoo.

介紹[編輯 | 編輯原始碼]

  • 安裝alsa-plugins包。
# pacman -S alsa-plugins
  • 編輯 /etc/asound.conf
pcm.oss {
   type oss
    device /dev/dsp
}

pcm.!default {
    type oss
    device /dev/dsp
}

ctl.oss {
    type oss
    device /dev/mixer
}

ctl.!default {
    type oss
    device /dev/mixer
}
注意: 如果你不再使用OSS,別忘了把/etc/asound.conf改回去。

對特定驅動的設置[編輯 | 編輯原始碼]

If something is not working, there is a possibility, that there are specific settings for specific driver (this way I have enabled jack-sense on my laptop)

  • Find out which driver is used
# lspci -vnn|grep -i -A 15 audio
00:1e.2 Multimedia audio controller [0401]: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller [8086:266e] (rev 03)
	Subsystem: Hewlett-Packard Company NX6110/NC6120 [103c:099c]
	Flags: bus master, medium devsel, latency 0, IRQ 21
	I/O ports at 2100 [size=256]
	I/O ports at 2200 [size=64]
	Memory at d0581000 (32-bit, non-prefetchable) [size=512]
	Memory at d0582000 (32-bit, non-prefetchable) [size=256]
	Capabilities: <access denied>
	Kernel driver in use: *oss_ich*
	Kernel modules: snd-intel8x0
  • Locate configuration file for device in:
# cd /usr/lib/oss/conf/
  • Try changing defaults. There are only few settings, and they are self explanatory

Setting:

ich_jacksense = 1 

in oss_ich.conf turned on jack-sense on my laptop (now plugged headphones are recognized, and speaker muted).

  • Restart oss for changes take effects.
# sudo /etc/rc.d/oss restart
  • oss_hdaudio.conf has hdaudio_jacksens too. Maybe it will work for you. Unfortunately not for everyone.

System-wide (software) equalizer effects[編輯 | 編輯原始碼]

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.

We must do a few things to gain access to these effects.

  • If you are running the oss-linux-free daemon right now, stop it by running (as root):
/etc/rc.d/oss-linux-free stop
    • On builds 1015 and older, in /usr/lib/oss/etc/installed_drivers remove
vmix
    • On 1016 and newer, you should instead pass "vmix_disabled=1" parameter to osscore (via /usr/lib/oss/conf/osscore.conf) to disable vmix.
  • in /usr/lib/oss/etc/installed_drivers add
softoss
  • in /etc/rc.d/oss-linux-free comment out lines 15 through 20 so that it looks kinda like this
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
 start)
   stat_busy "Starting OSS/Open source driver"
   # start
   /usr/sbin/soundon
   if [ $? -gt 0 ]; then
     stat_fail
   else
     grep '^softoss' /proc/modules >/dev/null 2>/dev/null
#      if [ $? -eq 0 ]; then
#        stat_busy "Replacing old \"softoss\" module with \"vmix\""
#        rmmod softoss
#        modprobe vmix
#        sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers
#      fi
     add_daemon oss4
     stat_done
   fi
   ;;
 stop)
   stat_busy "Saving OSS mixer"
   /usr/sbin/savemixer
   if [ $? -gt 0 ]; then
     stat_fail
   else
     stat_done
   fi
   grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null
   if [ $? -eq 0 ]; then
     stat_busy "Removing \"cuckoo\" module"
     rmmod \"cuckoo\"
   fi
   stat_busy "Stopping OSS/Open source driver"
   /usr/sbin/soundoff
   if [ $? -gt 0 ]; then
     stat_fail
   else
     rm_daemon oss4
     stat_done
   fi
   ;;
 restart)
   $0 stop
   sleep 1
   $0 start
   ;;
 *)
   echo "usage: $0 {start|stop|restart}"
esac

This keeps the oss-linux-free daemon from replacing softoss with vmix. (Very useful if you wish to switch between softoss and vmix.)

  • start the daemon again (as root of course)
/etc/rc.d/oss-linux-free start
  • If no errors are reported, then you may now see/use the effects with either ossmix or ossxmix with
ossmix -d1

or

ossxmix
  • you must turn off bipass to actually use the effects
ossmix -d1 effects.eq.bypass OFF

or just uncheck bypass in ossxmix

  • enjoy