NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.13k forks source link

wiki: Bluetooth #13289

Closed garbas closed 6 years ago

garbas commented 8 years ago

https://nixos.org/wiki/Bluetooth

langston-barrett commented 8 years ago

Information on this wiki page is out of date, bluez 5 is the default (at least in nixos-unstable)

garbas commented 8 years ago

@siddhanathan +1 i think it would be useful to have a section how to setup bluetooth in the manual

MasseGuillaume commented 7 years ago

More detail for Bluetooth Headset: https://gist.github.com/spaceCamel/f40d2d551b4a990f6464

garbas commented 7 years ago

@MasseGuillaume @jb55

should we make (in current master) bluez5 a default bluez? also when you enable hardware.bluetooth maybe we should also do hardware.pulseaudio.package = pkgs.pulseaudioFull;?

i can not test this myself, but will be able to soon ... i just ordered something from kickstarted

socksy commented 7 years ago

Maybe this should be moved into another issue, but it seems most relevant here, given that the information in the wiki/internet seems to not be working enough to set things up right.

I have done all the steps in the wiki and @MasseGuillaume's gist, and it fails for me on the connecting part, with Failed to connect: org.bluez.Error.Failed. (Aside: I do not see the point in specifying bluez as pkgs.bluez5 now it appears to be the default in unstable, but nonetheless have it.)

I'm getting a lot of:

bluetoothd[1876]: a2dp-sink profile connect failed for 00:E0:4C:A1:0D:94: Protocol not available

in the results of systemctl status -l dbus-org.bluez. Google would suggest that's because pulseaudio doesn't have bluetooth support, but I am using the pulseaudioFull package, and pactl list clearly shows the following modules:

Restarting pulseaudio also appears to have no effect.

The relevant parts of my configuration are:

hardware = {
    pulseaudio = {
      enable = true;
      systemWide = true;
      support32Bit = true;
      package = pkgs.pulseaudioFull;
    };
    bluetooth.enable = true;
  };

And in my custom packages:

  bluez = pkgs.bluez5;

I also put bluez in and out of the package list for no affect.

Anyway, thanks for reading. Thought it might be worth pointing out that the current docs are not enough to get BT audio working for me...

qfjp commented 6 years ago

@socksy I know it's been a year, but I think it can be fixed by adding this to /etc/nixos/configuration.nix:

hardware.bluetooth.extraConfig = ''
  [general]
  Enable=Source,Sink,Media,Socket
''
socksy commented 6 years ago

Thanks for the suggestion, @qfjp, but this gives exactly the same errors as before (blueman-manager saying Connection Failed: DBusFailedError: Protocol not available and from the journalctl command I specified in my previous a2dp-sink profile connect failed for [my bluetooth device address]: Protocol not available).

Perhaps I should file a bug report somewhere, but I've not looked up the process. Would be curious to know if anyone else with a Dell XPS 9360/9560 has a similar issue.

gmarmstrong commented 6 years ago

I was receiving that same Connection Failed: DBusFailedError: Protocol not available from blueman-manager, and I solved this by running systemctl --user daemon-reload; systemctl --user restart pulseaudio (which is noted in Using Bluetooth headsets with PulseAudio) before connecting. I imagine I'll need to do this every time I want to connect to my headset...