个人工具

“UbuntuHelp:BluetoothAudio”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的4个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/BluetoothAudio}}
 
{{From|https://help.ubuntu.com/community/BluetoothAudio}}
 
{{Languages|UbuntuHelp:BluetoothAudio}}
 
{{Languages|UbuntuHelp:BluetoothAudio}}
 +
# Title Bluetooth Audio
 +
<<Include(Tag/ContentCleanup)>>
 
=== Overview of Bluetooth Audio ===
 
=== Overview of Bluetooth Audio ===
There are two different Audio profiles implemented in Bluetooth, which one to use depends on how you will use your headset and how you plan to use it.
+
There are two different Audio profiles implemented in Bluetooth. Which one to use depends on how you plan to use your headset.
 
The "sco" audio profile is a low quality, low latency connection.  The sound quality is comparable to a cell phone.  The poor sound quality is very noticeable when listening to music.
 
The "sco" audio profile is a low quality, low latency connection.  The sound quality is comparable to a cell phone.  The poor sound quality is very noticeable when listening to music.
 
The "a2d" audio profile is a high quality compressed connection, and provides excellent audio quality.  As of July 13, 2007 the a2d audio driver is not available via apt, and requires manual compiling for installation.  This is the preferred audio configuration for Bluetooth.
 
The "a2d" audio profile is a high quality compressed connection, and provides excellent audio quality.  As of July 13, 2007 the a2d audio driver is not available via apt, and requires manual compiling for installation.  This is the preferred audio configuration for Bluetooth.
 
=== Installing Low quality "sco" audio drivers ===
 
=== Installing Low quality "sco" audio drivers ===
 
Note:  This software is no longer maintained by the original authors
 
Note:  This software is no longer maintained by the original authors
===== Loading Prerequisites: =====
+
==== Loading Prerequisites ====
sudo apt-get install bluez-btsco
+
<pre><nowiki>
===== Loading the btsco module. =====
+
sudo apt-get install bluez-btsco
sudo modprobe snd-bt-sco
+
sudo modprobe snd-bt-sco
 +
</nowiki></pre>
 
Note:  If you prefer this module be loaded automatically at boot, run 'gksu gedit /etc/modules' and add a line for 'snd-bt-sco'.
 
Note:  If you prefer this module be loaded automatically at boot, run 'gksu gedit /etc/modules' and add a line for 'snd-bt-sco'.
===== Determine the BT Address of the headset. =====
+
==== Determine the BT Address of the headset ====
<ol><li>Put the device into "Pairing" mode.  This procedure varies by headset, but usually involves holding down the power button for 10-15 seconds.
+
<ol><li>Put the device into "Pairing" mode.  This procedure varies by headset, but usually involves holding down the power button for 10-15 seconds
 
</li><li>Open a terminal and run 'hcitool scan'</li></ol>
 
</li><li>Open a terminal and run 'hcitool scan'</li></ol>
  
 
""Note:  I am using my address '00:07:a4:b8:f9:77' for this example.""
 
""Note:  I am using my address '00:07:a4:b8:f9:77' for this example.""
 
""Please substitute your address from the hcitool scan output for the remaining steps.""
 
""Please substitute your address from the hcitool scan output for the remaining steps.""
<ol><li>Look for output like this.</li></ol>
+
<ol><li>Look for output like this</li></ol>
  
ellie@ellie-laptop:~$ hcitool scan
+
<pre><nowiki>
Scanning ...
+
ellie@ellie-laptop:~$ hcitool scan
00:07:A4:B8:F0:77      Motorola HT820
+
Scanning ...
ellie@ellie-laptop:~$
+
        00:07:A4:B8:F0:77      Motorola HT820
 +
ellie@ellie-laptop:~$
 +
</nowiki></pre>
 
<ol><li>Edit  /etc/bluetooth/hcid.conf (gksu gedit  /etc/bluetooth/hcid.conf ) and add a section like this</li></ol>
 
<ol><li>Edit  /etc/bluetooth/hcid.conf (gksu gedit  /etc/bluetooth/hcid.conf ) and add a section like this</li></ol>
  
device 00:07:A4:B8:F9:77 {
+
<pre><nowiki>
name "Motorola HT820"
+
device 00:07:A4:B8:F9:77 {
auth enable;
+
        name "Motorola HT820"
encrypt enable;
+
        auth enable;
}
+
        encrypt enable;
<ol><li>Restart Bluetooth services (sudo /etc/init.d/bluetooth restart)</li></ol>
+
}
 +
</nowiki></pre>
 +
<ol><li>Restart Bluetooth services</li></ol>
  
===== Starting the "sco" driver for the first time. =====
+
<pre><nowiki>
<ol><li>Place the Headset into "pairing" mode as above.
+
sudo /etc/init.d/bluetooth restart
 +
</nowiki></pre>
 +
==== Starting the "sco" driver for the first time ====
 +
<ol><li>Place the Headset into "pairing" mode as above
 
</li><li>Open a terminal and run 'btsco -v 00:07:a4:b8:f9:77'
 
</li><li>Open a terminal and run 'btsco -v 00:07:a4:b8:f9:77'
 
</li><li>This should cause the gnome bluetooth manager to ask you for a pin number to pair.  This is usually 0000 or 1234</li></ol>
 
</li><li>This should cause the gnome bluetooth manager to ask you for a pin number to pair.  This is usually 0000 or 1234</li></ol>
  
===== Testing the "sco" driver. =====
+
==== Testing the "sco" driver ====
 +
<pre><nowiki>
 
aplay -B 1000000 -D plughw:Headset /usr/share/sounds/login.wav
 
aplay -B 1000000 -D plughw:Headset /usr/share/sounds/login.wav
 +
</nowiki></pre>
 
You should hear the Ubuntu Login sound.
 
You should hear the Ubuntu Login sound.
===== Configuring btsco to run automatically at each boot. =====
+
=== Configuring btsco to run automatically at each boot ===
 
<ol><li>Open System -> Preferences -> Sessions and select "startup Programs"
 
<ol><li>Open System -> Preferences -> Sessions and select "startup Programs"
</li><li>Click New.
+
</li><li>Click New
</li><li>Enter "BT Sco Headset audio" for the Name.
+
</li><li>Enter "BT Sco Headset audio" for the Name
 
</li><li>Enter '/usr/bin/btsco -r -f 00:07:a4:b8:f9:77'
 
</li><li>Enter '/usr/bin/btsco -r -f 00:07:a4:b8:f9:77'
 
</li><li>Click Ok and Apply</li></ol>
 
</li><li>Click Ok and Apply</li></ol>
  
===== Setting the headset as your default alsa audio device. =====
+
==== Setting the headset as your default alsa audio device ====
 +
<pre><nowiki>
 
asoundconf set-default-card Headset
 
asoundconf set-default-card Headset
 +
</nowiki></pre>
 
This will create the appropriate entries in your .asoundrc file.  This setting is per-user.
 
This will create the appropriate entries in your .asoundrc file.  This setting is per-user.
 
==== GUI tool for BT Sco config ====
 
==== GUI tool for BT Sco config ====
An alternative way of configure your BT Headset it's using Gbtsco, a simple GUI for all the previously described hard work.
+
An alternative way to configure your BT Headset is to use Gbtsco, a simple GUI for all the previously described hard work.
 
http://www.stgraber.org/2007/05/20/gbtsco-already-release-02/
 
http://www.stgraber.org/2007/05/20/gbtsco-already-release-02/
Please take into account that at this time btsco and snd-bt-sco are deprecated in favour of the new bluez development, but btsco still works until is definitely replaced by the new solution.  More info at http://www.bluez.org/
+
Please take into account that at this time btsco and snd-bt-sco are deprecated in favor of the new bluez development, but btsco still works until is definitely replaced by the new solution.  More info at http://www.bluez.org/
 
=== Installing High quality "a2d" audio drivers ===
 
=== Installing High quality "a2d" audio drivers ===
 
The bluetooth-alsa package is available since Ubuntu 7.10 (Gutsy).
 
The bluetooth-alsa package is available since Ubuntu 7.10 (Gutsy).
=== Using "a2d" audio drivers ===
+
==== Using "a2d" audio drivers ====
 
Pairing a headset using the Bluetooth Manger works as designed through the GUI, however routing sound to the newly paired headset is not possible using Sound Preferences (found at System > Preferences > Sound Preferences). In the Sound Preferences dialog under Devices > Music and Movies > Sound Playback you should be able to pick the paired bluetooth headset. However, the headset does not appear in the list of options. To direct sound output to the headset open a terminal window and enter the following:
 
Pairing a headset using the Bluetooth Manger works as designed through the GUI, however routing sound to the newly paired headset is not possible using Sound Preferences (found at System > Preferences > Sound Preferences). In the Sound Preferences dialog under Devices > Music and Movies > Sound Playback you should be able to pick the paired bluetooth headset. However, the headset does not appear in the list of options. To direct sound output to the headset open a terminal window and enter the following:
 +
<pre><nowiki>
 
gconftool -t string -s /system/gstreamer/0.10/default/musicaudiosink "sbcenc ! a2dpsink device=XX:XX:XX:XX:XX:XX"
 
gconftool -t string -s /system/gstreamer/0.10/default/musicaudiosink "sbcenc ! a2dpsink device=XX:XX:XX:XX:XX:XX"
 +
</nowiki></pre>
 
Where XX:XX:XX:XX:XX:XX is the MAC address of the headset.
 
Where XX:XX:XX:XX:XX:XX is the MAC address of the headset.
 
After executing this command you can reopen the Sound Preferences window and see under Devices > Music and Movies > Sound Playback that the field is now blank (your device can not be represented because the headset isn't a available option in the drop down list).
 
After executing this command you can reopen the Sound Preferences window and see under Devices > Music and Movies > Sound Playback that the field is now blank (your device can not be represented because the headset isn't a available option in the drop down list).
 
To redirect the sound back to the computer's speakers select Autodetect for Devices > Music and Movies > Sound Playback.
 
To redirect the sound back to the computer's speakers select Autodetect for Devices > Music and Movies > Sound Playback.
You will have to restart Rhythembox each time you make a change.
+
You will have to restart Rhythmbox each time you make a change.
 
This information was taken from http://wiki.bluez.org/wiki/HOWTO/AudioDevices.
 
This information was taken from http://wiki.bluez.org/wiki/HOWTO/AudioDevices.
 
=== Troubleshooting ===
 
=== Troubleshooting ===
 
The [[UbuntuHelp:BluetoothSkype|BluetoothSkype]]; page has additional information for configuring the new driver.
 
The [[UbuntuHelp:BluetoothSkype|BluetoothSkype]]; page has additional information for configuring the new driver.
See [[http://bluetooth-alsa.sf.net/contact.html Contact/troubleshooting]] for troubleshooting information.
+
See [http://bluetooth-alsa.sf.net/contact.html Contact/troubleshooting] for troubleshooting information. There is additional information for audio troubleshooting at [[UbuntuHelp:BluetoothPulseaudioTroubleshooting|BluetoothPulseaudioTroubleshooting]]
 
If you experience drop in audio while you use your bluetooth mouse, change this options in /etc/bluetooth/hcid.conf, device section: Change “lm accept;” to “lm master;” and change “lp rswitch,hold,sniff,park;” to “lp hold,sniff,park;”. Then restart bluetooth (/etc/init.d/bluetooth force-reload).
 
If you experience drop in audio while you use your bluetooth mouse, change this options in /etc/bluetooth/hcid.conf, device section: Change “lm accept;” to “lm master;” and change “lp rswitch,hold,sniff,park;” to “lp hold,sniff,park;”. Then restart bluetooth (/etc/init.d/bluetooth force-reload).
 
----
 
----

2010年5月19日 (三) 21:44的最新版本


  1. Title Bluetooth Audio

<<Include(Tag/ContentCleanup)>>

Overview of Bluetooth Audio

There are two different Audio profiles implemented in Bluetooth. Which one to use depends on how you plan to use your headset. The "sco" audio profile is a low quality, low latency connection. The sound quality is comparable to a cell phone. The poor sound quality is very noticeable when listening to music. The "a2d" audio profile is a high quality compressed connection, and provides excellent audio quality. As of July 13, 2007 the a2d audio driver is not available via apt, and requires manual compiling for installation. This is the preferred audio configuration for Bluetooth.

Installing Low quality "sco" audio drivers

Note: This software is no longer maintained by the original authors

Loading Prerequisites

 sudo apt-get install bluez-btsco
 sudo modprobe snd-bt-sco

Note: If you prefer this module be loaded automatically at boot, run 'gksu gedit /etc/modules' and add a line for 'snd-bt-sco'.

Determine the BT Address of the headset

  1. Put the device into "Pairing" mode. This procedure varies by headset, but usually involves holding down the power button for 10-15 seconds
  2. Open a terminal and run 'hcitool scan'

""Note: I am using my address '00:07:a4:b8:f9:77' for this example."" ""Please substitute your address from the hcitool scan output for the remaining steps.""

  1. Look for output like this
 ellie@ellie-laptop:~$ hcitool scan
 Scanning ...
         00:07:A4:B8:F0:77       Motorola HT820
 ellie@ellie-laptop:~$
  1. Edit /etc/bluetooth/hcid.conf (gksu gedit /etc/bluetooth/hcid.conf ) and add a section like this
 device 00:07:A4:B8:F9:77 {
         name "Motorola HT820"
         auth enable;
         encrypt enable;
 }
  1. Restart Bluetooth services
sudo /etc/init.d/bluetooth restart

Starting the "sco" driver for the first time

  1. Place the Headset into "pairing" mode as above
  2. Open a terminal and run 'btsco -v 00:07:a4:b8:f9:77'
  3. This should cause the gnome bluetooth manager to ask you for a pin number to pair. This is usually 0000 or 1234

Testing the "sco" driver

aplay -B 1000000 -D plughw:Headset /usr/share/sounds/login.wav

You should hear the Ubuntu Login sound.

Configuring btsco to run automatically at each boot

  1. Open System -> Preferences -> Sessions and select "startup Programs"
  2. Click New
  3. Enter "BT Sco Headset audio" for the Name
  4. Enter '/usr/bin/btsco -r -f 00:07:a4:b8:f9:77'
  5. Click Ok and Apply

Setting the headset as your default alsa audio device

asoundconf set-default-card Headset

This will create the appropriate entries in your .asoundrc file. This setting is per-user.

GUI tool for BT Sco config

An alternative way to configure your BT Headset is to use Gbtsco, a simple GUI for all the previously described hard work. http://www.stgraber.org/2007/05/20/gbtsco-already-release-02/ Please take into account that at this time btsco and snd-bt-sco are deprecated in favor of the new bluez development, but btsco still works until is definitely replaced by the new solution. More info at http://www.bluez.org/

Installing High quality "a2d" audio drivers

The bluetooth-alsa package is available since Ubuntu 7.10 (Gutsy).

Using "a2d" audio drivers

Pairing a headset using the Bluetooth Manger works as designed through the GUI, however routing sound to the newly paired headset is not possible using Sound Preferences (found at System > Preferences > Sound Preferences). In the Sound Preferences dialog under Devices > Music and Movies > Sound Playback you should be able to pick the paired bluetooth headset. However, the headset does not appear in the list of options. To direct sound output to the headset open a terminal window and enter the following:

gconftool -t string -s /system/gstreamer/0.10/default/musicaudiosink "sbcenc ! a2dpsink device=XX:XX:XX:XX:XX:XX"

Where XX:XX:XX:XX:XX:XX is the MAC address of the headset. After executing this command you can reopen the Sound Preferences window and see under Devices > Music and Movies > Sound Playback that the field is now blank (your device can not be represented because the headset isn't a available option in the drop down list). To redirect the sound back to the computer's speakers select Autodetect for Devices > Music and Movies > Sound Playback. You will have to restart Rhythmbox each time you make a change. This information was taken from http://wiki.bluez.org/wiki/HOWTO/AudioDevices.

Troubleshooting

The BluetoothSkype; page has additional information for configuring the new driver. See Contact/troubleshooting for troubleshooting information. There is additional information for audio troubleshooting at BluetoothPulseaudioTroubleshooting If you experience drop in audio while you use your bluetooth mouse, change this options in /etc/bluetooth/hcid.conf, device section: Change “lm accept;” to “lm master;” and change “lp rswitch,hold,sniff,park;” to “lp hold,sniff,park;”. Then restart bluetooth (/etc/init.d/bluetooth force-reload).