Bypass Pulseaudio, not regular case

Hi,

I want to bypass completely a pulseaudio same time the pulseaudio is acting normally. So a example aplay is able to play simple .wav file from cron or systemd service.

Is it partially solved when making a dmixer to the .asound.conf and use that. The problem is here that the pulseaudio controls dmixer’s volume.

Something like this:

pcm.!default {
    type plug
    slave.pcm "dmixer"
}

pcm.dmixer  {
    type dmix
    ipc_key 1024
    slave {
            pcm "hw:1,0"
            period_time 0
            period_size 1024
            buffer_size 4096
            rate 44100
    }
    bindings {
            0 0
            1 1
    }
}

ctl.dmixer {
    type hw
    card 0
}

Other work around is to make the pulseaudio ignore alsa’s Master volume but that is not working with dmixer.
When playing sound without the dmixer sinks is busy and not available for aplay.

Why? I want play simple warning sound on my own script to warn battery state of a laptop. Sound has to be played on speakers even if there is a headphones plugged in or the pulseaudio is muted completely.

… You realize DE’s have sound settings for literally this purpose right?

I want to make it custom. There is not enough capability for my needs. :upside_down_face:

And to learn how this works…

It has been a long time since I tried to configure both PulseAudio and ALSA and it was with Gentoo.

You are going to run into some bad problems. Do you expect PA to use your dmix device? Because it won’t. If I remember correctly it will always open the hardware device. Which will block your dmix device so it will not work.

And then PA tries to present an ALSA interface to programs and your configuration may do any number of screwy things.

See this is why we have JackD and we remove pulse completely.

2 Likes