# Audio non funziona con Pipewire    [Risolto]

## saverik

[/b]Ciao dopo l'ultimo aggiornamento l'audio ha smesso di funzionare.

Leggendo le news ho letto che si doveva scegliere tra Pulseaudio  o Pipewire come sound server.

Ho deciso di selezionare Pipewire ma ancora adesso non riesco a farlo funzionare.

Ho seguito https://www.gentoo.org/support/news-items/2022-07-29-pipewire-sound-server.html   fedelmente ma vi è qualcosa che mi sfugge.

precisamente ho usato questa procedura:

```
1. To use PipeWire for sound, users should enable USE=sound-server for PipeWire:

  Place the following entries in /etc/portage/package.use:

  ```

  media-video/pipewire sound-server

  media-sound/pulseaudio -daemon

  ```

  First, sync:

  # emerge --sync

  Deselect media-sound/pulseaudio-daemon:

  # emerge --deselect media-sound/pulseaudio-daemon

  Then perform a world upgrade with PipeWire on the command line to add

  it to the world file:

  # emerge --ask --update --changed-use --deep @world media-video/pipewire

  Then depclean:

  # emerge --ask --depclean

  OpenRC users on an XDG-compliant desktop which respects autostart files

  will not need to take any further action.

  OpenRC users using a minimal desktop which does not respect autostart

  files will need to run `gentoo-pipewire-launcher &` in e.g.

  `~/.xprofile`.

  Users who want to switch to PipeWire providing a PulseAudio daemon

  may need to `emerge --deselect` packages in their world file which

  hard-require media-sound/pulseaudio-daemon. There are only a handful

  of these. A non-exhaustive list:

  * media-sound/paprefs

  * media-sound/pasystray

  * media-sound/pulseaudio-modules-bt (shouldn't be needed anyway)

  * net-misc/pulseaudio-dlna

  If not using any of those packages anymore, please emerge --deselect

  them. If still using these, PipeWire as a PulseAudio is not an

  option at this time.

  (Note that media-libs/libpulse (which PipeWire will be using, don't emerge

  libpulse manually) provides 'pactl' which can be used as a replacement for

  e.g. media-sound/pulseaudio-ctl, so personal scripts can be adapted to this

  if desired.)

  systemd users will also need to run the following commands:

  $ systemctl --user --now disable pulseaudio.service pulseaudio.socket

  $ systemctl --user --now enable pipewire.socket pipewire-pulse.socket

  $ systemctl --user --now disable pipewire-media-session.service

  $ systemctl --user --force enable wireplumber.service

  

  Root user may replace --user with --global to change system default

  configuration for all of the above commands.
```

Praticamente non mi mostra i dispositivi di uscita

saluti

----------

## fedeliallalinea

Hai anche ricompilato i due pacchetti con le seguenti use

```
media-video/pipewire sound-server

media-sound/pulseaudio -daemon
```

  :Question: 

----------

## saverik

Si li ho aggiunti al package.use.

Ho seguito la procedura descritta nel link. https://www.gentoo.org/support/news-items/2022-07-29-pipewire-sound-server.html

terminando con .

```
  $ systemctl --user --now disable pulseaudio.service pulseaudio.socket

  $ systemctl --user --now enable pipewire.socket pipewire-pulse.socket

  $ systemctl --user --now disable pipewire-media-session.service

  $ systemctl --user --force enable wireplumber.service
```

googlando in giro  ho trovato questo se pùò servire:

```
magisterk@dell7940 ~ $ pactl info

Stringa server: /run/user/1000/pulse/native

Versione protocollo libreria: 35

Versione protocollo server: 35

Locale: sì

Indice client: 44

Dimensione tile: 65472

Nome utente: magisterk

Nome host: dell7940

Nome server: PulseAudio (on PipeWire 0.3.56)

Versione server: 15.0.0

Specifica di campionamento predefinita: float32le ch 2 48000 Hz

Mappa del canale predefinita: front-left,front-right

Sink predefinito: auto_null

Sorgente predefinita: auto_null.monitor

Cookie: 9999:b597

```

----------

## saverik

Allego lista componenti :

```
dell7940 /home/magisterk # lspci

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 08)

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)

00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 08)

00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)

00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)

00:15.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 (rev 21)

00:15.1 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #1 (rev 21)

00:15.2 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #2 (rev 21)

00:15.3 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #3 (rev 21)

00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)

00:16.3 Serial controller: Intel Corporation Sunrise Point-LP Active Management Technology - SOL (rev 21)

00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 (rev f1)

00:1c.2 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 (rev f1)

00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1)

00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1)

00:1f.0 ISA bridge: Intel Corporation Sunrise Point LPC Controller/eSPI Controller (rev 21)

00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)

00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)

00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)

00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (4) I219-LM (rev 21)

01:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader (rev 01)

02:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)

3c:00.0 Non-Volatile memory controller: ADATA Technology Co., Ltd. XPG SX8200 Pro PCIe Gen3x4 M.2 2280 Solid State Drive (rev 03)

```

----------

## saverik

Praticamente non mi trova i dispositivi audio.

Ho ricompilato il kernel e ricontrollato le flag dei driver nel kernel..

Tutto ok.

Non so cosa altro controllare.

sto pensando di attivare Pulseaudio e disattivare PipeWire.

----------

## saverik

per la compilazione del kernel ho usato :

```
genkernel  --makeopts=-j7 --install  --no-clean  --microcode-initramfs  --menuconfig all

```

e non ho inserito il firmware nel kernel  avendo usato 

```
--microcode-initramfs
```

 come opzioni di genkernel.

Forse questo passo è la causa di questo problema??

----------

## ænigma

Hai provato ad installare  pipewire-media-session?

----------

## saverik

Se può essere d'aiuto

```
ell7940 /home/magisterk # emerge --ask pipewire-media-session

These are the packages that would be merged, in order:

Calculating dependencies... done!

emerge: there are no ebuilds to satisfy "pipewire-media-session".

emerge: searching for similar names... nothing similar found.

dell7940 /home/magisterk # emerge --ask --depclean --verbose media-sound/pulseaudio-daemon

Calculating dependencies... done!

  media-sound/pulseaudio-daemon-16.1 pulled in by:

    media-libs/libpulse-16.1 requires media-sound/pulseaudio-daemon

>>> No packages selected for removal by depclean

Packages installed:   1019

Packages in world:    67

Packages in system:   43

Required packages:    1019

Number removed:       0

dell7940 /home/magisterk # exit

```

```
magisterk@dell7940 ~ $ systemctl --user status pipewire-pulse.service

● pipewire-pulse.service - PipeWire PulseAudio

     Loaded: loaded (/usr/lib/systemd/user/pipewire-pulse.service; disabled; vendor preset: enabled)

     Active: active (running) since Mon 2022-08-08 12:24:53 CEST; 2h 0min ago

TriggeredBy: ● pipewire-pulse.socket

   Main PID: 1313 (pipewire-pulse)

      Tasks: 2 (limit: 38357)

     Memory: 8.0M

        CPU: 562ms

     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service

             └─1313 /usr/bin/pipewire-pulse

ago 08 12:24:53 dell7940 systemd[1113]: Started PipeWire PulseAudio.

ago 08 12:24:53 dell7940 pipewire-pulse[1313]: mod.rt: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown

ago 08 12:24:53 dell7940 pipewire-pulse[1313]: mod.rt: could not set nice-level to -11: File o directory non esistente

ago 08 12:24:53 dell7940 pipewire-pulse[1313]: mod.rt: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown

ago 08 12:24:53 dell7940 pipewire-pulse[1313]: mod.rt: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown

ago 08 12:24:53 dell7940 pipewire-pulse[1313]: mod.rt: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown

ago 08 12:24:53 dell7940 pipewire-pulse[1313]: mod.rt: could not make thread 1318 realtime using RTKit: File o directory non esi>

ago 08 12:24:53 dell7940 pipewire-pulse[1317]: 536870912

magisterk@dell7940 ~ $ pipewire

[W][04955.531184] mod.rt       | [     module-rt.c:  259 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown

[W][04955.531624] mod.rt       | [     module-rt.c:  577 set_nice()] could not set nice-level to -11: File o directory non esistente

[W][04955.532678] mod.rt       | [     module-rt.c:  259 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown

[E][04955.533467] mod.protocol-native | [module-protocol-:  724 lock_socket()] server 0x55a07ecb3b10: unable to lock lockfile '/run/user/1000/pipewire-0.lock': Risorsa temporaneamente non disponibile (maybe another daemon is running)

[E][04955.533677] pw.conf      | [          conf.c:  560 load_module()] 0x55a07ec950f0: could not load mandatory module "libpipewire-module-protocol-native": Risorsa temporaneamente non disponibile

[E][04955.534029] default      | [      pipewire.c:  125 main()] failed to create context: Risorsa temporaneamente non disponibile

magisterk@dell7940 ~ $ 
```

----------

## saverik

Ho installato  rtkit e qualcosa è cambiato

```
magisterk@dell7940 ~ $ systemctl --user status pipewire-pulse.service

● pipewire-pulse.service - PipeWire PulseAudio

     Loaded: loaded (/usr/lib/systemd/user/pipewire-pulse.service;enabled;] vendor preset: enabled)

     Active: active (running) since Tue 2022-08-09 00:13:37 CEST; 1min 19s ago

TriggeredBy: ● pipewire-pulse.socket

   Main PID: 1120 (pipewire-pulse)

      Tasks: 2 (limit: 38357)

     Memory: 4.1M

        CPU: 19ms

     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service

             └─1120 /usr/bin/pipewire-pulse

ago 09 00:13:37 dell7940 systemd[1111]: Started PipeWire PulseAudio.

ago 09 00:13:37 dell7940 pipewire-pulse[1149]: 536870912

magisterk@dell7940 ~ $ pipewire

[E][00113.900804] mod.protocol-native | [module-protocol-:  724 lock_socket()] server 0x55b5c0e73210: unable to lock lockfile '/run/user/1000/pipewire-0.lock': Risorsa temporaneamente non disponibile (maybe another daemon is running)

[E][00113.901107] pw.conf      | [          conf.c:  560 load_module()] 0x55b5c0e580f0: could not load mandatory module "libpipewire-module-protocol-native": Risorsa temporaneamente non disponibile

[E][00113.901298] default      | [      pipewire.c:  125 main()] failed to create context: Risorsa temporaneamente non disponibile

magisterk@dell7940 ~ $ 

```

----------

## saverik

Aggiornamento:

sono passato a pulseaudio in quanto non riuscivo ad avere l'audio funzionante.

Dopo il riavvio ho avuto lo stesso problema di 

```
nessuna periferica audio disponibile
```

.

A questo punto penso che il problema fosse il file /etc/pulse/client.conf la cui opzione 

```
autospawn=no
```

 impediva il riconoscimento di periferica audio .

Dopo averlo settato su 

```
autospawn=yes
```

 il  sistema ha riconosciuto  le periferiche audio.

allego il file /etc/pulse/client.conf  nel caso fosse di aiuto a qualcuno:

```

# This file is part of PulseAudio.

#

# PulseAudio is free software; you can redistribute it and/or modify

# it under the terms of the GNU Lesser General Public License as published by

# the Free Software Foundation; either version 2 of the License, or

# (at your option) any later version.

#

# PulseAudio is distributed in the hope that it will be useful, but

# WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

# General Public License for more details.

#

# You should have received a copy of the GNU Lesser General Public License

# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

## Configuration file for PulseAudio clients. See pulse-client.conf(5) for

## more information. Default values are commented out.  Use either ; or # for

## commenting.

; default-sink =

; default-source =

; default-server =

; default-dbus-server =

autospawn = yes

; daemon-binary = /usr/bin/pulseaudio

; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes

; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no

; auto-connect-display = no

```

.

Per adesso,visto che ho impiegato tantissimo tempo per avere l'audio funzionante, penso di non fare ulteriori prove con pipewire quindi classificherò qusto thread come NON RISOLTO.

----------

## bandreabis

Mi spiace dare contributo zero alla discussione, ma volevo segnalare anche io avevo provato pipewire (per alcuni problemi audio di poco conto) mesi fa (prima della news) e ero rimasto senza sonoro. Sono tornato al solo pulseaudio.

Solo che ora non ho il suono del logon di KDE (chissà se c'è correlazione).

Per ora non ho seguito nessuna delle procedure indicate nella News.

Ma credo che dovrò farlo prima o poi.

----------

## saverik

Aggiornamento:

Dovendo reinstallare il sistema  ho optato per   

```
kde-plasma + pipewire
```

.

Ho installato pipewire dalla guida  https://wiki.gentoo.org/wiki/PipeWire .

Come applet per controllo volume kde-plasma/plasma-pa ed ho solo modificato   il file 

```
/etc/pulse/client.conf
```

  settando  il valore 

```
autospawn=yes
```

.

E tutto funziona veramente bene.

Saluti

----------

## messana

Grazie infinite per la soluzione. Configurando il file config di pulseaudio come indicato ho risolto i problemi di acquisizione audio con obs-studio audacity ecc.., inoltre ho risolto il problema delle cuffie bluetooth che non funzionavano.

----------

