LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-01-2018, 09:55 PM   #1
triode3
LQ Newbie
 
Registered: Dec 2018
Posts: 5

Rep: Reputation: Disabled
Slackware 14.2 fresh install, alsa audio to Focusrite USB not working in some applications, but works in others


Hello,

Been using linux a long time, but wanted to try out slack again after a 15 year hiatus.

My machine has multiple sound cards (one built-in, one in the hdmi), but I only use the outboard focusrite Scarlett Solo USB. This was working fine installed under another linux distro, and oddly, it works fine under slackware, but seemingly only under Audacity.

If I try to use the sound with say firefox+youtube, I just receive no output.

If I try to use it with say audacious, I receive an error saying: ALSA error: snd_pcm_hw_params_set_format failed: Invalid argument.


I have verified the hardware:

Code:
 aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: USB [Scarlett Solo USB], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
I have also modified the /etc/asound.conf file, according to the slackware howto:
https://docs.slackware.com/howtos:ha...s_on_slackware

The asound.conf contains:

Code:
defaults.pcm.card 2
defaults.pcm.device 0
defaults.ctl.card 2

pcm.!default {
   type plug
   slave.pcm "softvol"
}
     
pcm.softvol {
   type softvol
   slave {
      pcm "dmix:2,0"
   }
   control {
      name "Pre-Amp"
      card 1
   }
   min_dB -5.0
   max_dB 20.0
   resolution 6
}


ctl.equal {
  type equal;
  }
  pcm.plugequal {
    type equal;
    #slave.pcm "plug:dmix";
    slave.pcm "plughw:2,0";
  }
  pcm.!default {
    type plug;
    slave.pcm plugequal;
}

At one time, I removed all of the extras (softvol and equalization) from the asounds.conf file, but that did not fix the issue either.

I can not figure out what is going wrong, but I need playback outside of just audacity (I record and edit in audacity, but I use audacious, mplayer, vlc, etc for playback of other items, and also firefox/youtube sound is not working).

If I switch to the other sound card (builtin card0, I get the same error). Again, I do not really understand why audacity works, perhaps because I built it and it just detects the USB interface and I choose that as output.

I would like to try to work with slack for a while, but no sound other than audacious would be the deal breaker...

Any input or direction would be appreciated.
 
Old 12-06-2018, 11:22 AM   #2
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys for decades while testing others to keep up
Posts: 2,016

Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
Slackware 14.2 was forced to accept Pulseaudio due to the (then) hard dependencies in Bluetooth software. What to some, including me, is some worse, Firefox now defaults to Pulseaudio and chose to eliminate one simple line of code to allow ALSA alone to work within it. I find this particular weird as well as troublesome since Pulseaudio requires ALSA but that's where much of Linux seems headed. Slackware Current qand the next full release have a "pure-alsa" option but Firefox will still be a problem unless you compile it and enable that line ... OR use a different browser. Thankfully most still go direct to ALSA though have the option to allow Pulseaudio to intercede.

So, perhaps the first thing to do is try a different browser. I am very fond of sound quality in Vivaldi and Opera but Palemoon is more like Firefox yet it works, too. There are versions of Firefox that do work ALSA-only but we can't even count on all ESR versions being compatible anymore. It'sd rather a pita for those that like both Firefox and ALSA but have no need nor any love for Pulse.

Secondly, if it doesn't get in your way, you need to research Pulseaudio since that's where changes are required to function with newer versions of Firefox. Changes in .asoundrc now have little if any effect since Pulse now manages it.
 
Old 12-06-2018, 12:27 PM   #3
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,520

Rep: Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263
@triode3, is it your intention to bypass pulseaudio and use only alsa or did you just tweak the asound.conf file since it was in the wiki? It looks like that page should be updated to state that most of those items apply to alsa only setups (which for the vast majority of users would be 14.1 and below and those who choose to not use pulseaudio in 14.2), as pulseaudio handles things differently and you can usually just use pavucontrol to adjust the sound card that should be used rather than tweaking conf files.
 
Old 12-06-2018, 06:45 PM   #4
triode3
LQ Newbie
 
Registered: Dec 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Don't know why it took so long for this thread to appear, but it took so long that I gave up on Slack after about
a week of full-bore fighting it.

I may try again later, since now I have more information.


It is not my intention to run ALSA. I do not care which one I use. I was literally going by the HOWTO to try to get it up,
as when I searched for sound on slackware, it came up and seemed like it was for 14.2.

As for the Browser, I can see that if I switched to pulse, this would also fix the firefox issue.

Interestingly, I distinctly recall reading somewhere in this mess that Slack was sticking with ALSA. Perhaps it was
older information, but it never dawned on me to try to switch to pulseaudio (however you would do that under Slack).

Thanks.
 
Old 12-06-2018, 08:20 PM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,520

Rep: Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263
Quote:
Originally Posted by triode3 View Post
Interestingly, I distinctly recall reading somewhere in this mess that Slack was sticking with ALSA. Perhaps it was
older information, but it never dawned on me to try to switch to pulseaudio (however you would do that under Slack).
Slackware did not ship alsa in all versions prior to 14.2 (which most distros had already switched, so Slackware was "swimming against the stream". During the development process of 14.2, it was found that after upgrading BlueZ that it broke bluetooth audio, because the newer version of BlueZ had dropped support for alsa. This lead to pulseaudio getting added to 14.2. Here's the relevant portion out of the changelog.

Quote:
After upgrading to BlueZ 5 recently, everything seemed to be working great,
but then it was pointed out that Bluetooth audio was no longer working.
The reason was that the newer BlueZ branch had dropped ALSA support and now
required PulseAudio. So with some trepidation, we began investigating adding
PulseAudio to Slackware. Going back to BlueZ 4 wasn't an option with various
dependent projects either having dropped support for it, or considering doing
so. After several iterations here refining the foundation packages and
recompiling and tweaking other packages to use PulseAudio, it's working well
and you'll likely not notice much of a change. But if you're using Bluetooth
audio, or needing to direct audio through HDMI, you'll probably find it a lot
easier to accomplish that.
Unfortunately, sometimes documentation gets out of date and people don't realize it until it is brought up. I've now added a message to the top of the page you linked earlier saying that the fixes below may not work on pulseaudio systems. Hopefully it will be enough.

As for trying for a week and giving up, that's totally understandable. It can certainly be frustrating. If you want, you can give Slackware Live a spin, where you get a full blown Slackware install on a thumbdrive, so you can try it out without needing to install it on your harddrive.

https://docs.slackware.com/slackware:liveslak
 
Old 12-06-2018, 09:58 PM   #6
triode3
LQ Newbie
 
Registered: Dec 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Well, my question for next time is: What is the correct answer?

Is the correct answer to install Slack, and then install pulseaudio?
Do you remove ALSA to get it all working?
Are there docs on it?

As a long-time gentoo user, and I did use Slack from day 1 when it came out way back in 93, I know that sometimes
the current web docs may not be the best place for information. While the gentoo wiki/howtos are great, for immediate issues,
the definitive answer is #gentoo at freenode. I think I am at a loss when it comes to slack in our current day and age.
I read the howto and it now seems to be wrong. The docs said do ALSA. I am just trying to find my way here after a
long hiatus. As strange as this sounds, I am pretty tired of debian based distros, and ubuntu and derivatives.
Don't get me started on how far behind RHEL is. I was going to check out slack to see if I still liked it.
The issue I have is that I have weekly deadlines where my audio (ffmpeg+loudnorm, audacity, and a few other tools)
have to work.

Thanks.
 
Old 12-07-2018, 09:31 AM   #7
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys for decades while testing others to keep up
Posts: 2,016

Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
ALSA is a sound server. Pulseaudio is a server manager that provides software mixing for soundcards that don't have mixing in hardware/firmware. Pulseaudio still requires some server to mix and manage, whether ALSA, OSS, esound, whatever.

The point is one doesn't remove ALSA or there will be no sound server for Pulse to glom onto unless the user/admin installs and/or specifies some other sound server . If you install any Slackware at or after 14.2 everything you need is there already. All any user/admin must do is setup Pulse via pavucontrol to select what sources to use where. The next release of Slackware and what is now Current (testing) have a "pure-ALSA" option but that is only there to accommodate special needs, usually by folks like me that spent the cash on pro quality soundcard(s). Of course then there is the whole political/philosophical argument that hard dependencies subvert the freedom and power of Linux but it is apparently too late to force so many distros and software developers to not hard spec pulse.

I do hope you revisit Slackware as it sounds like it could be "right up your alley" and the issue with pulse was thankfully an uncommon anomaly. Slackware doesn't cave unless "a gun is held to its head". Thankfully so far that still rarely happens. FWIW Slack Live should "just work out of the box" for you, and v15 promises to be a stellar release, just like 14.0 was.
 
2 members found this post helpful.
Old 12-07-2018, 11:14 AM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,520

Rep: Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263
Quote:
Originally Posted by triode3 View Post
Well, my question for next time is: What is the correct answer?

Is the correct answer to install Slack, and then install pulseaudio?
Do you remove ALSA to get it all working?
Are there docs on it?
enorbet's answer is correct, although contains a lot of info. To simplify, just install Slackware and alsa and pulseaudio will both be there. They work together behind the scenes, but as a user, you will just use pavucontrol to interact with pulseaudio and change things (like the default output device and volume levels). As a user on a pulseaudio system, you shouldn't need to tweak anything alsa related.

As for docs on it, I don't know of any that are 14.2 specific, but I imagine that is because pulseaudio usually doesn't require the type of fine tuning alsa did. Usually you can do everything you'd need with pavucontrol.
 
Old 12-07-2018, 04:49 PM   #9
_peter
Member
 
Registered: Sep 2014
Distribution: slackware
Posts: 33

Rep: Reputation: Disabled
it should work for you too, check it on a clean slackware 14.2 image, don't mess with any audio files or configurations yet.
can't you just select scarlett_XYZ from the playback tab in the pavucontrol window?


similar to you I run a scarlett thingy on slackware but 14.2, recording and playback works fine with alsa from the command line using the following:

Code:
arecord -vv -f S16_LE -c2 -r96000 -D plughw:2,0 -t raw | oggenc - -q10 -r -R96000 -o myoggfile.ogg
aplay -D plughw:2,0 mywavefile.wav
instead of
Code:
hw:1,0
for the built in soundboard using
Code:
plughw:2,0
worked

Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC3232 Analog [ALC3232 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 2: USB [Scarlett 2i2 USB], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Attached Thumbnails
Click image for larger version

Name:	pavucontrol.png
Views:	2
Size:	28.7 KB
ID:	29114  
 
Old 12-09-2018, 08:31 AM   #10
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 1,148
Blog Entries: 1

Rep: Reputation: Disabled
I never myself set configuration for sound in 14.2. It should be enough to have pulseaudio enabled
Code:
# chmod +x /etc/rc.d/rc.pulseaudio
it starts now every time system boots. The second thing you need is pavucontrol - simple utility to show all sound devices on your computer. If pavucontrol shows no device - then it means pulseaudio as server is not running. Note pulseaudio can start on demand by application which require it. But if it runs on demand - running pulse audio locks sound device. So any other application can't use it.

In case there are still problems the simplest diagnostic is to start application through terminal emulator - xterm, etc. This way you will be able to read all warning or error messages being issued by application, say in xterm
Code:
$ firefox
there will appear plenty of messages but some of them can be useful to diagnose cause of your troubles. If there are too many messages redirect them to file and then search file for clue
Code:
$ firefox 2> firefox_err.log
Of course this is only example - apply this procedure to application you have trouble with.
 
Old 12-09-2018, 11:43 AM   #11
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 8,551

Rep: Reputation: 3569Reputation: 3569Reputation: 3569Reputation: 3569Reputation: 3569Reputation: 3569Reputation: 3569Reputation: 3569Reputation: 3569Reputation: 3569Reputation: 3569
FWIW, I use a USB audio device too (a TEAC A-H01), and it did not work with Audacious in Slackware 14.1. It started working after 14.2 (which had Pulseaudio).

Also: do not use an .asoundrc file if you're using Pulseaudio.
 
Old 12-09-2018, 03:40 PM   #12
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,520

Rep: Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263
Quote:
Originally Posted by igadoter View Post
I never myself set configuration for sound in 14.2. It should be enough to have pulseaudio enabled
Code:
# chmod +x /etc/rc.d/rc.pulseaudio
it starts now every time system boots.
This is actually not recommend for most users of Slackware. pulseaudio will start on-demand when needed and for most cases, shouldn't need to be started system-wide. This is stated in the rc.pulseaudio file.

Code:
# Please note:  this is not generally the best way to use PulseAudio!
# Normally pulseaudio will start automatically as-needed with an instance
# per audio user.  Unless you really need to use system mode you should leave
# this script non-executable.
#
# For more information, see:
# http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide
If you check out that link, you'll find that pulseaudio developers don't even recommend running it in system mode.
 
Old 12-10-2018, 04:33 AM   #13
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 1,148
Blog Entries: 1

Rep: Reputation: Disabled
@bassmadrigal: starting pulseaudio on demand is exactly what is causing locks on my system. Multiple times I noticed such behavior on my computer. This is why I run pulseaudio system wide. Pulseaudio started on demand just refuses connections. And I am really not interested in tweaking pulseaudio to actually work as it is advised by its developers. On -current I run pure-alsa and I am happy with this.
 
Old 12-10-2018, 11:11 AM   #14
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,520

Rep: Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263Reputation: 3263
Quote:
Originally Posted by igadoter View Post
@bassmadrigal: starting pulseaudio on demand is exactly what is causing locks on my system. Multiple times I noticed such behavior on my computer. This is why I run pulseaudio system wide. Pulseaudio started on demand just refuses connections. And I am really not interested in tweaking pulseaudio to actually work as it is advised by its developers. On -current I run pure-alsa and I am happy with this.
I just wrote was was recommended by Pat and pulseaudio developers. For *most* cases, it shouldn't be required to run it system-wide, and I've found that to be true in my (very limited) use cases.

I don't think it should be recommended to run it system-wide unless they run into problems running it on-demand.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 14.2 fresh install, alsa audio to Focusrite USB not working in some applications, but works in others triode3 Slackware 1 12-06-2018 11:11 AM
[SOLVED] How to configure external USB soundcard (Focusrite Scarlett Solo) to play sound in Linux? Letrix Linux - Hardware 8 07-13-2018 05:23 PM
Focusrite 18i8 usb mixer interface board Ubuntu 14.04 LTS Toshiba S875D asalford Linux - Hardware 3 02-22-2018 08:00 AM
[SOLVED] Focusrite Scarlett Solo (USB) latency and getting it recognized by ALSA hokkupi Linux - Hardware 1 07-31-2015 09:07 AM
Fresh install - Sound works but only in some applications Robstro Mandriva 1 08-23-2004 07:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration