s6 Implementation in antiX – Pipewire, Volumeicon

Forum Forums General Tips and Tricks s6 Implementation in antiX – Pipewire, Volumeicon

  • This topic has 7 replies, 3 voices, and was last updated Feb 10-3:23 am by ProwlerGr.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #128404
    Member
    olsztyn

      As I am on the s6 antiX topic but not yet familiar with s6 architecture, one important question comes to my mind, namely whether s6 can help pipewire implementation…

      Just to refresh our path before we have arrived at pipewire sound working properly for antiX:

      – Initially, when antiX 23 was released (August 26, 2023), Pipewire sound components (pipewire, wireplumber, pipewire-pulse) were (all three) started from Pipewire-Start script, run from Desktop-Session-Startup file. The unfortunate result of such pipewire start method was that sometimes sound did not work after antiX boot, for some users. The reason for this was that the wireplumber component failed to initiate, due to pipewire process not fully started yet. This was because pipewire-start script just started all three pipewire c
      omponents but was not able to sequence them so wireplumber starts after pipewire process is already happily running.
      – A fundamental solution to this popular sound issue was designed by @abc-nix, where just pipewire component was started from desktop-session-sturtup file and the remaining components (wireplumber, pipewire-pulse) were started by pipewire process itself, specified in pipewire config file. This design, along with some additional tweaks practically resolved pipewire sound issues.

      However one initially very popular issue appears to remain just bandaged:
      – Volumeicon applet, which is started from desktop-session-startup, is highly dependent on wireplumber process readiness, otherwise it does not appear. So a user may have discovered that sound was working after boot but no volumeicon to control. There is a popular thread on volumeicon issue in this forum…
      – A ‘sleep’ workaround have been put in place before volumeicon start, to wait for wireplumber. Some users reported sleep as long as 10 sec. necessary for volumeicon to come up. In result, after booting antiX to desktop, another up to 10 seconds elapsed before such users were happy to see the volumeicon finally appear. My individual implementation ended up with not using volumeicon applet as provided in antiX but the volume icon included in LXPanel on Openbox instead.

      Having summarized the above history with antiX 23 pipewire sound implementation my question to our antiX s6 team is:

      Considering the need to sequence some processes, so one process can be started only after another process is ready, such as starting volumeicon after wireplumber has been completely initiated: Can s6 provide this process sequencing capability?
      Understandably these are not services s6 deals with normally… There must be a better way than the ugly ‘sleep’ band-aid, implemented in init system other than systemd…

      • This topic was modified 3 months, 2 weeks ago by olsztyn.
      • This topic was modified 3 months, 2 weeks ago by olsztyn.

      Live antiX Boot Options (Previously posted by Xecure):
      http://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

      #132608
      Member
      storm-crow

        Haven’t used pipewire, just using pulseaudio+alsa+pavucontrol, but was running into similar issues. The best solution was to keep them running in series, so starting pulseaudio ended before volumeicon began. my desktop-session file ended up like this

        ## Uncomment if using pulseaudio (you need to install it). Make sure it starts before volumeicon.
        #need a single thread that forks in order to gaurantee pulse is running
        (pulseaudio -D; volumeicon)&

        I know this isnt quite what you’re looking for, but a similar solution may let you do this with pipewire without using s6.

        #132639
        Member
        olsztyn

          need a single thread that forks in order to gaurantee pulse is running

          Interesting… So this

          (pulseaudio -D; volumeicon)&

          ensures that volumeicon is started after pulseaudio is fully initialized?

          Just asking out of curiosity, because with pipewire it is more complex design now. Pipewire is started from desktop startup and in turn starts pipewire-pulse and wireplumber. It is the wireplumber that must be fully started before volumeicon, otherwise volumeicon will fail. Common bandaid is to add ‘sleep 5’, which is not elegant solution and not always sufficient for some.
          I have much less of such problem and use sleep 1, but I am not using that volumeicon, just volume icon asapplet from lxpanel,which is much faster.

          Live antiX Boot Options (Previously posted by Xecure):
          http://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

          #132644
          Member
          storm-crow

            Just asking out of curiosity, because with pipewire it is more complex design now. Pipewire is started from desktop startup and in turn starts pipewire-pulse and wireplumber. It is the wireplumber that must be fully started before volumeicon, otherwise volumeicon will fail. Common bandaid is to add ‘sleep 5’, which is not elegant solution and not always sufficient for some.
            I have much less of such problem and use sleep 1, but I am not using that volumeicon, just volume icon asapplet from lxpanel,which is much faster.

            Normally, the ‘&’ s in the config file fork each startup task into its own thread, but this is enough to make sure that it opens the volume icon only after the “pulseaudio -D” command has been fully executed (ie, pulseaudio is running). I havent used pipewire, but im assuming that its similar. you might want to try

            (pipewire; lxpanel) &
            as a line in your desktop-session startup, instead of having
            lxpanelor lxpanel & as its own line. that way, it begins the pipewire process decidedly before it starts lxpanel (basically, avoiding race conditions).

            let me know if this works, I will admit that I am not an expert, just dealing with similar issues on different software.

            • This reply was modified 2 months, 1 week ago by storm-crow.
            #132648
            Member
            olsztyn

              Thanks for these ideas. I will certainly play with various options. No longer critical but just trying to get even closer to perfection of antiX setup…
              Greatly appreciate your advice.

              Live antiX Boot Options (Previously posted by Xecure):
              http://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

              #132650
              Member
              ProwlerGr

                s6-rc handles service dependencies automatically – once dependencies have been correctly set.
                If you set-up an s6-rc service file for ‘pipewire’ then an s6-rc service file for ‘wireplumber’ listing ‘pipewire’ as a dependency, & a service file for ‘volume-icon’ listing ‘wireplumber’ as a dependency, you just need to bring-up ‘volume-icon’, & this will automatically bring up ‘pipewire’ & ‘wireplumber’ before launching ‘volume-icon’.

                Likewise you just need to define ‘volume-icon’ in the “default” bundle (which governs startup services), and it is a given that ‘pipewire’ & ‘wireplumber’ will also be started at every boot in the correct sequence, even if they aren’t defined as contents of the “default” bundle.

                Once s6-rc is set-up correctly it operates very similar as ‘apt’ does for packaging.

                #132654
                Member
                olsztyn

                  s6-rc handles service dependencies automatically – once dependencies have been correctly set.

                  Is this different than services in runit?
                  Although I do not think such services for pipewire components were ever developed for runit, although anticapitalista, who is the antiX owner would know better…
                  Thanks very much for the s6 info. Greatly appreciated…
                  Hopefully antiX will officially include s6 very soon.

                  Live antiX Boot Options (Previously posted by Xecure):
                  http://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

                  #132655
                  Member
                  ProwlerGr

                    Is this different than services in runit?

                    Many similarities between s6-rc & runit, but runit has some shortcomings & is not being developed any more.
                    s6-rc-why

                    There is a wealth of s6-rc service files at Artix’s git many of which can be transplanted to antiX with minor modifications.
                    Also creating execline scripts for services that have been previously set-up in sysvinit, or have systemd unit files in debian isn’t that difficult in the majority of cases.

                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.