From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KPglKD0/tGOE+wAAbAwnHQ (envelope-from ) for ; Tue, 03 Jan 2023 15:44:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aGUfJz0/tGO8aAEAG6o9tA (envelope-from ) for ; Tue, 03 Jan 2023 15:44:13 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ECD0FDDED for ; Tue, 3 Jan 2023 15:44:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCiWL-0003qF-1D; Tue, 03 Jan 2023 09:44:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCiWI-0003q5-Hm for guix-patches@gnu.org; Tue, 03 Jan 2023 09:44:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pCiWI-0002YH-9a for guix-patches@gnu.org; Tue, 03 Jan 2023 09:44:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCiWH-0007WN-Po for guix-patches@gnu.org; Tue, 03 Jan 2023 09:44:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59866] Pulseaudio woes References: In-Reply-To: Resent-From: mirai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 Jan 2023 14:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59866 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59866 <59866@debbugs.gnu.org> Cc: Liliana Marie Prikler Received: via spool by 59866-submit@debbugs.gnu.org id=B59866.167275702028875 (code B ref 59866); Tue, 03 Jan 2023 14:44:01 +0000 Received: (at 59866) by debbugs.gnu.org; 3 Jan 2023 14:43:40 +0000 Received: from localhost ([127.0.0.1]:45032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCiVr-0007Vc-S5 for submit@debbugs.gnu.org; Tue, 03 Jan 2023 09:43:39 -0500 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]:38368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCiVl-0007VP-Jd for 59866@debbugs.gnu.org; Tue, 03 Jan 2023 09:43:33 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id ADFC620BE5; Tue, 3 Jan 2023 15:43:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 357CF80096; Tue, 3 Jan 2023 15:43:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rmK9p6p4dvEO; Tue, 3 Jan 2023 15:43:23 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7463280093; Tue, 3 Jan 2023 15:43:23 +0100 (CET) Message-ID: Date: Tue, 3 Jan 2023 14:43:23 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Content-Language: en-US From: mirai Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672757053; a=rsa-sha256; cv=none; b=tu9uMvXaxlBeZVLBFQfUazmiGvn4b/uatyqh9ezCsl1TBHP7ZdC38sdIwooHubsBQ90gWs 6INVrfTcM/ax94sFktLhsUrzJkwVYMnZxn7jyg1eueVibe9Jd2anbGebj0YOZcfuRc4PmM FdzqUR40AMKSOfD2/tp7XBkImEcaKc7M8UQdAGuIGdcD3frOSxiyJYy3hVLmDBgYRmb5iP DLY+1RUnFAnGbFpYosDMfZxAljLDf4TYu3QRlMM+jla8m3evFgXmctwEqtN9QoRmlfkets r03z4y0651qpXGwPJnIyuG6+IFH1zY7giKoLeaFhtsZm+fuLYy9EHOGFn16MZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672757053; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=PlWkbHB+iUmAdqRpKGs8lN23F7mrjmNWwceP80gQl4M=; b=n7yVmXBe9sP/VdusMhrKXmtXiB/hn+aKMtMTf5tigKQc0IyJP0IGonXbxe6qGDFUPDB14P QyPxQUKlNUk3izA89kA2CyD8XIsaWtgeq1Txm6HoY0+OTOdBlhKHaADIXkLL3lOxnFjstk QugZW0o5vrLfMOrjV6J+vwLgizIqrGpsi6brvf0Lm3LKlVzbofMqIVMBUJA2gN0iHGG0IA Buus9jRRPd8AOP7aymwJVAVofr6Xm3BtAJcZHBzudC7JTI3aqgXk7+K6GkE4yuTONFUkqQ D26bT8Y58InKAiggwJDKHfrWYGEsfzur66ElYYr/8raY9H1kEF1qXxsWsdzQPg== X-Spam-Score: -4.36 X-Migadu-Queue-Id: ECD0FDDED Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -4.36 X-TUID: bKScP0qcj1kK I've found out that this service (even before this patch-set) is biased towards being used as a home service rather than a system service. The reason is that it sets the XDG_RUNTIME_DIR environment variable through shepherd to: --8<---------------cut here---------------start------------->8--- (list (string-append "XDG_RUNTIME_DIR=/run/user/" (number->string (passwd:uid (getpwnam #$user))))) --8<---------------cut here---------------end--------------->8--- This directory does not exist if this is launched as a system-wide service. I presume that this went unnoticed because most of the times you'd want to use this service system-wide you also configure this either as a MPD 'satellite instance' or the audio-outputs are always network-streaming ones. This falls apart if you configure a system-wide mpd-service with a pulseaudio output as it will try to access XDG_RUNTIME_DIR which is not created for the system? #t 'mpd' user. Now, pulseaudio is usually launched as a 'per-user' daemon although it can be used in a system-pulse configuration though this is strongly discouraged. Under most conditions (pulseaudio config mostly unchanged), a system-wide mpd-service-type is also able to launch its own pulse instance but due to the inherent assumptions present in the original service we have that: - The XDG_RUNTIME_DIR env var is set when it should only be set for 'system? #f' users. - PULSE_CLIENTCONFIG and PULSE_CONFIG are not set by shepherd. These usually correspond to: PULSE_CONFIG =/etc/pulse/client.conf PULSE_CONFIG=/etc/pulse/daemon.conf But if you use mpd-service-type as a home service, you could also have these set to a user-specific pulse config, which will be overridden by shepherd if these are set in mpd-service-type. But again, if you don't set these env vars and use it as a systemwide service with a pulseaudio output and you workaround the XDG_RUNTIME_DIR by unsetting it, your pulse daemon won't read its config and there will be no output. This is not just a theoretical issue, consider this snippet: --8<---------------cut here---------------start------------->8--- ;; Set a systemwide mpd service that streams with pulseaudio RTP output. (service pulseaudio-service-type (pulseaudio-configuration (extra-script-files (list (plain-file "rtp.pa" (string-join (list "load-module module-null-sink sink_name=rtp" "load-module module-rtp-send source=rtp.monitor" "set-default-sink rtp") "\n" 'suffix)))))) (service mpd-service-type (mpd-configuration (outputs (list (mpd-output (name "Pulseaudio over RTP") (type "pulse") (extra-options '((sink . "rtp"))))))) --8<---------------cut here---------------end--------------->8--- The problem here is how to conditionally select which environment variables should be set based on whether this is being launched as a system-wide or home-instance service. I'm all ears for suggestions. Regarding the current patch-set, I'm thinking that some of the non-public procedures could be defined with 'define-deprecated' instead which should (?) be cleaner than the current comments that are demarcating deprecated code. Regards, Bruno