a.slo...@bham.ac.uk said on Tue, 10 Jan 2023 01:59:46 GMT

>Steve, I wonder if you can help me.
>
>After I wrote:
>
>>My ctwm setup was clobbered when I moved to Fedora 37 because
>>pulseaudio is being replaced by pipewire, and I invoke pulseaudio both
>>in .ctwmrc (starting up audio) and in menus, e.g. invokin the
>>pulseaudio control panel.  
>
>you wrote:
>
>> Why not just use ALSA? That's what I do, and except for a few
>> snowflake programs like Zoom, everything works fine.  
>
>I had hoped I could tinker with my existing configuration to restore
>sound output but so far nothing has worked.
>
>    including use of alsamixer
>
>    which now complains: cannot open mixer: Host is down

My guess is you either didn't install all of ALSA, or you're not
running the ALSA daemon. The following is the content of my runit init
system ALSA daemon:

==========================
#!/bin/sh
set -e
alsactl restore
exec chpst -b alsa pause
==========================

The chpst command is a runit program that runs the daemon as a specific
user, in this case user alsa. I'm not sure what the set -e does.

Also, when the daemon is stopped, the following finish script is run:

==========================
#!/bin/sh
set -e
exec alsactl store
==========================

I'd imagine the preceding script stores information for persistance.

I'm pretty sure that if you run the preceding scripts in a root
terminal and then run alsamixer, your "host is down" error will vanish.

You can install (but not necessarily use) runit to obtain the
chpst command. Naturally, remember to create user alsa if it's not
there already.

Your next problem will be no sound. Remember the following:

* Uninstall Pulseaudio, which is the land of a thousand mutes.

* I have no idea, but it's possible Pipewire might also be a land of a
  thousand mutes.

* For individual applications like Totem, VLC, smplayer and the like,
  they can output to Pulseaudio, ALSA or in many cases even the antique
  OSS, but you need to set that setting in each if they're muted.

* The speaker-test program is your friend.

* Consult
  http://troubleshooters.com/linux/sound/sound_troubleshooting.htm

About http://troubleshooters.com/linux/sound/sound_troubleshooting.htm :
This is 10 years old, and attempts to troubleshoot a system with both
ALSA and Pulseaudio. I later found systems with Pulseaudio are just too
difficult to troubleshoot unless they're on a distro specifically made
to always have Pulseaudio, and even on those distros Pulseaudio might
be problematic.

>
>So I would like to find out how you use ALSA to see if I can copy what
>you do?
>
>Do you set up ALSA after the ctwm interface (in my case with 4x3
>virtual desktops) starts up, or is it done earlier, e.g. while .ctwmrc
>is running?

It's usually done as a daemon long before .ctwmrc is invoked, but you
can do it any time in a root terminal, and THEN when you run alsa as I
described, it should work.

>So far I've been able to get sound by using VLC to play audio and video
>recordings stored on my machine, by carefully selecting the
>appropriate VLC options, but I haven't been able to get audio from a
>browser e.g. e.g. firefox running BBC news.

Supposedly Firefox no longer works without Pulseaudio, but for some
reason it does on my distro, probably because my distro (Void Linux)
compiles Firefox to be able to use ALSA alone. Like I said, you need to
carefully set each sound playing program's output type to alsa.

>
>I've tried running alsamixer explicitly on its own, but I now get
>
>    alsamixer
>    cannot open mixer: Host is down
>
>I used to find pavucontrol useful, now I just get a blank panel
>except for
>
>    'Establishing connection to PulseAudio please wait'

Uninstall PulseAudio, then set the offending app to use ALSA.

>
>If I run 'startpulse' it doesn't change anything.

Startpulse shouldn't exist after uninstalling Pulseaudio. Please
remember, PulseAudio can easily mute an otherwise perfectly configured
ALSA.

>
>Anyhow I'll be grateful for a suggestion for something to go into
>.ctwmrc or to be run in an xterm window after ctwm starts up, or to be
>put in a ctwm menu item ....

Ultimately, you'll want to run alsa as a daemon long before X or
Wayland runs, although you could start alsa from a root terminal later.

[snip]

>Currently running Fedora 37
>kernel 6.0.17-300.fc37.x86_64 last updated Wed 4th Jan

Redhat derivatives are custom made to use Poetterware (Pulseaudio is
poetterware, as is systemd). I'd consider switching distros.

SteveT

Steve Litt 
Autumn 2022 featured book: Thriving in Tough Times
http://www.troubleshooters.com/bookstore/thrive.htm

Reply via email to