Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Plötzlich unerwünschtes Verhalten Bluetooth Audio Management
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Erdie
Advocate
Advocate


Joined: 20 May 2004
Posts: 2629
Location: Heidelberg - Germany

PostPosted: Tue Aug 13, 2024 9:32 am    Post subject: Plötzlich unerwünschtes Verhalten Bluetooth Audio Management Reply with quote

Hallo,
bei mit läuft bekanntermaßen KDE Plasma / Pipewire.

Beschreibung des Problems:

1. Wie es bisher funktionierte:

Wenn ich ein Bluetooth Kopfhörer verbinde, wird diese automatisch zur Default Audio Ausgabe und man kann sofort loslegen. Wenn ich ihn trenne, schaltet das Audiosystem automatisch zur Soundkarte zurück, welche zuvor aktiv war. Das ist in meinem Fall ein USB Audio Device. Zusätzlich gibt es noch den Motherboard Sound Chip. Dieser ist weiterhin aktiv, aber nicht selektiert.

2. Seit einiger Zeit hat sich das Verhalten geändert:

Wenn ich den Kopfhörer verbinde, wird er nicht automatisch aktiv, ich muß ihn meistens noch extra in den Soundeinstellungen auswählen, damit es funktioniert. Wenn ich den Kopfhörer trenne, springt das System auf die Onboard Soundkarte zurück und nicht auf das USB Device, welches vorher aktiv war. Das ist ärgerlich, da ich immer nochmal manuell eingreifen muss.

Ich möchte nochmal anmerken, dass es lange Zeit wie in 1. funktionert hat. Seit einem bestimmten Update hat sich das Verhalten auf 2. geändert und ich habe keine Möglichkeit gefunden, das irgendwie via Konfiguration zu ändern, dass es wieder wie in 1. verhält.

Gibt es eine Möglichkeit, dem Bluetooth / Audio System zu erklären in beiden Fällen (Bluetooth aktiv / inaktiv) ein bestimmten Default zu nutzen und nicht das, wozu es gerade mal Lust hat?
_________________
Desktop AMD Ryzen 9 5900X 32GB RAM, Asus GF GTX 1060.
Notebook Tuxedo Pulse 15 Gen1 AMD Ryzen 7 4800H mit Radeon Vega 7
Raspberry Pi 1 + 2 + 3B+ + Zero W
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4653
Location: Germany

PostPosted: Sat Sep 28, 2024 12:52 pm    Post subject: Reply with quote

Hi,
dein gewünschtes default device kann man vermutlich im WirePlumber setzen.
Schau dazu mal im
Code:
$ wpctl status
und
Code:
$ wpctl --help
Ich denke mit "set-default ID" sollte sich dann der gewünschte Sink setzen lassen.
Back to top
View user's profile Send private message
firefly
Watchman
Watchman


Joined: 31 Oct 2002
Posts: 5291

PostPosted: Sat Sep 28, 2024 3:31 pm    Post subject: Reply with quote

Erdie wrote:

Wenn ich den Kopfhörer verbinde, wird er nicht automatisch aktiv, ich muß ihn meistens noch extra in den Soundeinstellungen auswählen, damit es funktioniert. Wenn ich den Kopfhörer trenne, springt das System auf die Onboard Soundkarte zurück und nicht auf das USB Device, welches vorher aktiv war. Das ist ärgerlich, da ich immer nochmal manuell eingreifen muss.

Kann es sein, dass durch das update das USB device eine andere alsa "sndcard id" bekommt als vorher?
Ich könnte mir folgendes vorstellen.
Vor dem update bekam das USB device die "sdncard id" 0 und die onboard karte die ID 1
Und wenn das bluetooth device wegfällt wird vermutlich automatisch das erste device (mit der niedrigsten ID) genommen.

Die aktuelle ID/Slot für die einzelnen treiber kann man aus /proc/asound/modules lesen

Man kann den kernel modulen einen modul parameter index mitgeben über welchen man die reihenfolge von mehreren sound devices festlegen kann
siehe ABschnitt "How to choose a particular order for multiple installed cards" (leider funktionieren die top links nicht, um direkt zu dem punkt zu springen)
https://alsa.opensrc.org/MultipleCards

Um dein gewünschtes setup zu erhalten könnte es sein, dass du den treiber für das bluetooth device als erstes device (slot 0) definierst und danach das usb device.

Eine kurze suche nach "pipewire define fallback device and default device" hat folgendes ergeben.
Scheinbar kann man auch in pipewire prioritäten festlegen für einzelne devices.
Gut möglich dass bei dir sich diese Prioritäten geändert haben durch das update.

https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/247
https://blog.zenlinux.com/2022/08/how-to-configure-audio-device-priorities-in-pipewire-wireplumber/
_________________
Ein Ring, sie zu knechten, sie alle zu finden,
Ins Dunkel zu treiben und ewig zu binden
Im Lande Mordor, wo die Schatten drohn.
Back to top
View user's profile Send private message
Erdie
Advocate
Advocate


Joined: 20 May 2004
Posts: 2629
Location: Heidelberg - Germany

PostPosted: Tue Oct 01, 2024 4:24 pm    Post subject: Reply with quote

Danke, das werde ich mir genauer anschauen!
_________________
Desktop AMD Ryzen 9 5900X 32GB RAM, Asus GF GTX 1060.
Notebook Tuxedo Pulse 15 Gen1 AMD Ryzen 7 4800H mit Radeon Vega 7
Raspberry Pi 1 + 2 + 3B+ + Zero W
Back to top
View user's profile Send private message
Erdie
Advocate
Advocate


Joined: 20 May 2004
Posts: 2629
Location: Heidelberg - Germany

PostPosted: Sun Oct 06, 2024 2:48 pm    Post subject: Reply with quote

"wpctl status" sagt:

Code:

PipeWire 'pipewire-0' [1.2.3, martin@kellerkind, cookie:355635105]
 └─ Clients:
        33. xdg-desktop-portal                  [1.2.3, martin@kellerkind, pid:3733]
        34. pipewire                            [1.2.3, martin@kellerkind, pid:3996]
        35.                                     [1.2.3, martin@kellerkind, pid:3792]
        37. WirePlumber                         [1.2.3, martin@kellerkind, pid:3966]
        49. WirePlumber [export]                [1.2.3, martin@kellerkind, pid:3966]
        68. libcanberra                         [1.2.3, martin@kellerkind, pid:3905]
        69. plasmashell                         [1.2.3, martin@kellerkind, pid:3905]
        70.                                     [1.2.3, martin@kellerkind, pid:3905]
        71. akonadi_newmailnotifier_agent       [1.2.3, martin@kellerkind, pid:4489]
        77. libcanberra                         [1.2.3, martin@kellerkind, pid:3792]
        79. mpv                                 [1.2.3, martin@kellerkind, pid:7236]
        89. Strawberry device finder            [1.2.3, martin@kellerkind, pid:29626]
       103. wpctl                               [1.2.3, martin@kellerkind, pid:20210]
       167. mpv                                 [1.2.3, martin@kellerkind, pid:19604]

Audio
 ├─ Devices:
 │      50. GP106 High Definition Audio Controller [alsa]
 │      51. UMC202HD 192k                       [alsa]
 │      52. Starship/Matisse HD Audio Controller [alsa]
 │ 
 ├─ Sinks:
 │  *   58. UMC202HD 192k Line A                [vol: 0.45]
 │      59. Starship/Matisse HD Audio Controller Analog Stereo [vol: 1.00]
 │ 
 ├─ Sources:
 │      46. UMC202HD 192k Input 1               [vol: 1.00]
 │  *   57. UMC202HD 192k Input 2               [vol: 1.00]
 │ 
 ├─ Filters:
 │ 
 └─ Streams:
        72.                                                             
            100. monitor_FR     
            122. monitor_FL     
            139. input_FR        < mpv:output_FR        [active]
            255. input_FL        < mpv:output_FL        [active]
        81. mpv                                                         
             80. output_FR       > :input_FR    [active]
             83. output_FL       > :input_FL    [active]
        90.                                                             
            115. input_FL        < mpv:output_FL        [active]
            116. monitor_FL     
            117. input_FR        < mpv:output_FR        [active]
            118. monitor_FR     
        94.                                                             
             78. input_FR        < mpv:output_FR        [active]
             85. monitor_FR     
            150. monitor_FL     
            166. input_FL        < mpv:output_FL        [active]
        95.                                                             
            141. monitor_FL     
            142. input_FL        < mpv:output_FL        [active]
            145. input_FR        < mpv:output_FR        [active]
            149. monitor_FR     
        96.                                                             
             73. monitor_FL     
             75. input_FL        < mpv:output_FL        [active]
             99. monitor_FR     
            189. input_FR        < mpv:output_FR        [active]
       101.                                                             
            155. monitor_FL     
            160. monitor_FR     
            161. input_FL        < mpv:output_FL        [active]
            162. input_FR        < mpv:output_FR        [active]
       104.                                                             
             88. monitor_FR     
            196. monitor_FL     
            197. input_FL        < mpv:output_FL        [active]
            198. input_FR        < mpv:output_FR        [active]
       106.                                                             
            107. input_FR        < mpv:output_FR        [active]
            135. monitor_FL     
            168. monitor_FR     
            192. input_FL        < mpv:output_FL        [active]
       108.                                                             
            129. input_FL        < mpv:output_FL        [active]
            130. monitor_FL     
            131. input_FR        < mpv:output_FR        [active]
            132. monitor_FR     
       125. mpv                                                         
             98. output_FL       > UMC202HD 192k:playback_FL    [paused]
            268. output_FR       > UMC202HD 192k:playback_FR    [paused]
       137.                                                             
            151. monitor_FR     
            158. monitor_FL     
            159. input_FL        < mpv:output_FL        [active]
            163. input_FR        < mpv:output_FR        [active]
       156.                                                             
            194. input_FR        < mpv:output_FR        [active]
            239. monitor_FR     
            241. monitor_FL     
            249. input_FL        < mpv:output_FL        [active]
       213.                                                             
            109. monitor_FL     
            185. input_FR        < mpv:output_FR        [active]
            207. input_FL        < mpv:output_FL        [active]
            210. monitor_FR     

Video
 ├─ Devices:
 │ 
 ├─ Sinks:
 │ 
 ├─ Sources:
 │ 
 ├─ Filters:
 │ 
 └─ Streams:

Settings
 └─ Default Configured Devices:
         0. Audio/Sink    alsa_output.usb-BEHRINGER_UMC202HD_192k-00.HiFi__Line1__sink
         1. Audio/Source  alsa_input.usb-BEHRINGER_UMC202HD_192k-00.HiFi__umc202hd_mono_U192k_0_0__source


es sieht so aus, als ob das gewünschte Device schon default ist.


"cat /proc/asound/cards" sagt:

Code:

 0 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfc080000 irq 86
 1 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfca00000 irq 88
 2 [U192k          ]: USB-Audio - UMC202HD 192k
                      BEHRINGER UMC202HD 192k at usb-0000:06:00.1-2, high speed


Hier kann man sehen, dass zwar Nvida das 0te Device ist und danach kommt das onboard Device. Nvidia ist deaktiviert. Von daher kann die Theorie stimmen, dass das Fallback auf Device 1 stattfindet und nicht, wie gewünscht, Device 2.

Ich werde jetzt mal herausfinden, wie die diese IDs laut Firefly's Beschreibung ändern kann.
_________________
Desktop AMD Ryzen 9 5900X 32GB RAM, Asus GF GTX 1060.
Notebook Tuxedo Pulse 15 Gen1 AMD Ryzen 7 4800H mit Radeon Vega 7
Raspberry Pi 1 + 2 + 3B+ + Zero W
Back to top
View user's profile Send private message
Erdie
Advocate
Advocate


Joined: 20 May 2004
Posts: 2629
Location: Heidelberg - Germany

PostPosted: Sun Oct 06, 2024 4:19 pm    Post subject: Reply with quote

Mein /etc/modprobe.de/alsa.conf sieht folgendermaßen aus:

Code:

# Alsa kernel modules' configuration file.

# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
##
##  ALSA portion
alias snd-card-0 snd-hda-intel
#alias snd-card-1 snd-usb-audio
#alias snd-card-1 snd-ice1712
##  OSS/Free portion
alias sound-slot-0 snd-card-0
alias sound-slot-1 snd-card-1
##

# OSS/Free portion - card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
##  OSS/Free portion - card #2
#alias sound-service-1-0 snd-mixer-oss
#alias sound-service-1-1 snd-seq-oss
#alias sound-service-1-3 snd-pcm-oss
#alias sound-service-1-8 snd-seq-oss
#alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.
options snd cards_limit=3

#alias snd-card-0 snd-hda-intel
#alias snd-card-1 snd-hdsp
#alias sound-slot-0 snd-hda-intel
#alias sound-slot-1 snd-hdsp

#options snd-hda-intel index=0
#options snd-usb-audio index=1
#options snd-hda-intel position_fix=3

#options snd slots=snd-hda-intel,snd-aloop



Wenn ich hier die beiden Zeilen:

#options snd-hda-intel index=0
#options snd-usb-audio index=1

auskommentiere und den Index vertausche, verschwinden alle Einträge in der Pipewire Audiokonfiguration mit Ausnahme von "Line-in", das scheint der line in der Onboard Karte zu sein, denn ich kann noch was hören. Aber irgendwas stimmt dann nicht mehr.

Die Sachen mit ice1712 sind Altlasten, die ich noch nicht entsorgt habe.
_________________
Desktop AMD Ryzen 9 5900X 32GB RAM, Asus GF GTX 1060.
Notebook Tuxedo Pulse 15 Gen1 AMD Ryzen 7 4800H mit Radeon Vega 7
Raspberry Pi 1 + 2 + 3B+ + Zero W
Back to top
View user's profile Send private message
Erdie
Advocate
Advocate


Joined: 20 May 2004
Posts: 2629
Location: Heidelberg - Germany

PostPosted: Sun Oct 06, 2024 4:23 pm    Post subject: Reply with quote

firefly wrote:
Um dein gewünschtes setup zu erhalten könnte es sein, dass du den treiber für das bluetooth device als erstes device (slot 0) definierst und danach das usb device.


Das muss ein Missverständnis sein, denn ich möchte ja ein Fallback auf die USB Karte, wenn Bluetooth getrennt wird. Früher war das so, dass Pipewire immer das Device genommen hat, das vorher aktiv war. Zumindest kam es mir so vor und jetzt wird immer das gleiche genommen, was bei mir "ALCS1200A Analog" bzw. der Line-out der Onboard Karte ist.
_________________
Desktop AMD Ryzen 9 5900X 32GB RAM, Asus GF GTX 1060.
Notebook Tuxedo Pulse 15 Gen1 AMD Ryzen 7 4800H mit Radeon Vega 7
Raspberry Pi 1 + 2 + 3B+ + Zero W
Back to top
View user's profile Send private message
firefly
Watchman
Watchman


Joined: 31 Oct 2002
Posts: 5291

PostPosted: Sun Oct 06, 2024 6:54 pm    Post subject: Reply with quote

Die index syntax ist auch die "alte" (steht auch so in dem verlinkten hilfe von alsa opensrc org)
Die neue ist die slot syntax

Wobei das problem bei dir auch noch ist, das zwei audio devices den selben treiber nutzen (hier snd-hda-intel) daher musst du eventuell für beide devices den index/slot setzen.
Falls du das mit alsa nicht hinbekommst dann verändere doch die priorität in pipewire für die devices
_________________
Ein Ring, sie zu knechten, sie alle zu finden,
Ins Dunkel zu treiben und ewig zu binden
Im Lande Mordor, wo die Schatten drohn.
Back to top
View user's profile Send private message
firefly
Watchman
Watchman


Joined: 31 Oct 2002
Posts: 5291

PostPosted: Sun Oct 06, 2024 7:01 pm    Post subject: Reply with quote

Erdie wrote:
firefly wrote:
Um dein gewünschtes setup zu erhalten könnte es sein, dass du den treiber für das bluetooth device als erstes device (slot 0) definierst und danach das usb device.


Das muss ein Missverständnis sein, denn ich möchte ja ein Fallback auf die USB Karte, wenn Bluetooth getrennt wird. Früher war das so, dass Pipewire immer das Device genommen hat, das vorher aktiv war. Zumindest kam es mir so vor und jetzt wird immer das gleiche genommen, was bei mir "ALCS1200A Analog" bzw. der Line-out der Onboard Karte ist.

Nein das ist korrekt, wenn die Annahme stimmt das zu dem nächsten sound device mit der niedrigsten ID gewechselt wird, wenn die aktuelle weg fällt.
Denn wenn das bluetooth device immer id 0 hat denn wird es als default genutzt, wenn es vorhanden ist und ansonsten die onboard karte mit id 1.

Wobei wohl die slot syntax hier besser it als die index syntax, weil durch die slot syntax man die id fix setzen kann für einen treiber egal ob das device aktuell vorhanden ist oder nicht
_________________
Ein Ring, sie zu knechten, sie alle zu finden,
Ins Dunkel zu treiben und ewig zu binden
Im Lande Mordor, wo die Schatten drohn.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum