( locsemege | 2021. 08. 29., v – 11:52 )

Szerkesztve: 2021. 08. 29., v – 11:55

Az utóbbi időben érdemi infót nem adtam ehhez a topic-hoz, csak az újabb verzió megjelenését jeleztem itt. Most azért van új infóm is. Az egyik, hogy míg korábban kizárólag SBC codec-kel volt hajlandó pipewire-ről működni a Panasonic mikro HiFi-m, addig most már megy az SBC-XQ és AAC is. Legutóbb, amikor néztem, az AAC összezagyválta a hangot, lényegében RAM-szemét ment a hangszórókra, de most már ez jó.

Amúgy ezek a lehetőségek:

bluez5.codecs = [ sbc sbc_xq aac ldac aptx aptx_hd aptx_ll aptx_ll_duplex faststream faststream_duplex ]

Illetve:

bluez5.headset-roles = [ hsp_hs hsp_ag hfp_hf hfp_ag ]

A másik érdekesség - legalább is nekem -, hogy VoIP telefonáláshoz sikerült felizgatnom a visszhang elnyomását, amely már implementálásra került. Az én esetemben ez úgy néz ki, hogy a

/etc/pipewire/media-session.d/media-session.conf

file-om az alábbi:

# Media session config file for PipeWire version "0.3.34" #
#
# Copy and edit this file in /etc/pipewire/media-session.d/
# for systemwide changes or in
# ~/.config/pipewire/media-session.d/ for local changes.

context.properties = {
    # Properties to configure the session and some
    # modules.
    #mem.mlock-all = false
    #support.dbus  = true
    #log.level     = 2
    #alsa.seq.name  = Midi-Bridge
}

context.spa-libs = {
    # Mapping from factory name to library.
    api.bluez5.*    = bluez5/libspa-bluez5
    api.alsa.*      = alsa/libspa-alsa
    api.v4l2.*      = v4l2/libspa-v4l2
    api.libcamera.* = libcamera/libspa-libcamera
}

context.modules = [
    #{   name = <module-name>
    #    [ args = { <key> = <value> ... } ]
    #    [ flags = [ [ ifexists ] [ nofail ] ]
    #}
    #
    # Loads a module with the given parameters.
    # If ifexists is given, the module is ignored when it is not found.
    # If nofail is given, module initialization failures are ignored.
    #
    # Uses RTKit to boost the data thread priority.
    {   name = libpipewire-module-rtkit
        args = {
            #nice.level   = -11
            #rt.prio      = 88
            #rt.time.soft = 2000000
            #rt.time.hard = 2000000
        }
        flags = [ ifexists nofail ]
    }

    # The native communication protocol.
    {   name = libpipewire-module-protocol-native }

    # Allows creating nodes that run in the context of the
    # client. Is used by all clients that want to provide
    # data to PipeWire.
    {   name = libpipewire-module-client-node }

    # Allows creating devices that run in the context of the
    # client. Is used by the session manager.
    {   name = libpipewire-module-client-device }

    # Makes a factory for wrapping nodes in an adapter with a
    # converter and resampler.
    {   name = libpipewire-module-adapter }

    # Allows applications to create metadata objects. It creates
    # a factory for Metadata objects.
    {   name = libpipewire-module-metadata }

    # Provides factories to make session manager objects.
    {   name = libpipewire-module-session-manager }

    {	name = libpipewire-module-echo-cancel
	args = {
	    # aec.method = webrtc
	    # node.latency = 1024/48000
	    source.props = {
		node.name = "Echo Cancellation Source"
	    }
	    sink.props = {
		node.name = "Echo Cancellation Sink"
	    }
	}
    }
]

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-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
    ]
    with-audio = [
        metadata
        default-nodes
        default-profile
        default-routes
        alsa-seq
        alsa-monitor
    ]
    with-alsa = [
        with-audio
    ]
    with-jack = [
        with-audio
    ]
    with-pulseaudio = [
        with-audio
        bluez5
        bluez5-autoswitch
        logind
        restore-stream
        streams-follow-default
    ]
}

A /etc-ben eredendően még pipewire alkönyvtár sincs. Nem baj, létre kell hozni, ahogyan a file elején ezt a comment javasolja. Eredetileg ez a file a /usr/share/pipewire/media-session.d alkönyvtárban található, de ne azt módosítsuk a frissítések miatt.

Két kicsit kellemetlen, de nem nagyon rossz tapasztalatom van vele. Az egyik, hogy ekkor a pipewire-media-session process elég nagy CPU időt eszik, az én esetemben ez most épp 13.2 %. A másik, hogy nem jegyzi meg, hogy a VoIP kliens az echo canceller sink-jét illetve source-ét használja, valamint azt sem, hogy az echo canceller kimenete melyik sink-re csatlakozzon, ha több audio kimenetet használunk egyszerre. Ezt tehát a Carla klienssel kell behuzaloznom minden használat előtt egyelőre. Vélhetően ez a saját hibám, ugyanis az az igen erős sejtésem, hogy a node-ok autodetect felépülését, a pipewire sejtését, hogy szerinte nekem hogyan lesz jó, vélhetően config file-ból felül tudom bírálni, s el tudom neki mesélni, hogy a VoIP kliens a visszhang elnyomó modulhoz csatlakozzon mindig. Ehhez még dokumentációt kell olvasnom.