MX-17.1/MX-18.1: Replacing PulseAudio by ALSA's sound server – implications?

Message
Author
User avatar
Eadwine Rose
Administrator
Posts: 14454
Joined: Wed Jul 12, 2006 2:10 am

Re: MX-17.1/MX-18.1: Replacing PulseAudio by ALSA's sound server – implications?

#21 Post by Eadwine Rose »

Just a general request, your posts are a LOT more pleasant to read when you leave all the boldings out. :smile:
MX-23.6_x64 July 31 2023 * 6.1.0-34amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.216.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 12:21 am

Re: MX-17.1/MX-18.1: Replacing PulseAudio by ALSA's sound server – implications?

#22 Post by KoO »

Actually setting up alsa sound is pretty easy thanks to the devs of antiX and MX.

Let get one thing straight pulseaudio has nothing to with the actual sound driver itself that is the job of (alsa) no alsa > Pulseaudio is useless it producers no sound at all. It is a mixer and a channeller for your devices speakers , mic etc.
Can pulse effort your sound yes it can mostly because alsa has it own mixer equalizer preamp settings.

If you use asound.conf found in etc/asound.conf you are setting up system wide sound. If you choose to use .asoundrc.conf found in home/asoundrc.conf you are setting up sound on a per user level this file is added by the user. (I prefer asound.conf)

All you need to do is remove pulseaudio and pavu.. Some users have to install apulse meaning (alsapulse) to let alsa sound work in their browsers as for some strange reason they will only produce sound with pulseaudio. I myself do not use apulse as I run Waterfox and qutebrowser. Music mpd and ncmpcpp

The first thing you need to do after removing pulse and company is find out what sound card you have and its id number this is done using your terminal with this command = cat /proc/asound/cards


This is my readout and I want to use my USB Audio so the device id number is (2)

Code: Select all

  15 files = 1003M ~ >$cat /proc/asound/cards
 
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf7130000 irq 29
 1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xf7080000 irq 17
 2 [US2x2          ]: USB-Audio - US-2x2
                      TEAC Corporation US-2x2 at usb-0000:00:14.0-10, high speed
(Just remember one thing sometimes your ID number can change if you add a new audio device just rerun the above command if you lose sound) and edit your device ID number..

Now all I need to do is edit my asound.conf file and make device 2 the default sound device as below. (using sudo with your editor)

defaults.pcm.card 2
defaults.ctl.card 2

Set default sound card... Must be done from sudo

After this Open alsa mixer with sudo press F6 or S select your card then type sudo alsactl store. Also the below is not needed with antiX as sudo antiX-cli-cc = control centre is run as root anyway and works.


sudo alsamixer

sudo alsactl store

That is it you should now have your sound card running with alsa.

If you want a bit more info on asound.conf equalizer , pre amps this is the asound.conf from antiX and you can adjust the settings in the file. Note this line (Requires alsa-utils libasound2-plugin-equal)

Code: Select all

 # v4.0
# Requires alsa-utils libasound2-plugin-equal



# ***** Defaults *******************************************************

# Audio card/chip and device to use and control
# In most cases these settings should remain commented (#)
# When commented, card and device 0 are usually automatically selected
# When uncommented, the item corresponding to the number is selected
defaults.pcm.card 2
defaults.ctl.card 2
#defaults.pcm.device 0

# ***** Reset **********************************************************

# override the existing definition of the default device 
pcm.!default 
{
   type plug
  
   # point output to the equalizer device
   slave.pcm plugequal
}



# ***** Equalizer ******************************************************

# set up the control interface of the equalizer device
ctl.equalizer
{
   type equal
}


# set up the equalizer device
pcm.plugequal
{
   type equal
  
   # point output to device named preamp
   slave.pcm  "plug:preamp"
}



# ***** Pre-Amp ********************************************************

# set up the preamp device
pcm.preamp 
{
   type softvol

   # name of slider control to display in alsamixer interface
   control.name Pre-Amp
   
   # minimum dB when slider is at 0%
   min_dB -5.0
   
   # maximum dB when slider is at 100%
   max_dB 40.0
   
   # point output to device named duplex
   slave.pcm "duplex"
}



# ***** Playback and Capture *******************************************

# set up the playback/capture device
pcm.duplex 
{
   type asym

   # point playback output to use dmix
   playback.pcm "dmix"

   # point capture input record to use dsnoop
   capture.pcm "dsnoop"
}
If you want even more some awesome links for Alsa

https://wiki.archlinux.org/index.php/A ... chitecture
https://en.wikipedia.org/wiki/Advanced ... chitecture
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

User avatar
MX-16_fan
Posts: 331
Joined: Mon Feb 13, 2017 11:09 am

Re: MX-17.1/MX-18.1: Replacing PulseAudio by ALSA's sound server – implications?

#23 Post by MX-16_fan »

@Eadwine Rose:
Eadwine Rose wrote: Fri Oct 25, 2019 5:16 am Just a general request, your posts are a LOT more pleasant to read when you leave all the boldings out. :smile:

"Boldings" enable the reader to get an overview quickly. Convention for correspondence in professional working life.

Talking about it, setting text in capital letters is a syntactically wrong replacement for boldface. Text in capital letters makes sense only for headings, in special situations.

In case you personally don't like "boldings", please feel free to have your browser filter them out.


Greetings, and have a nice Sunday, Joe
Last edited by MX-16_fan on Sat Oct 26, 2019 4:49 pm, edited 1 time in total.

User avatar
MX-16_fan
Posts: 331
Joined: Mon Feb 13, 2017 11:09 am

Re: MX-17.1/MX-18.1: Replacing PulseAudio by ALSA's sound server – implications?

#24 Post by MX-16_fan »

@KoO: Thanks for the valuable input. Greetings, Joe

rs55
Posts: 273
Joined: Sun Feb 24, 2019 3:24 pm

Re: MX-17.1/MX-18.1: Replacing PulseAudio by ALSA's sound server – implications?

#25 Post by rs55 »

MX-16_fan wrote: Thu Oct 24, 2019 8:40 pm @rs55:
rs55 wrote: Sun Oct 20, 2019 4:17 pm Here is my experiment:
Very interesting, @rs55. Thank you for sharing your test results with us.
rs55 wrote: Sun Oct 20, 2019 4:17 pm - I uninstalled pulse and pavu and all pulse associated things.
I.e. set up the way that @dreamer and I have worked it out so far, with great help from @dolphin_oracle. As to your report, this has now worked in another (in any case: third,) setup (as once, before the degradation of Debian, it did with no issues whatsoever out-of-the-box.). Superb !
rs55 wrote: Sun Oct 20, 2019 4:17 pm - Important: libcanberra0 and libcanberra-GTK3-* programs seem to be necessary - so I had to reinstall those.
(@rs55:) That is ugly.

@dolphin_oracle: Is there anything that could be done about those remaining libcanberra* dependencies?
rs55 wrote: Sun Oct 20, 2019 4:17 pm - I installed apulse
- changed call to firefox as follows: apulse firefox , chrome works as is, deadbeef works, VLC works.
Sounds like a good idea, but could you (or someone else) tell us more about the connection between PulseAudio, apulse, and potential security- and general implications regarding further development architecture? Would be interesting to know what the price for that compatibility is.
rs55 wrote: Sun Oct 20, 2019 4:17 pm - installed a pre-amp for alsa ( took some fiddling, this is optional but can raise the volume quite high on my thinkpad with the preamp)
Sounds like an excellent idea. However, you might wish to try and run a "sudo rm /var/lib/alsa/asound.state" (at your own risk), and reboot after that, and maybe (chance of 30% would be my estimation) you won't need the pre-amp afterwards any more.
rs55 wrote: Sun Oct 20, 2019 4:17 pm - installed a pre-amp for alsa ( took some fiddling, this is optional but can raise the volume quite high on my thinkpad with the preamp)
Tẃo questions regading that very same thing:
  1. What pre-amping application did you use for that?
  2. Would you know how to increase the volume generated by any Firefox-based browser simply via about:config?
rs55 wrote: Sun Oct 20, 2019 4:17 pm Consequences: MX System Sounds was uninstalled in the process. I never use system sounds anyway - so no loss.
Please see above. Thanks to dolphin_oracle's repackaging, there's no need to loose the system sounds any more. You might wish to try the new package.
rs55 wrote: Sun Oct 20, 2019 4:17 pm Ram usage went down 20-30 MB - minor
Sounds good.
rs55 wrote: Sun Oct 20, 2019 4:17 pm - Run my music player on pure alsa without any processing, sounds great.
Great! As with you, according to quite a few people, sound generally becomes great again once you remove PulseAudio.
rs55 wrote: Sun Oct 20, 2019 4:17 pm Overall, Iam happy with this.
rs55 wrote: Sun Oct 20, 2019 4:17 pm I dont like software that tries to be too clever - and Pulse falls in that category - too much fiddling with setups, and if you set the volume to 150% , then use the hardware keys to reduce it a bit - it falls to 100% and then cannot raise it back etc etc. Too many idiosyncrasies for something simple.
Fully correct, IMHO.
rs55 wrote: Sun Oct 20, 2019 4:17 pm All I need is sound in the browser and sound for my music player - through the speakers of through my DAC. Thats it. And with Alsa - everything now Just Works.
A vast majority of Linux-on-a-Desktop users is likely to fully agree agree with you.
rs55 wrote: Sun Oct 20, 2019 4:17 pm I dont have any complex sound setups or bluetooth etc - so other beware that this drastic surgery may affect you if you have other sound devices.
We'll keep working on documenting potential implications here in this thread, and try to remove roadblocks. Please stay stuned. Further input from you would most certainly be greatly appreciated.

In case you'd like to use Bluetooth, please have a look at this separate thread: viewtopic.php?f=134&t=51892.


Best wishes,

and a nice weekend to all of you,


Joe
As for the pre-amp , I simply have this in my /etc/asound.conf, not exactly sure about the syntax for this - I copied this from some guy on the web who seemed to know what he was doing !!

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

pcm.softvol{
type softvol
slave{
pcm "dmix"
}
control{
name "Pre-Amp"
card 0
}
min_dB -30.0
max_dB 30.0
resolution 6
}

User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 12:21 am

Re: MX-17.1/MX-18.1: Replacing PulseAudio by ALSA's sound server – implications?

#26 Post by KoO »

@rs55
You want to know about alsa and your dac or audio cards plus more check these links out.

https://lacocina.nl/detect-alsa-output-capabilities
https://lacocina.nl/audiophile-mpd
https://lacocina.nl/bitperfect-audio
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

User avatar
MX-16_fan
Posts: 331
Joined: Mon Feb 13, 2017 11:09 am

Re: MX-17.1/MX-18.1: Replacing PulseAudio by ALSA's sound server – implications?

#27 Post by MX-16_fan »

@KoO:
KoO wrote: Sun Oct 27, 2019 8:05 am @rs55
You want to know about alsa and your dac or audio cards plus more check these links out.

https://lacocina.nl/detect-alsa-output-capabilities
https://lacocina.nl/audiophile-mpd
https://lacocina.nl/bitperfect-audio
Very interesting. My impression is that ever since PulseAudio entered the stage, the aspect of sound quality has been disregarded. So it's great to see that there are people still working on this topic.

Seems as if that alsa-capabilities tool mentioned in https://lacocina.nl/detect-alsa-output-capabilities would add a nice feature. Apparently it's available on GitHub (https://github.com/ronalde/mpd-configur ... pabilities), and on GitLab also. As it is only a shell script, packaging it would probably be trivial.


Greetings, Joe

User avatar
sunrat
Posts: 663
Joined: Mon Mar 28, 2016 9:54 pm

Re: MX-17.1/MX-18.1: Replacing PulseAudio by ALSA's sound server – implications?

#28 Post by sunrat »

Just a few points:
- If you're aiming for "bit-perfect" audio you need no software volume controls, equalisers, or other processors. These change the bits.
- PulseAudio now has an option to avoid resampling so it is possible to have an unresampled stream and still use PA.
- The best sound I have achieved is using PulseAudio, avoid-resampling, playing well-recorded 24/96 files with the sound card set to 96kHz. (My M-Audio Audiophile 2496 can be hardware set to sample frequency.) Kacey Musgraves' album "Golden Hour" from HDTracks is a dream to listen to like this.

I have said in several other discussion on Linux audio playback, the most important factors are good quality audio equipment and well-recorded material. Optimising the software is less important, and avoiding software changes to sample frequency is more important than whether you use PA or ALSA or OSS or whatever.
I used to be a PA hater 5 years ago when it still needed work. Now I embrace it and appreciate how it makes some facets of audio much easier to set up. It has improved and matured immeasurably.

Post Reply

Return to “Software / Configuration”