https://wiki.archlinux.org/api.php?action=feedcontributions&user=Robug&feedformat=atomArchWiki - User contributions [en]2024-03-29T06:00:30ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Bluetooth_headset&diff=363623Bluetooth headset2015-03-03T23:23:07Z<p>Robug: added another philips' headphones to list</p>
<hr />
<div>[[Category:Sound]]<br />
[[Category:Bluetooth]]<br />
[[ja:Bluetooth ヘッドセット]]<br />
[[ru:Bluetooth headset]]<br />
{{Related articles start}}<br />
{{Related|Bluetooth}}<br />
{{Related|Bluez4}}<br />
{{Related articles end}}<br />
<br />
Currently, Arch Linux supports the A2DP profile (Audio Sink) for remote audio playback with the default installation. <br />
<br />
{{Tip|The most recent version of [[Bluez]] does not support the Headset/Handsfree profiles. This means that microphone input will not work, and also no sound output on headsets that do not support the A2DP profile. For using a headset with the Headset/Handsfree profiles, you will need to jump down to the legacy methods which require using [[AUR]] to fetch alternative packages.<br />
}}<br />
<br />
{{Tip| {{AUR|pulseaudio-git}} has added native support for the Headset/Handsfree profiles and Bluez5.}}<br />
<br />
{{Tip|Bluez5 is only supported by [[PulseAudio]] and not by [[ALSA]]. If you do not want to use PulseAudio, you need to install an older Bluez version from the AUR.}}<br />
<br />
== Headset via Bluez5/PulseAudio (git) ==<br />
<br />
PulseAudio 5.x supports A2DP per default.<br />
The current git also supports HFP.<br />
Make sure the following packages are installed:<br />
<br />
# pacman -S pulseaudio-alsa bluez bluez-libs bluez-utils bluez-firmware<br />
<br />
Start the Bluetooth system:<br />
<br />
# systemctl start bluetooth<br />
<br />
Now we can use the ''bluetoothctl'' command line utility to pair and connect. For troubleshooting and more detailed explanations of ''bluetoothctl'' see the [[Bluetooth]] article. Run<br />
<br />
# bluetoothctl<br />
<br />
to be greeted by its internal command prompt. Then enter:<br />
<br />
# power on<br />
# agent on<br />
# default-agent<br />
# scan on<br />
<br />
Now make sure that your headset is in pairing mode. It should be discovered shortly. For example,<br />
[NEW] Device 00:1D:43:6D:03:26 Lasmex LBT10<br />
shows a device that calls itself "Lasmex LBT10" and has MAC address ''00:1D:43:6D:03:26''. We will now use that MAC address to initiate the pairing:<br />
<br />
# pair 00:1D:43:6D:03:26<br />
<br />
After pairing, you also need to explicitly connect the device (every time?):<br />
<br />
# connect 00:1D:43:6D:03:26<br />
<br />
If everything works correctly, you now have a separate output device in [[PulseAudio]].<br />
{{Note|The device may be off by default. Select it's audio profile (''OFF'', A2DP, HFP) in the "Configuration" tab of {{Pkg|pavucontrol}}.}}<br />
You can now redirect any audio through that device using the "Playback" and "Recording" tabs of {{Pkg|pavucontrol}}.<br />
<br />
You can now disable scanning again and exit the program:<br />
# scan off<br />
# exit<br />
<br />
<br />
=== Troubleshooting ===<br />
<br />
<br />
Many users report frustration with getting A2DP/Bluetooth Headsets to work. <br />
<br />
==== Selected audio profile, but headset inactive and audio cannot be redirected ====<br />
<br />
Deceptively, this menu is available before the device has been connected; annoyingly it will have no effect. The menu seems to be created as soon as the receiver recognizes the device.<br />
<br />
Make sure to run bluetoothctl (with sudo/as root) and connect the device manually. There may be configuration options to remove the need to do this each time, but neither pairing nor trusting induce automatic connecting for me.<br />
<br />
==== Pairing fails with AuthenticationFailed ====<br />
<br />
If pairing fails, you can try [https://stackoverflow.com/questions/12888589/linux-command-line-howto-accept-pairing-for-bluetooth-device-without-pin disabling SSPMode] with:<br />
# hciconfig hci0 sspmode 0<br />
<br />
==== Pairing works, but connecting does not ====<br />
<br />
You might see the following error in ''bluetoothctl'':<br />
<br />
[bluetooth]# connect 00:1D:43:6D:03:26<br />
Attempting to connect to 00:1D:43:6D:03:26<br />
Failed to connect: org.bluez.Error.Failed<br />
<br />
To further investigate, have a look at the log via one of the following commands:<br />
<br />
# systemctl status bluetooth<br />
# journalctl -n 20<br />
<br />
You might see a message like this:<br />
<br />
bluetoothd[5556]: a2dp-sink profile connect failed for 00:1D:43:6D:03:26: Protocol not available<br />
<br />
The problem in this case is that PulseAudio is not catching up. A common solution to this problem is to restart PulseAudio. Note that it is perfectly fine to run ''bluetoothctl'' as root while PulseAudio runs as user. After restarting PulseAudio, retry to connect. It is not necessary to repeat the pairing.<br />
<br />
If restarting PulseAudio does not work, you need to load module-bluetooth-discover.<br />
<br />
# pactl load-module module-bluetooth-discover<br />
<br />
The same load-module command can be added to {{ic|/etc/pulse/default.pa}}.<br />
<br />
If that still does not work, or you are using PulseAudio's system-wide mode, also load the following PulseAudio modules (again these can be loaded via your default.pa or system.pa):<br />
<br />
module-bluetooth-policy<br />
module-bluez5-device<br />
module-bluez5-discover<br />
<br />
To have your headset auto connect you need to enable PulseAudio's switch-on-connect module. Add the following:<br />
{{hc|/etc/pulse/default.pa|<br />
# automatically switch to newly-connected devices<br />
load-module module-switch-on-connect<br />
}}<br />
<br />
You then need to tell ''bluetoothctl'' to trust your Bluetooth headset, or you will see errors like this:<br />
bluetoothd[487]: Authentication attempt without agent<br />
bluetoothd[487]: Access denied: org.bluez.Error.Rejected<br />
<br />
[bluetooth]# trust 00:1D:43:6D:03:26<br />
<br />
After a reboot, your Bluetooth adapter will not power on by default. You need to add a udev rule to power it on:<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
# Set bluetooth power up<br />
ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", RUN+="/usr/bin/hciconfig %k up"<br />
}}<br />
<br />
==== Connecting works, but I cannot play sound ====<br />
<br />
Make sure that you see the following messages in your system log:<br />
<br />
bluetoothd[5556]: Endpoint registered: sender=:1.83 path=/MediaEndpoint/A2DPSource<br />
bluetoothd[5556]: Endpoint registered: sender=:1.83 path=/MediaEndpoint/A2DPSink<br />
<br />
If you see a message similar to this, you can go on and investigate your PulseAudio configuration. Otherwise, go back and ensure the connection is successful.<br />
<br />
==== UUIDs has unsupported type ====<br />
<br />
During pairing you might see this output in ''bluetoothctl'':<br />
<br />
[CHG] Device 00:1D:43:6D:03:26 UUIDs has unsupported type<br />
<br />
This message is a very common one and can be ignored.<br />
<br />
== Legacy method: ALSA-BTSCO ==<br />
<br />
{{Out of date|Instructions rely on [[bluez4]].}}<br />
<br />
It is much easier to set up your bluetooth headset today, with bluez >= 3.16. You may want to try the out-of-box python script in [http://fosswire.com/2008/01/11/a2dp-stereo-linux/ this blog] (you need edit the script to work with gconftool-2). There is also a piece of equivalent bash script [http://lymanrb.blogspot.com/2008/05/linux.html here].<br />
<br />
You need your headset's bdaddr. It is of the form ''12:34:56:78:9A:BC''. Either find it in the documentation of your headset, on the headset itself or with the '''hcitool scan''' command.<br />
<br />
Install {{AUR|btsco}}.<br />
<br />
To load the kernel module, type:<br />
# modprobe snd-bt-sco<br />
There will now be an extra audio device. Use {{ic|alsamixer -cN}} (where N is most likely 1) to set the volume. You can access the device with any alsa-capable application by choosing the device ''BT headset'', or with any OSS application by using {{ic|/dev/dspN}} as the audio device.<br />
<br />
But to actually get any sound, you have to connect your headset to the computer first.<br />
<br />
=== Connecting the headset ===<br />
<br />
If you connect your headset for the first time, read the section about pairing first. To connect to your headset to the computer, use the command<br />
$ btsco -f <bdaddr><br />
for example<br />
$ btsco -f 12:34:56:78:9A:BC<br />
<br />
==== Pairing the headset with your computer ====<br />
<br />
The first time you connect the headset, you have to pair it with the computer. To do this, you need your headset's PIN. Depending on your headset you may have to reset the headset and repeat the pairing everytime you used the headset with another bluetooth device.<br />
<br />
There are two ways to pair your headset with the computer:<br />
<br />
===== Using ''bluez-gnome'' =====<br />
<br />
{{Out of date|Package does no longer exist in the repositories.}}<br />
<br />
Install the ''bluez-gnome'' package from the community repository. Then start the '''bt-applet''' program. Once you try to connect to the headset, a window will open and ask for the PIN.<br />
<br />
===== Using ''passkey-agent'' =====<br />
<br />
Before connecting to the headset, enter the command<br />
$ passkey-agent --default <pin><br />
where ''<pin>'' is your headset's PIN. Then try to connect to the headset.<br />
<br />
=== Headset and ALSA Devices ===<br />
<br />
1. First if you have not already, [[pacman|install]] {{Pkg|bluez}} from the [[official repositories]].<br />
<br />
2. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
<br />
3. Pair your headset with your device:<br />
$ bluez-simple-agent (optional hci# ***) XX:XX:XX:XX:XX:XX<br />
and put in your pin (0000 or 1234, etc)<br />
<br />
4. Make sure your {{ic|/etc/bluetooth/audio.conf}} allows A2DP Audio Sinks. Place this line just bellow the [General] heading:<br />
Enable=Source,Sink,Media,Socket<br />
<br />
5. Add this to your {{ic|/etc/asound.conf}} file:<br />
#/etc/asound.conf<br />
<br />
pcm.btheadset {<br />
type plug<br />
slave {<br />
pcm {<br />
type bluetooth<br />
device XX:XX:XX:XX:XX:XX <br />
profile "auto"<br />
} <br />
} <br />
hint {<br />
show on<br />
description "BT Headset"<br />
} <br />
}<br />
ctl.btheadset {<br />
type bluetooth<br />
} <br />
<br />
6. Check to see if it has been added to alsa devices<br />
$ aplay -L<br />
<br />
7. Now play with aplay:<br />
$ aplay -D btheadset /path/to/audio/file<br />
<br />
or Mplayer:<br />
$ mplayer -ao alsa:device=btheadset /path/to/audio/or/video/file<br />
<br />
{{Tip|To find hci# for a usb dongle, type in <br />
$ hcitool dev<br />
}}<br />
<br />
=== Headset's multimedia buttons ===<br />
<br />
In order to get your bluetooth headset's multimedia buttons (play, pause, next, previous) working you need to create {{ic|/etc/modules-load.d/uinput.conf}} containing {{ic|uinput}}.<br />
<br />
== Legacy method: PulseAudio ==<br />
<br />
{{Out of date|Instructions rely on [[bluez4]] (references to {{ic|/etc/bluetooth/audio.conf}} and ''bluez-simple-agent'').}}<br />
<br />
This one is much easier and more elegant. PulseAudio will seamlessly switch between output devices when the headset is turned on. If you have ALSA as the sound server, you need the following packages installed:<br />
{{Pkg|pulseaudio}} and {{Pkg|pulseaudio-alsa}}.<br />
<br />
Now, to configure the audio output to use bluetooth, just install {{Pkg|pavucontrol}} and run it to configure the audio output:<br />
$ pavucontrol<br />
Make sure to take a look at the [[PulseAudio]] wiki entry for setting up PulseAudio, especially if you are running KDE.<br />
<br />
=== Troubleshooting ===<br />
<br />
==== Audio sink fails ====<br />
<br />
Bluetooth headset is connected, but ALSA/PulseAudio fails to pick up the connected device. You will get "Audio sink fails".<br />
According to [http://wiki.gentoo.org/wiki/Bluetooth_Headset gentoo wiki], you have to verify than in {{ic|/etc/bluetooth/audio.conf}} there is {{ic|<nowiki>Enable=Socket</nowiki>}} under the {{ic|[General]}} section heading.<br />
<br />
Just do a {{ic|# systemctl restart bluetooth}} to apply it.<br />
<br />
==== Page timeout issue ====<br />
<br />
If you receive this error whilst trying to pair your headset with your system using bluez-simple-agent, then you can try to restart your system and use the graphical bluez applet of your desktop environment.<br />
<br />
== Legacy documentation: ALSA, bluez5 and PulseAudio method ==<br />
<br />
{{Accuracy|Describes two different methods, see the [[Talk:Bluetooth_Headset#bluez5_method:_overcomplicated_instructions|talk page]] for details.|Talk:Bluetooth_Headset#bluez5_method:_overcomplicated_instructions}}<br />
<br />
[[ALSA]], [[bluez|bluez5]], and [[PulseAudio]] work together to allow a wireless [[Bluetooth]] headset to play audio. The following method works with a Lenovo T61p laptop and SoundBot SB220 wireless bluetooth headset. The required software stack is extensive and failure to include all components can produce errors which are difficult to understand. The following list of software packages might not be the minimum required set and needs to be examined more closely.<br />
<br />
Bluez5 has a regression causing HSP/HFP Telephone profile to not be available. This regression is documented in the [http://www.freedesktop.org/wiki/Software/PulseAudio/Notes/5.0/ draft release notes for Pulseaudio 5.0] which say (in "Notes for packagers"): "PulseAudio now supports BlueZ 5, but only the A2DP profile. BlueZ 4 is still the only way to make HSP/HFP work." ([https://fedoraproject.org/wiki/Common_F20_bugs#bluez5-profile from here])<br />
<br />
=== Install Software Packages ===<br />
<br />
The core software components are [[ALSA]], Bluez5, [[PulseAudio]]. However there are additional libraries which are required. As well as a player which can play audio files. The following section lists the software packages installed in order to connect the headset and play audio over the headset.<br />
<br />
==== Install ALSA and associated libraries ====<br />
<br />
[[ALSA]] works with the linux kernel to provide audio services to user mode software. The following packages are used with the [[Bluetooth]] headset: {{Pkg|alsa-utils}}, {{Pkg|alsa-plugins}}, {{Pkg|alsa-tools}}.<br />
<br />
==== Install Bluez5 ====<br />
<br />
Bluez5 is the latest [[Bluetooth]] stack. It is required for [[PulseAudio]] to interface with wireless headsets. Required packages: {{Pkg|bluez}}, {{Pkg|bluez-utils}}, {{Pkg|bluez-libs}}.<br />
<br />
==== Install PulseAudio ====<br />
<br />
[[PulseAudio]] interfaces with [[ALSA]], Bluez and other user mode programs. The {{AUR|pulseaudio-git}} package from [[AUR]] has capabilities not provided by the stock {{Pkg|pulseaudio}} package. The additional capabilities are required by Bluez5. More info regarding the differences between Bluez5 and PulseAudio are [https://bbs.archlinux.org/viewtopic.php?pid=1302270#p1302270 here.]<br />
<br />
Required packages: {{AUR|pulseaudio-git}}, {{Pkg|pavucontrol}}.<br />
<br />
==== Install Audacious ====<br />
<br />
[[Audacious]] is a program which plays audio files. It can work directly with [[ALSA]] or with [[PulseAudio]]. Required packages: {{Pkg|audacious}}, {{Pkg|audacious-plugins}}.<br />
<br />
=== Procedure ===<br />
<br />
Once the required packages are installed, use this procedure to play audio with a bluetooth headset. The high level overview of the procedure is to pair the headset, connect the headset, configure the player and pulse audio controller and then play audio.<br />
<br />
Start the bluetooth service as root:<br />
# systemctl start bluetooth<br />
<br />
Verify Bluetooth is started<br />
# systemctl status bluetooth<br />
bluetooth.service - Bluetooth service<br />
Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled)<br />
Active: active (running) since Sat 2013-12-07 12:31:14 PST; 12s ago<br />
Docs: man:bluetoothd(8)<br />
Main PID: 3136 (bluetoothd)<br />
Status: "Running"<br />
CGroup: /system.slice/bluetooth.service<br />
└─3136 /usr/lib/bluetooth/bluetoothd<br />
<br />
Dec 07 12:31:14 t61p systemd[1]: Starting Bluetooth service...<br />
Dec 07 12:31:14 t61p bluetoothd[3136]: Bluetooth daemon 5.11<br />
Dec 07 12:31:14 t61p systemd[1]: Started Bluetooth service.<br />
Dec 07 12:31:14 t61p bluetoothd[3136]: Starting SDP server<br />
Dec 07 12:31:14 t61p bluetoothd[3136]: Bluetooth management interface 1.3 i...ed<br />
Hint: Some lines were ellipsized, use -l to show in full.<br />
<br />
Start the PulseAudio daemon. This must be done after X windows is started and as a normal user.<br />
$ pulseaudio -D<br />
<br />
Verify the PulseAudio daemon is running.<br />
$ pulseaudio --check -v<br />
I: [pulseaudio] main.c: Daemon running as PID 3186<br />
<br />
Start up bluetoothctl as root and pair and connect your headset. As a regular user, bluetoothctl will pair but not connect. Perhaps this is related to the config file (shown below) which is setup for what appears to be the root user.<br />
Note: the procedure shown below is for an initial pair and connect of the headphone. If the headset is already paired, then the procedure below can be shortened to: power on, agent on, default-agent, connect <mac address>. The mac address can be seen from the devices command output.<br />
<br />
$ bluetoothctl <br />
[NEW] Controller 00:1E:4C:F4:98:5B t61p-0 [default]<br />
[NEW] Device 00:1A:7D:12:36:B9 SoundBot SB220<br />
[bluetooth]# show<br />
Controller 00:1E:4C:F4:98:5B<br />
Name: t61p<br />
Alias: t61p-0<br />
Class: 0x000000<br />
Powered: no<br />
Discoverable: no<br />
Pairable: yes<br />
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)<br />
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)<br />
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)<br />
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)<br />
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)<br />
Modalias: usb:v1D6Bp0246d050B<br />
Discovering: no<br />
[bluetooth]# power on<br />
[CHG] Controller 00:1E:4C:F4:98:5B Class: 0x0c010c<br />
Changing power on succeeded<br />
[CHG] Controller 00:1E:4C:F4:98:5B Powered: yes<br />
[bluetooth]# agent on<br />
Agent registered<br />
[bluetooth]# default-agent<br />
Default agent request successful<br />
<br />
<power on your headset in pairing mode. Eventually you will see what appears to be a mac address.><br />
[bluetooth]# scan on<br />
Discovery started<br />
[CHG] Controller 00:1E:4C:F4:98:5B Discovering: yes<br />
[CHG] Device 00:1A:7D:12:36:B9 RSSI: -61<br />
[bluetooth]# pair 00:1A:7D:12:36:B9<br />
Attempting to pair with 00:1A:7D:12:36:B9<br />
[CHG] Device 00:1A:7D:12:36:B9 Connected: yes<br />
[CHG] Device 00:1A:7D:12:36:B9 UUIDs has unsupported type<br />
[CHG] Device 00:1A:7D:12:36:B9 Paired: yes<br />
Pairing successful<br />
[bluetooth]# connect 00:1A:7D:12:36:B9<br />
[CHG] Device 00:1A:7D:12:36:B9 Connected: yes<br />
Connection successful<br />
[bluetooth]# info 00:1A:7D:12:36:B9<br />
Device 00:1A:7D:12:36:B9<br />
Name: SoundBot SB220<br />
Alias: SoundBot SB220<br />
Class: 0x240404<br />
Icon: audio-card<br />
Paired: yes<br />
Trusted: no<br />
Blocked: no<br />
Connected: yes<br />
LegacyPairing: yes<br />
UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)<br />
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)<br />
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)<br />
<br />
Start up alsamixer, for simplicity un-mute all your outputs. Oddly enough some can be muted though. The ones I had muted during playback were:<br />
* Headphones<br />
* SPIDF<br />
<br />
Start up audacious. Use the menu to select PulseAudio as your output. Somewhere I read that bluez5 requires pulseaudio-git and this jives with my experience.<br />
<br />
Start up pavucontrol in a terminal. In the Outputs tab select the bluetooth headset.<br />
<br />
[http://netskink.blogspot.com/2013/12/pulseaudio-pavucontrol-and-audacious.html screenshot of application settings]<br />
<br />
==== Miscellaneous configuration files ====<br />
<br />
For reference, these settings were also done.<br />
<br />
===== ALSA /etc/asound.conf =====<br />
<br />
The settings shown at the top of this page was used, but the additional modification for Intel laptop sound cards.<br />
<br />
{{bc|<nowiki><br />
pcm.btheadset {<br />
type plug<br />
slave {<br />
pcm {<br />
type bluetooth<br />
device 00:1A:7D:12:36:B9<br />
profile "auto"<br />
}<br />
}<br />
hint {<br />
show on<br />
description "BT Headset"<br />
}<br />
}<br />
ctl.btheadset {<br />
type bluetooth<br />
}<br />
options snd-hda-intel model=laptop<br />
</nowiki>}}<br />
<br />
===== /etc/dbus-1/system.d/bluetooth.conf =====<br />
<br />
The settings here seem to be enabled for root only. See the policy user="root" section. However, if a regular user is specified here, the system fails to start. Someone with more knowledge could explain why.<br />
<br />
{{hc|/etc/dbus-1/system.d/bluetooth.conf|<nowiki><br />
<!-- This configuration file specifies the required security policies for Bluetooth core daemon to work. --><br />
<br />
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"<br />
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><br />
<busconfig><br />
<br />
<!-- ../system.conf have denied everything, so we just punch some holes --><br />
<br />
<policy user="root"><br />
<allow own="org.bluez"/><br />
<allow send_destination="org.bluez"/><br />
<allow send_interface="org.bluez.Agent1"/><br />
<allow send_interface="org.bluez.MediaEndpoint1"/><br />
<allow send_interface="org.bluez.MediaPlayer1"/><br />
<allow send_interface="org.bluez.ThermometerWatcher1"/><br />
<allow send_interface="org.bluez.AlertAgent1"/><br />
<allow send_interface="org.bluez.Profile1"/><br />
<allow send_interface="org.bluez.HeartRateWatcher1"/><br />
<allow send_interface="org.bluez.CyclingSpeedWatcher1"/><br />
</policy><br />
<br />
<policy at_console="true"><br />
<allow send_destination="org.bluez"/><br />
</policy><br />
<br />
<!-- allow users of lp group (printing subsystem) to communicate with bluetoothd --><br />
<policy group="lp"><br />
<allow send_destination="org.bluez"/><br />
</policy><br />
<br />
<policy context="default"><br />
<deny send_destination="org.bluez"/><br />
</policy><br />
<br />
</busconfig><br />
</nowiki>}}<br />
<br />
===== Tested applications =====<br />
<br />
As noted above this will work easily with audacious. YouTube videos with Chromium and Flash Player will work on some videos. If the video has ads it will not work, but if the video does not have ads it will work. Just make sure that after audacious is working with Bluetooth headset, start Chromium, and navigate to YouTube. Find a video without leading ads, and it should play the audio. If the settings icon has the a menu with two drop-down combo boxes for Speed and Quality it will play.<br />
<br />
== Switch between HSV and A2DP setting ==<br />
<br />
This can easily be achieved by the following command where 2 needs to be changed with the correct device number.<br />
<br />
pacmd set-card-profile 2 a2dp<br />
<br />
=== A2DP not working with PulseAudio ===<br />
<br />
If PulseAudio fails when changing the profile to A2DP with bluez 4.1+ and PulseAudio 3.0+, you can try disabling the Socket interface from {{ic|/etc/bluetooth/audio.conf}} by removing the line {{ic|1=Enable=Socket}} and adding line {{ic|1=Disable=Socket}}.<br />
<br />
== Tested headsets ==<br />
<br />
{| class="wikitable"<br />
! Model<br />
! Version<br />
! Comments<br />
! Compatible<br />
|-<br />
| '''Philips SHB9150'''<br />
| bluez5, pulseaudio 5<br />
| Pause and resume does not work. With at least mpv and Banshee hitting the pause button stops audio output but does not pause the player.<br />
| {{R|Limited}}<br />
|-<br />
| '''Philips SHB9100'''<br />
| <br />
| Pause and resume is flaky. See [https://bbs.archlinux.org/viewtopic.php?pid=1315428#p1315428] for the underlying issue and a temporary solution to improve audio quality.<br />
| {{R|Limited}}<br />
|-<br />
| '''Philips SHB7000'''<br />
| <br />
| Pause and resume is flaky.<br />
| {{R|Limited}}<br />
|-<br />
| '''Philips SHB5500BK/00'''<br />
| bluez 5.28, PulseAudio 6.0<br />
| Pause and resume is not working.<br />
| {{R|Limited}}<br />
|-<br />
| '''Parrot Zik'''<br />
| <br />
| Firmware 1.04. The microphone is detected, but does not work. Sometimes it lags (but does not stutter); usually this is not noticeable unless playing games, in which case you may switch to a wired connection.<br />
| {{R|Limited}}<br />
|-<br />
| '''Sony DR-BT50'''<br />
| bluez{4,5}<br />
| Works for a2dp, see [http://vlsd.blogspot.com/2013/11/bluetooth-headphones-and-arch-linux.html]). Adapter: D-Link DBT-120 USB dongle.<br />
| {{Yes}}<br />
|-<br />
| '''Sony SBH50'''<br />
| bluez5<br />
| Works for a2dp, Adapter: Broadcom Bluetooth 2.1 Device (Vendor=0a5c ProdID=219b Rev=03.43). Requires the {{ic|btusb}} [[modprobe|module]].<br />
| {{Yes}}<br />
|-<br />
| '''Sony MDR-XB950BT'''<br />
| pulseaudio<br />
| Tested a2dp. Adapter: Grand-X BT40G. Doesn't auto-connect, need to connect manually. Other functionality works fine.<br />
| {{R|Limited}}<br />
|-<br />
| '''SoundBot SB220'''<br />
| bluez5, {{AUR|pulseaudio-git}}<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Auna Air 300'''<br />
| bluez5, pulseaudio-git<br />
| For some reason, a few restarts were required, and eventually it just started working.<br />
| {{R|Limited}}<br />
|-<br />
| '''Sennheiser MM 400-X'''<br />
| bluez5, pulseaudio 4.0-6<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Sennheiser MM 550-X Travel'''<br />
| bluez 5.27-1, pulseaudio 5.0-1<br />
| Next/Previous buttons work out-of-the-box, Play/Pause does not<br />
| {{Yes}}<br />
|-<br />
| '''Audionic BlueBeats (B-777)'''<br />
| bluez5, pulseaudio 4.0-6<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Logitech Wireless Headset'''<br />
| bluez 5.14, pulseaudio-git<br />
| part number PN 981-000381, advertised for use with iPad<br />
| {{Yes}}<br />
|-<br />
| '''HMDX Jam Classic Bluetooth'''<br />
| bluez, pulseaudio-git<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''PT-810'''<br />
| bluez 5.14, pulseaudio-git<br />
| Generic USB-Powered Bluetooth Audio Receiver with 3.5mm headset jack and a2dp profile. Widely available as "USB Bluetooth Receiver." IDs as PT-810.<br />
| {{Yes}}<br />
|-<br />
| '''Philips SHB4000WT'''<br />
| bluez5<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Philips AEA2000/12'''<br />
| bluez5<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Nokia BH-104'''<br />
| bluez4<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Creative AirwaveHD'''<br />
| bluez 5.23<br />
| Bluetooth adapter Atheros Communications usb: 0cf3:0036<br />
| {{Yes}}<br />
|-<br />
| '''Creative HITZ WP380'''<br />
| bluez 5.27, pulseaudio 5.0-1<br />
| A2DP Profile only. Buttons work (Play, Pause, Prev, Next). Volume buttons are hardware-only. Auto-connect works but you should include the bluetooth module in "pulseaudio" to switch to it automatically. Clear HD Music Audio (This device support APTx codec but it isn't supported in linux yet). You may have some latency problems which needs pulseaudio restart.<br />
| {{Yes}}<br />
|-<br />
| '''deleyCON Bluetooth Headset'''<br />
| bluez 5.23<br />
| Adapter: CSL - USB nano Bluetooth-Adapter V4.0. Tested a2dp profile. Untested microphone. Does not auto-connect (even when paired and trusted), must connect manually. Play/pause button mutes/unmutes the headphones, not the playback. Playback fwd/bwd buttons do not work (nothing visible with ''xev'').<br />
| {{R|Limited}}<br />
|-<br />
| '''UE BOOM'''<br />
| bluez 5.27, pulseaudio-git 5.99<br />
| Update to latest UE BOOM fw 1.3.58. Sound latency in video solved by configuring pavucontrol. Works with UE BOOM x2.<br />
| {{Yes}}<br />
|-<br />
| '''LG HBS-730'''<br />
| bluez 5.27, pulseaudio 5.0<br />
| Works out of box.<br />
| {{Yes}}<br />
|-<br />
| '''Beats Studio Wireless'''<br />
| bluez 5.28, pulseaudio 6.0<br />
| Works out of box. Not tested multimedia buttons.<br />
| {{Yes}}<br />
|}<br />
<br />
== See also ==<br />
<br />
<br />
Using the same device on Windows and Linux without pairing the device over and over again<br />
<br />
* [http://ubuntuforums.org/showthread.php?p=9363229#post9363229 Dual booting with a Bluetooth keyboard]</div>Robughttps://wiki.archlinux.org/index.php?title=LVM&diff=310346LVM2014-04-13T21:41:54Z<p>Robug: type: was "moe" is "more"</p>
<hr />
<div>[[Category:Getting and installing Arch]]<br />
[[Category:File systems]]<br />
[[cs:LVM]]<br />
[[de:LVM]]<br />
[[es:LVM]]<br />
[[fr:LVM]]<br />
[[it:LVM]]<br />
[[ja:LVM]]<br />
[[ru:LVM]]<br />
[[tr:LVM]]<br />
[[zh-CN:LVM]]<br />
{{Related articles start}}<br />
{{Related|Software RAID and LVM}}<br />
{{Related|System Encryption with LUKS}}<br />
{{Related|dm-crypt/Encrypting an Entire System#LVM on LUKS}}<br />
{{Related|dm-crypt/Encrypting an Entire System#LUKS on LVM}}<br />
{{Related articles end}}<br />
From [[Wikipedia:Logical Volume Manager (Linux)]]:<br />
:LVM is a [[Wikipedia:logical volume management|logical volume manager]] for the [[Wikipedia:Linux kernel|Linux kernel]]; it manages disk drives and similar mass-storage devices.<br />
<br />
=== LVM Building Blocks ===<br />
<br />
Logical Volume Management makes use of the [http://sources.redhat.com/dm/ device-mapper] feature of the Linux kernel to provide a system of partitions independent of the underlying disk's layout. With LVM you abstract your storage and have "virtual partitions", making it easier to extend and shrink partitions (subject to potential limitations of your file system) and add/remove partitions without worrying about whether you have enough contiguous space on a particular disk, getting caught up in fdisking a disk in use (and wondering whether the kernel is using the old or new partition table), or, having to move other partitions out of the way. This is strictly an ease-of-management issue: it does not provide any security. However, it sits nicely with the other two technologies we are using.<br />
<br />
The basic building blocks of LVM are:<br />
<br />
* '''Physical volume (PV)''': Partition on hard disk (or even hard disk itself or loopback file) on which you can have volume groups. It has a special header and is divided into physical extents. Think of physical volumes as big building blocks which can be used to build your hard drive.<br />
* '''Volume group (VG)''': Group of physical volumes that are used as storage volume (as one disk). They contain logical volumes. Think of volume groups as hard drives.<br />
* '''Logical volume (LV)''': A "virtual/logical partition" that resides in a volume group and is composed of physical extents. Think of logical volumes as normal partitions.<br />
* '''Physical extent (PE)''': A small part of a disk (usually 4MiB) that can be assigned to a logical Volume. Think of physical extents as parts of disks that can be allocated to any partition.<br />
<br />
Example:<br />
'''Physical disks'''<br />
<br />
Disk1 (/dev/sda):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partition1 50GB (Physical volume) |Partition2 80GB (Physical volume) |<br />
|/dev/sda1 |/dev/sda2 |<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
Disk2 (/dev/sdb):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partition1 120GB (Physical volume) |<br />
|/dev/sdb1 |<br />
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _|<br />
<br />
'''LVM logical volumes'''<br />
<br />
Volume Group1 (/dev/MyStorage/ = /dev/sda1 + /dev/sda2 + /dev/sdb1):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ <br />
|Logical volume1 15GB |Logical volume2 35GB |Logical volume3 200GB |<br />
|/dev/MyStorage/rootvol|/dev/MyStorage/homevol |/dev/MyStorage/mediavol |<br />
|_ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
=== Advantages ===<br />
<br />
LVM gives you more flexibility than just using normal hard drive partitions:<br />
* Use any number of disks as one big disk.<br />
* Have logical volumes stretched over several disks.<br />
* Create small logical volumes and resize them "dynamically" as they get more filled.<br />
* Resize logical volumes regardless of their order on disk. It does not depend on the position of the LV within VG, there is no need to ensure surrounding available space.<br />
* Resize/create/delete logical and physical volumes online. File systems on them still need to be resized, but some support online resizing.<br />
* Online/live migration of LV being used by services to different disks without having to restart services.<br />
* Snapshots allow you to backup a frozen copy of the file system, while keeping service downtime to a minimum.<br />
<br />
These can be very helpful in a server situation, desktop less so, but you must decide if the features are worth the abstraction.<br />
<br />
=== Disadvantages ===<br />
<br />
* Linux exclusive (almost). There is no official support in most other OS (FreeBSD, Windows..).<br />
* Additional steps in setting up the system, more complicated.<br />
* If you use the [[Btrfs]] file system, its Subvolume feature will also give you the benefit of having a flexible layout. In that case, using the additional Abstraction layer of LVM may be unnecessary.<br />
<br />
== Installing Arch Linux on LVM ==<br />
<br />
You should create your LVM Volumes between the [[Partitioning]] and [[File Systems#Format a device|formatting]] steps of the Installation Procedure. Instead of directly formatting a partition to be your root file system, it will be created inside a logical volume (LV). <br />
<br />
Make sure the {{pkg|lvm2}} package is [[pacman|installed]].<br />
<br />
Quick overview: <br />
* Create partition(s) where your PV will reside. Set the partition type to 'Linux LVM', which is 8e if you use MBR, 8e00 for GPT.<br />
* Create your physical volumes (PV). If you have one disk it is best to just create one PV in one large partition. If you have multiple disks you can create partitions on each of them and create a PV on each partition.<br />
* Create your volume group (VG) and add all the PV to it.<br />
* Create logical volumes (LV) inside your VG.<br />
* Continue with “Format the partitions” step of [[Beginners' guide]].<br />
* When you reach the “Create initial ramdisk environment” step in the Beginners Guide, add the {{ic|lvm}} hook to {{ic|/etc/mkinitcpio.conf}} (see below for details).<br />
<br />
{{Warning|{{ic|/boot}} cannot reside in LVM when using [[GRUB Legacy]], which does not support LVM. [[GRUB]] users do not have this limitation. If you need to use GRUB Legacy, you must create a separate {{ic|/boot}} partition and format it directly. }}<br />
<br />
=== Create partitions ===<br />
{{Note|This step is optional and depends on the users preference. In most cases it is recommended to partition the device first, though.}}<br />
See [[Partitioning]] on how to create partitions on your device.<br />
<br />
=== Create physical volumes ===<br />
To list all your devices and their partitions:<br />
* MBR system: {{Ic|fdisk -l}}<br />
* GPT system: {{Ic|lsblk}} and then {{Ic|gdisk -l ''DEVICE''}} to show more detailed information<br />
<br />
{{Warning|Make sure you target the right devices/partitions, or below commands will result in data loss!}}<br />
<br />
Create a physical volume on them:<br />
# pvcreate ''DEVICE''<br />
<br />
As defined in [[LVM#LVM_Building_Blocks]], ''DEVICE'' can be a disk device (e.g. {{ic|/dev/sda}}), a partition (e.g. {{ic|/dev/sda2}}) or a loop back device).<br />
<br />
This command creates a header on each device/partition so it can be used for LVM.<br />
You can track created physical volumes with:<br />
# pvdisplay<br />
<br />
{{Note|If using a SSD without partitioning it first, use {{ic|pvcreate --dataalignment 1m /dev/sda2}} (for erase block size < 1MiB), see e.g. [http://serverfault.com/questions/356534/ssd-erase-block-size-lvm-pv-on-raw-device-alignment here]}}<br />
<br />
=== Create volume group ===<br />
<br />
Next step is to create a volume group on this physical volume. First you need to create a volume group on one of the new partitions and then add to it all other physical volumes you want to have in it:<br />
# vgcreate VolGroup00 /dev/sda2<br />
# vgextend VolGroup00 /dev/sdb1<br />
Also you can use any other name you like instead of VolGroup00 for a volume group when creating it. You can track how your volume group grows with:<br />
# vgdisplay<br />
<br />
{{Note|You can create more than one volume group if you need to, but then you will not have all your storage presented as one disk.}}<br />
<br />
=== Create logical volumes ===<br />
<br />
Now we need to create logical volumes on this volume group. You create a logical volume with the next command by giving the name of a new logical volume, its size, and the volume group it will live on:<br />
# lvcreate -L 10G VolGroup00 -n lvolhome<br />
This will create a logical volume that you can access later with {{ic|/dev/mapper/Volgroup00-lvolhome}} or {{ic|/dev/VolGroup00/lvolhome}}. Same as with the volume groups, you can use any name you want for your logical volume when creating it.<br />
<br />
To create swap on a logical volume, an additional argument is needed:<br />
# lvcreate -C y -L 10G VolGroup00 -n lvolswap<br />
The {{Ic|-C y}} is used to create a contiguous partition, which means that your swap space does not get partitioned over one or more disks nor over non-contiguous physical extents.<br />
<br />
If you want to fill all the free space left on a volume group, use the next command:<br />
# lvcreate -l +100%FREE VolGroup00 -n lvolmedia<br />
<br />
You can track created logical volumes with:<br />
# lvdisplay<br />
<br />
{{Note|You may need to load the ''device-mapper'' kernel module ('''modprobe dm-mod''') for the above commands to succeed:}}<br />
<br />
{{Tip|You can start out with relatively small logical volumes and expand them later if needed. For simplicity, leave some free space in the volume group so there is room for expansion.}}<br />
<br />
=== Create file systems and mount logical volumes ===<br />
<br />
Your logical volumes should now be located in {{ic|/dev/mapper/}} and {{ic|/dev/''YourVolumeGroupName''}}. If you cannot find them, use the next commands to bring up the module for creating device nodes and to make volume groups available:<br />
# modprobe dm-mod<br />
# vgscan<br />
# vgchange -ay<br />
Now you can create file systems on logical volumes and mount them as normal partitions (if you are installing Arch linux, refer to [[Beginners' guide#Mount the partitions|mounting the partitions]] for additional details):<br />
# mkfs.ext4 /dev/mapper/VolGroup00-lvolhome<br />
# mount /dev/mapper/VolGroup00-lvolhome /home<br />
<br />
{{Warning|When choosing mountpoints, just select your newly created logical volumes (use: {{ic|/dev/mapper/Volgroup00-lvolhome}}). Do '''not''' select the actual partitions on which logical volumes were created (do not use: {{ic|/dev/sda2}}).}}<br />
<br />
=== Add lvm hook to mkinitcpio.conf ===<br />
<br />
You will need to make sure the {{Ic|udev}} and {{Ic|lvm2}} [[mkinitcpio]] hooks are enabled.<br />
<br />
{{Ic|udev}} is there by default. Edit the file and insert {{Ic|lvm2}} between {{Ic|block}} and {{Ic|filesystem}} like so:<br />
<br />
{{hc|/etc/mkinitcpio.conf:|<nowiki>HOOKS="base udev ... block lvm2 filesystems"</nowiki>}}<br />
<br />
Afterwards, you can continue in normal installation instructions with the [[Mkinitcpio#Image_creation_and_activation|create an initial ramdisk]] step.<br />
<br />
== Configuration ==<br />
<br />
=== Advanced options ===<br />
<br />
If you need monitoring (needed for snapshots) you can enable lvmetad. <br />
For this set {{ic|1=use_lvmetad = 1}} in {{ic|/etc/lvm/lvm.conf}}.<br />
This is the default by now. <br />
<br />
You can restrict the volumes that are activated automatically by setting the {{Ic|auto_activation_volume_list}} in {{Ic|/etc/lvm/lvm.conf}}. If in doubt, leave this option commented out.<br />
<br />
=== Grow physical volume ===<br />
<br />
After changing the size of a physical volume (pv), e.g: growing a mdadm raid array, you need to grow the pv using the following command:<br />
<br />
# pvresize /dev/mdX<br />
<br />
{{Note|This command can be done while the volume is online}}<br />
<br />
=== Grow logical volume ===<br />
<br />
To grow a logical volume you first need to grow the logical volume and then the file system to use the newly created free space. Let us say we have a logical volume of 15 GB with ext3 on it, and we want to grow it to 20 GB. We need to do the following steps: <br />
# lvextend -L 20G VolGroup00/lvolhome (or lvresize -L +5G VolGroup00/lvolhome)<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
You may use {{Ic|lvresize}} instead of {{Ic|lvextend}}.<br />
<br />
If you want to fill all the free space on a volume group, use the next commands:<br />
# lvextend -l +100%FREE VolGroup00/lvolhome<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
<br />
{{Warning|Not all file systems support growing without loss of data and/or growing online.}}<br />
<br />
{{Note|If you do not resize your file system, you will still have a volume with the same size as before (volume will be bigger but partly unused).}}<br />
<br />
=== Shrink logical volume ===<br />
<br />
Because your file system is probably as big as the logical volume it resides on, you need to shrink the file system first and then shrink the logical volume. Depending on your file system, you may need to unmount it first. Let us say we have a logical volume of 15 GB with ext3 on it and we want to shrink it to 10 GB. We need to do the following steps: <br />
# resize2fs /dev/VolGroup00/lvolhome 9G<br />
# lvreduce -L 10G VolGroup00/lvolhome<br />
<br />
Here we shrunk the file system more than needed so that when we shrunk the logical volume we did not accidentally cut off the end of the file system. After that, we normally grow the file system to fill all free space left on logical volume. You may use {{Ic|lvresize}} instead of {{Ic|lvreduce}}.<br />
# lvresize -L -5G VolGroup00/lvolhome<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
<br />
{{Warning|<br />
* Do not reduce the file system size to less than the amount of space occupied by data or you risk data loss.<br />
* Not all file systems support shrinking without loss of data and/or shrinking online.<br />
}}<br />
<br />
{{Note|It is better to reduce the file system to a smaller size than the logical volume, so that after resizing the logical volume, we do not accidentally cut off some data from the end of the file system.}}<br />
<br />
=== Remove logical volume ===<br />
<br />
{{Warning|Before you remove a logical volume, make sure to move all data that you want to keep somewhere else; otherwise, it will be lost!}}<br />
<br />
First, find out the name of the logical volume you want to remove. You can get a list of all logical volumes installed on the system with:<br />
<br />
# lvs<br />
<br />
Next, look up the mountpoint for your chosen logical volume...:<br />
<br />
$ df -h<br />
<br />
... and unmount it:<br />
<br />
# umount /your_mountpoint<br />
<br />
Finally, remove the logical volume:<br />
<br />
# lvremove /dev/yourVG/yourLV<br />
<br />
Confirm by typing {{ic|y}} and you are done.<br />
<br />
Do not forget, to update {{ic|/etc/fstab}}!<br />
<br />
You can verify the removal of your logical volume by typing {{ic|lvs}} as root again (see first step of this section).<br />
<br />
=== Add physical volume to a volume group ===<br />
<br />
You first create a new physical volume on the block device you wish to use, then extend your volume group<br />
<br />
{{bc|1=<br />
# pvcreate /dev/sdb1<br />
# vgextend VolGroup00 /dev/sdb1<br />
}}<br />
<br />
This of course will increase the total number of physical extents on your volume group, which can be allocated by logical volumes as you see fit.<br />
<br />
{{Note|It is considered good form to have a [[Partitioning|partition table]] on your storage medium below LVM. Use the appropriate type code: {{ic|8e}} for MBR, and {{ic|8e00}} for GPT partitions.}}<br />
<br />
=== Remove partition from a volume group ===<br />
<br />
All of the data on that partition needs to be moved to another partition. Fortunately, LVM makes this easy:<br />
# pvmove /dev/sdb1<br />
If you want to have the data on a specific physical volume, specify that as the second argument to {{Ic|pvmove}}:<br />
# pvmove /dev/sdb1 /dev/sdf1<br />
Then the physical volume needs to be removed from the volume group:<br />
# vgreduce myVg /dev/sdb1<br />
Or remove all empty physical volumes:<br />
# vgreduce --all vg0<br />
<br />
And lastly, if you want to use the partition for something else, and want to avoid LVM thinking that the partition is a physical volume:<br />
# pvremove /dev/sdb1<br />
<br />
<br />
=== Deactivate volume group ===<br />
<br />
Just invoke <br />
# vgchange -a n my_volume_group<br />
<br />
This will deactivate the volume group and allow you to unmount the container it is stored in.<br />
<br />
=== Snapshots ===<br />
<br />
==== Introduction ====<br />
<br />
LVM allows you to take a snapshot of your system in a much more efficient way than a traditional backup. It does this efficiently by using a COW (copy-on-write) policy. The initial snapshot you take simply contains hard-links to the inodes of your actual data. So long as your data remains unchanged, the snapshot merely contains its inode pointers and not the data itself. Whenever you modify a file or directory that the snapshot points to, LVM automatically clones the data, the old copy referenced by the snapshot, and the new copy referenced by your active system. Thus, you can snapshot a system with 35GB of data using just 2GB of free space so long as you modify less than 2GB (on both the original and snapshot).<br />
<br />
==== Configuration ====<br />
<br />
You create snapshot logical volumes just like normal ones.<br />
<br />
# lvcreate --size 100M --snapshot --name snap01 /dev/mapper/vg0-pv<br />
With that volume, you may modify less than 100M of data, before the snapshot volume fills up.<br />
<br />
Reverting the modified 'pv' logical volume to the state when the 'snap01' snapshot was taken can be done with<br />
<br />
{{ic|# lvconvert --merge /dev/vg0/snap01}}<br />
<br />
In case the origin logical volume is active, merging will occur on the next reboot.(Merging can be done even from a LiveCD)<br />
<br />
The snapshot will no longer exist after merging.<br />
<br />
Also multiple snapshots can be taken and each one can be merged with the origin logical volume at will.<br />
<br />
The snapshot can be mounted and backed up with '''dd''' or '''tar'''. The size of the backup file done with '''dd''' will be the size of the files residing on the snapshot volume. <br />
To restore just create a snapshot, mount it, and write or extract the backup to it. And then merge it with the origin.<br />
<br />
It is important to have the ''dm_snapshot'' module listed in the MODULES variable of {{ic|/etc/mkinitcpio.conf}}, otherwise the system will not boot. If you do this on an already installed system, make sure to rebuild the image with<br />
# mkinitcpio -g /boot/initramfs-linux.img<br />
<br />
Todo: scripts to automate snapshots of root before updates, to rollback... updating {{ic|menu.lst}} to boot snapshots (separate article?)<br />
<br />
snapshots are primarily used to provide a frozen copy of a file system to make backups; a backup taking two hours provides a more consistent image of the file system than directly backing up the partition.<br />
<br />
See [[Create root filesystem snapshots with LVM]] for automating the creation of clean root file system snapshots during system startup for backup and rollback.<br />
<br />
[[Dm-crypt/Encrypting an Entire System#LVM on LUKS]] and [[Dm-crypt/Encrypting an Entire System#LUKS on LVM]].<br />
<br />
If you have LVM volumes not activated via the [[Mkinitcpio|initramfs]], [[#Using units|enable]] the '''lvm-monitoring''' service, which is provided by the {{pkg|lvm2}} package.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Changes that could be required due to changes in the Arch-Linux defaults ===<br />
<br />
The {{ic|1=use_lvmetad = 1}} must be set in {{ic|/etc/lvm/lvm.conf}}. This is the default now - if you have a {{ic|lvm.conf.pacnew}} file, you must merge this change.<br />
<br />
=== LVM commands do not work ===<br />
<br />
* Load proper module:<br />
# modprobe dm_mod<br />
<br />
The {{ic|dm_mod}} module should be automatically loaded. In case it does not, you can try:<br />
<br />
{{hc|/etc/mkinitcpio.conf:|<nowiki>MODULES="dm_mod ..."</nowiki>}}<br />
<br />
You will need to [[Mkinitcpio#Image_creation_and_activation|rebuild]] the initramfs to commit any changes you made.<br />
<br />
* Try preceding commands with ''lvm'' like this:<br />
# lvm pvdisplay<br />
<br />
=== Logical Volumes do not show up ===<br />
<br />
If you are trying to mount existing logical volumes, but they do not show up in {{ic|lvscan}}, you can use the following commands to activate them:<br />
<br />
# vgscan<br />
# vgchange -ay<br />
<br />
=== LVM on removable media ===<br />
<br />
Symptoms:<br />
# vgscan<br />
Reading all physical volumes. This may take a while...<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836585984: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836643328: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 0: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 4096: Input/output error<br />
Found volume group "backupdrive1" using metadata type lvm2<br />
Found volume group "networkdrive" using metadata type lvm2<br />
<br />
Cause:<br />
:Removing an external LVM drive without deactivating the volume group(s) first. Before you disconnect, make sure to:<br />
# vgchange -an ''volume group name''<br />
<br />
Fix: (assuming you already tried to activate the volume group with {{ic|# vgchange -ay ''vg''}}, and are receiving the Input/output errors:<br />
# vgchange -an ''volume group name''<br />
Unplug the external drive and wait a few minutes:<br />
# vgscan<br />
# vgchange -ay ''volume group name''<br />
<br />
=== Kernel options ===<br />
<br />
In kernel options, you may need {{ic|dolvm}}. {{ic|<nowiki>root=</nowiki>}} should be set to the logical volume, e.g {{ic|/dev/mapper/''vg-name''-''lv-name''}}.<br />
<br />
== See also ==<br />
<br />
* [http://sourceware.org/lvm2/ LVM2 Resource Page] on SourceWare.org<br />
* [http://tldp.org/HOWTO/LVM-HOWTO/ LVM HOWTO] article at The Linux Documentation project<br />
* [http://www.gentoo.org/doc/en/lvm2.xml Gentoo LVM2 installation] guide at Gentoo documentation<br />
* [http://wiki.gentoo.org/wiki/LVM LVM] article at Gentoo wiki<br />
* [http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1/ LVM2 Mirrors vs. MD Raid 1] post by Josh Bryan<br />
* [http://www.tutonics.com/2012/11/ubuntu-lvm-guide-part-1.html Ubuntu LVM Guide Part 1][http://www.tutonics.com/2012/12/lvm-guide-part-2-snapshots.html Part 2 detals snapshots]</div>Robughttps://wiki.archlinux.org/index.php?title=JACK_Audio_Connection_Kit&diff=116748JACK Audio Connection Kit2010-09-11T10:36:39Z<p>Robug: /* Playing nice with ALSA */</p>
<hr />
<div><math>Insert formula here</math>{{stub}}<br />
<br />
If you know anything about JACK, please expand this article. I've uninstalled it, so I can't really expand it any further.<br />
<br />
=Install=<br />
==Multiprocessor implementation (soon: JACK2)==<br />
[http://www.grame.fr/~letz/jackdmp.html Here's] a mp version of JACK which will also be used as base for JACK2. <br />
<br />
[[AUR]] package: [http://aur.archlinux.org/packages.php?ID=22488 jack-audio-connection-kit-mp]<br />
<br />
You can compile Jack2 with the new dbus-based control system or the 'classic' interface. Which one you have depends on whether you compiled Jack2 with the --dbus configure option or not.<br />
<br />
Jack2 without --dbus executes similarly to Jack1. With --dbus, control is done using the jack_control utility. Run `jack_control` to see what it does. The important commands are listed below:-<br />
jack_control start - starts the jack server<br />
jack_control stop - stops the jack server<br />
jack_control ds alsa - selects alsa as the driver (backend)<br />
jack_control eps realtime True - set engine parameters, such as realtime<br />
jack_control dps period 256 - set the driver parameter period to 256<br />
<br />
You may also need to play with the driver parameters nperiods and rate.<br />
<br />
==JACK==<br />
Alternatively, there is the normal version from the extra repository, install it with:<br />
pacman -S jack<br />
<br />
=== Jack for a multi-user system ===<br />
So, you have a descent multiuser system as it was designed more than 20 years ago, and now some developers decided that sound is only for a mono-user system... No I can not believe it !<br />
<br />
{{Warning|Before following the below instructions, please note that there is a security risk to any service running as root, and, more importantly, the developers for jack do not test it for running as root. In other words, it could eat your babies, data, or both}}<br />
<br />
Fortunately some time ago someone convinced the developers to allow jack to run as a system wide daemon. Here is the procedure to follow:<br />
<br />
'''Create a <tt>/etc/profile.d/jack.sh</tt> file''' containing:<br />
export JACK_PROMISCUOUS_SERVER=""<br />
<br />
'''Replace <tt>/etc/rc.d/jack-audio-connection-kit</tt>''' with the following content<br />
<pre><br />
#!/bin/bash <br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
# source application-specific settings<br />
[ -f /etc/conf.d/jack-audio-connection-kit ] && . /etc/conf.d/jack-audio-connection-kit<br />
<br />
PID=`pidof -o %PPID /usr/bin/jackd`<br />
<br />
[ -n "$JACKUSER" ] && HOME="/home/$JACKUSER"<br />
[ -z "$JACK_PARAMS" ] && JACK_PARAMS=$(sed 's:/usr/bin/jackd ::' $HOME/.jackdrc)<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting JACK"<br />
if [ -z "$PID" ]; then<br />
if [ -n "$JACKUSER" ]; then<br />
su - $JACKUSER -c 'export JACK_PROMISCUOUS_SERVER="" && . /etc/conf.d/jack-audio-connection-kit && umask 0000 && /usr/bin/jackd $JACK_PARAMS &> /dev/null &'<br />
else<br />
export JACK_PROMISCUOUS_SERVER=""<br />
umask 0000<br />
/usr/bin/jackd $JACK_PARAMS &> /dev/null &<br />
fi<br />
fi<br />
<br />
if [ ! -z "$PID" -o $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon jack<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping JACK"<br />
[ ! -z "$PID" ] && kill $PID &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon jack<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {sta|stop|restart}"<br />
esac<br />
exit 0<br />
</pre><br />
<br />
Where my '''<tt>/etc/conf.d/jack-audio-connection-kit</tt>''' is<br />
<pre><br />
# Configuration for starting JACK at boot<br />
<br />
# Uncomment this to run as user (recommended)<br />
#JACKUSER="root"<br />
<br />
# Uncomment this to not source ~/.jackdrc<br />
JACK_PARAMS="-R -P89 -dalsa -dhw:1 -r48000 -p512 -n3"<br />
</pre><br />
<br />
==Playing nice with ALSA==<br />
To allow Alsa programs to play while jack is running you must install the jack plugin for alsa:<br />
<pre>pacman -S alsa-plugins</pre><br />
<br />
And enable it by editing (or creating) /etc/asound.conf (system wide settings) to have these lines:<br />
<pre><br />
# convert alsa API over jack API<br />
# use it with<br />
# % aplay foo.wav<br />
<br />
# use this as default<br />
pcm.!default {<br />
type plug<br />
slave { pcm "jack" }<br />
}<br />
<br />
ctl.mixer0 {<br />
type hw<br />
card 1<br />
}<br />
<br />
# pcm type jack<br />
pcm.jack {<br />
type jack<br />
playback_ports {<br />
0 system:playback_1<br />
1 system:playback_2<br />
}<br />
capture_ports {<br />
0 system:capture_1<br />
1 system:capture_2<br />
}<br />
}</pre><br />
<br />
You needn't restart your computer or anything. Just edit the alsa config files, start up jack, and there you go...<br />
<br />
Remember to start it as an '''user'''. If you start it with "jackd -d alsa" as user X, it won't work for user Y.<br />
<br />
=Related Articles=<br />
[[Pro Audio]]</div>Robughttps://wiki.archlinux.org/index.php?title=JACK_Audio_Connection_Kit&diff=116697JACK Audio Connection Kit2010-09-10T15:08:20Z<p>Robug: /* Jack for a multi-user system */</p>
<hr />
<div><math>Insert formula here</math>{{stub}}<br />
<br />
If you know anything about JACK, please expand this article. I've uninstalled it, so I can't really expand it any further.<br />
<br />
=Install=<br />
==Multiprocessor implementation (soon: JACK2)==<br />
[http://www.grame.fr/~letz/jackdmp.html Here's] a mp version of JACK which will also be used as base for JACK2. <br />
<br />
[[AUR]] package: [http://aur.archlinux.org/packages.php?ID=22488 jack-audio-connection-kit-mp]<br />
<br />
You can compile Jack2 with the new dbus-based control system or the 'classic' interface. Which one you have depends on whether you compiled Jack2 with the --dbus configure option or not.<br />
<br />
Jack2 without --dbus executes similarly to Jack1. With --dbus, control is done using the jack_control utility. Run `jack_control` to see what it does. The important commands are listed below:-<br />
jack_control start - starts the jack server<br />
jack_control stop - stops the jack server<br />
jack_control ds alsa - selects alsa as the driver (backend)<br />
jack_control eps realtime True - set engine parameters, such as realtime<br />
jack_control dps period 256 - set the driver parameter period to 256<br />
<br />
You may also need to play with the driver parameters nperiods and rate.<br />
<br />
==JACK==<br />
Alternatively, there is the normal version from the extra repository, install it with:<br />
pacman -S jack<br />
<br />
=== Jack for a multi-user system ===<br />
So, you have a descent multiuser system as it was designed more than 20 years ago, and now some developers decided that sound is only for a mono-user system... No I can not believe it !<br />
<br />
{{Warning|Before following the below instructions, please note that there is a security risk to any service running as root, and, more importantly, the developers for jack do not test it for running as root. In other words, it could eat your babies, data, or both}}<br />
<br />
Fortunately some time ago someone convinced the developers to allow jack to run as a system wide daemon. Here is the procedure to follow:<br />
<br />
'''Create a <tt>/etc/profile.d/jack.sh</tt> file''' containing:<br />
export JACK_PROMISCUOUS_SERVER=""<br />
<br />
'''Replace <tt>/etc/rc.d/jack-audio-connection-kit</tt>''' with the following content<br />
<pre><br />
#!/bin/bash <br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
# source application-specific settings<br />
[ -f /etc/conf.d/jack-audio-connection-kit ] && . /etc/conf.d/jack-audio-connection-kit<br />
<br />
PID=`pidof -o %PPID /usr/bin/jackd`<br />
<br />
[ -n "$JACKUSER" ] && HOME="/home/$JACKUSER"<br />
[ -z "$JACK_PARAMS" ] && JACK_PARAMS=$(sed 's:/usr/bin/jackd ::' $HOME/.jackdrc)<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting JACK"<br />
if [ -z "$PID" ]; then<br />
if [ -n "$JACKUSER" ]; then<br />
su - $JACKUSER -c 'export JACK_PROMISCUOUS_SERVER="" && . /etc/conf.d/jack-audio-connection-kit && umask 0000 && /usr/bin/jackd $JACK_PARAMS &> /dev/null &'<br />
else<br />
export JACK_PROMISCUOUS_SERVER=""<br />
umask 0000<br />
/usr/bin/jackd $JACK_PARAMS &> /dev/null &<br />
fi<br />
fi<br />
<br />
if [ ! -z "$PID" -o $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon jack<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping JACK"<br />
[ ! -z "$PID" ] && kill $PID &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon jack<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {sta|stop|restart}"<br />
esac<br />
exit 0<br />
</pre><br />
<br />
Where my '''<tt>/etc/conf.d/jack-audio-connection-kit</tt>''' is<br />
<pre><br />
# Configuration for starting JACK at boot<br />
<br />
# Uncomment this to run as user (recommended)<br />
#JACKUSER="root"<br />
<br />
# Uncomment this to not source ~/.jackdrc<br />
JACK_PARAMS="-R -P89 -dalsa -dhw:1 -r48000 -p512 -n3"<br />
</pre><br />
<br />
==Playing nice with ALSA==<br />
To allow Alsa programs to play while jack is running you must install the jack plugin for alsa:<br />
<pre>pacman -S alsa-plugins</pre><br />
<br />
And enable it by editing (or creating) /etc/asound.conf (system wide settings) to have these lines:<br />
<pre><br />
# convert alsa API over jack API<br />
# use it with<br />
# % aplay foo.wav<br />
<br />
# use this as default<br />
pcm.!default {<br />
type plug<br />
slave { pcm "jack" }<br />
}<br />
<br />
ctl.mixer0 {<br />
type hw<br />
card 1<br />
}<br />
<br />
# pcm type jack<br />
pcm.jack {<br />
type jack<br />
playback_ports {<br />
0 system:playback_1<br />
1 system:playback_2<br />
}<br />
capture_ports {<br />
0 system:capture_1<br />
1 system:capture_2<br />
}<br />
}</pre><br />
<br />
You needn't restart your computer or anything. Just edit the alsa config files, start up jack, and there you go...<br />
<br />
=Related Articles=<br />
[[Pro Audio]]</div>Robug