You are not logged in.

#1 2021-06-13 00:49:44

slimb
Member
Registered: 2020-07-19
Posts: 2

Make pipewire-media-session not try activate dbus-org.bluez.service

I have pipewire-media-session.service enabled, and have `bluetooth.service` disabled (installed via bluez, of which `dbus-org.bluez.service` is an alias).

Then in the journal:

dbus-daemon[445]: [system] Activating via systemd: service name='org.bluez' unit='dbus-org.bluez.service' requested by ':1.96' (uid=1000 pid=1524 comm="/usr/lib/gnome-contacts-search-provider ")
dbus-daemon[445]: [system] Activation via systemd failed for unit 'dbus-org.bluez.service': Unit dbus-org.bluez.service not found.

But is there a way to have `bluez` installed and  `bluetooth.service` disabled without `pipewire-media-session` trying to activate it at all?

Offline

#2 2021-06-20 08:35:05

ua4000
Member
Registered: 2015-10-14
Posts: 402

Re: Make pipewire-media-session not try activate dbus-org.bluez.service

Instead of disabling the bluez unit, you may want to mask it, https://wiki.archlinux.org/title/Systemd#Using_units
see the difference between disabling and masking.

Another idea is to read the pipewire config in /usr/share/pipewire, and look out for the bluez option, to disable it's usage.

Offline

#3 2021-09-13 22:20:16

NiceGuy
Member
Registered: 2018-02-19
Posts: 50

Re: Make pipewire-media-session not try activate dbus-org.bluez.service

ua4000 wrote:

Another idea is to read the pipewire config in /usr/share/pipewire, and look out for the bluez option, to disable it's usage.

Please let everything under /usr be UNTOUCHED. Those files and directories in /usr/share/pipewire and /usr in general correspond to the FHS (File Hierarchy Standard) https://refspecs.linuxfoundation.org/FH … #purpose18. Any changes to the configuration, in this case pipewire, should be done in /etc or to be specific in /etc/pipewire/. For completeness: it should also work in your home directory in $XDG_CONFIG_HOME/pipewire/media-session.d/ for a per user setting.


Pipewire (version 0.3.35 as of the time of writing) is still under heavy development. Feature-wise, stability, completeness and also its session-manager, which can either be media-session or wireplumper. For the next Fedora release 35 in autumn wireplumper is aimed to be the default pipewire session manager. Be aware, that all your configuration changes might not work from one release to the other.


READ the manual pages / documentation / wiki! 


Disabling of bluetooth in pipewire and related tweaks or changes in /etc/pipewire/media-session.d/media-session.conf:
1) In the end you simply create the directory /etc/pipewire/media-session.d (system-wide configuration):

 mkdir -p /etc/pipewire/media-session.d 

2) Copy the system installed configuration file /usr/share/pipewire/media-session.d/media-session.conf to /etc/pipewire/media-session.d/media-session.conf:

 cp -v /usr/share/pipewire/media-session.d/media-session.conf /etc/pipewire/media-session.d/media-session.conf 

3) Change or most of the time comment a few lines. In your case watch out for any instances of the form '#bluez5':

Part 1: /etc/pipewire/media-session.d/media-session.conf

session.modules = {
    # These are the modules that are enabled when a file with
    # the key name is found in the media-session.d config directory.
    # the default bundle is always enabled.

    default = [
        flatpak                 # manages flatpak access
        portal                  # manage portal permissions
        v4l2                    # video for linux udev detection
        #libcamera              # libcamera udev detection
        suspend-node            # suspend inactive nodes
        policy-node             # configure and link nodes
        #metadata               # export metadata API
        #default-nodes          # restore default nodes
        #default-profile        # restore default profiles
        #default-routes         # restore default route
        #streams-follow-default # move streams when default changes
        #alsa-no-dsp            # do not configure audio nodes in DSP mode
        #alsa-seq               # alsa seq midi support
        #alsa-monitor           # alsa udev detection
        #bluez5                 # bluetooth support
        #bluez5-autoswitch      # automatic bluetooth HSP/HFP profile switch
        #restore-stream         # restore stream settings
        #logind                 # systemd-logind seat support
    ]

Part 2: /etc/pipewire/media-session.d/media-session.conf

        with-pulseaudio = [
        with-audio
        #bluez5
        #bluez5-autoswitch
        logind
        restore-stream
        streams-follow-default
    ]

4) The changes take effect after pipewire in the systemd user session gets at least restarted, after re-login or a reboot has taken place. In the journal / dmesg should be no pipewire related errors.

5) Verify media-session enabled options (* = enabled) or the bluez5 disabled ones (output reduced):

pipewire-media-session -h
    ...
	    bluez5         : bluetooth support
	    bluez5-autoswit: switch bluetooth profiles automatically
	  * suspend-node   : suspend inactive nodes
	  * policy-node    : configure and link nodes
    ...

6) After a new release of pipewire you diff the changes between your pipewire configuration files in /usr and /etc. If the diff is to much, you have to start from scratch, otherwise continue using it or make minor adaptations. Tools like meld, diff, colordiff are nice for that job.


Last point: please if you modify your config files and encounter any issues, make a backup of those pipewire config files, revert back to default behaviour. File bug reports with a standard default config, otherwise it's hard to even closely know what caused it.


----


The other work-around is to blacklist, even better to 'install /bin/false' or 'install /bin/true' the bluetooth kernel modules completely. If you prohibit the kernel from loading any bluetooth modules and accept the then harmless module loading errors in the journal, your system can load whatever *.service units it wants, because there is no hardware activation possible. Best combined with masking service units. At that point, really know what you are doing! smile

Offline

Board footer

Powered by FluxBB