Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
change sound device order - pass kernel options at boot?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
hunky
l33t
l33t


Joined: 19 Nov 2003
Posts: 821
Location: Alaska

PostPosted: Fri Jan 18, 2019 7:18 am    Post subject: change sound device order - pass kernel options at boot? Reply with quote

I've got a non systemD system, using efi to boot on my desktop (I think is ASUS motherboard).

I'm having a sound issue and was thinking if I could remap the order of cards, it may help solve some things. Right now, card 0 is HDMI, which I don't think I use. Card 1 is PCH, which I do use. The Scarlett on occasion, but can choose cards from within audacity or other interface for that use.
Code:
# cat /proc/asound/cards
 0 [HDMI           ]: HDA-Intel - HDA Intel HDMI
                      HDA Intel HDMI at 0xefd34000 irq 41
 1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xefd30000 irq 42
 2 [USB            ]: USB-Audio - Scarlett 2i2 USB
                      Focusrite Scarlett 2i2 USB at usb-0000:00:14.0-9.3, high speed


I was thinking of adding this at boot time: snd-hda-intel.index=1,0 ,
getting that from this page: https://wiki.gentoo.org/wiki/ALSA#HTML5_does_not_play_in_a_browser .

So I use the regular gentoo-sources kernel and my kernel resides at /boot/efi/boot/bzImage , on /dev/sda1 .
I've been googling around but it just seems to confuse more than help me. Not sure if I have a UEFI Shell but have read how to install: in /boot/efi/boot/shellx64.efi I presume.. though wouldn't know what to do with it if that is what I need.

Maybe there is another (better?) way to remap the sound devices? Or would someone be so kind as to point me in the right direction? I'm not brilliant at these things, but can follow directions. thx!
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1014

PostPosted: Fri Jan 18, 2019 8:25 am    Post subject: Reply with quote

hunky, what is the issue you are having with the sound? You may be able to introduce some kernel arguments like you said, but then that could have its own unintended consequences. ALSA is pretty reliable at managing the cards in the locations they are given by default. Are you sure that you haven't just misconfigured something else. Have you also changed your default card, you can do this by following the important instructions in the ALSA wiki page and go to ~/.asounrc and insert the name of the default card. See here...
https://wiki.gentoo.org/wiki/ALSA#Configuration

Hopefully that gets you started or else uncover some other information like what applications are not working properly with audio, and also are you using pulseaudio on top of ALSA?
Back to top
View user's profile Send private message
hunky
l33t
l33t


Joined: 19 Nov 2003
Posts: 821
Location: Alaska

PostPosted: Fri Jan 18, 2019 6:41 pm    Post subject: Reply with quote

Thanks for the reply LILIS!

You are probably right.. I was thinking of the kernel parameters because I haven't fully understood the ALSA instructions in that wiki.

I'm using -pulseaudio USE. And unstable. In the first of this month I traveled, so shut down the computer. When I came back, I had no sound, except in a couple apps like audacity - where I could choose the card. I didn't remember a recent update, but something like that probably got me. I have firefox 64, which did have sound (youtubes, vimeo, etc) before the reboot, and Chrome, which also worked fine before. So with no sound, I started investigating and see that without pulseaudio, firefox shouldn't have been working despite the fact it was.
Started playing around with my ~/.asoundrc as I read I think in the wiki:
Code:

defaults.pcm.!card PCH
defaults.pcm.!device 1
defaults.pcm.!ctl PCH


That didn't seem to help. So I found another reference (wish these wiki's had dates of last updates) and changed it to this:
Code:
pcm.!default {
type hw
card 1
device 0
}

ctl.!default {
type hw
card 1
device 0
}

And that got Chrome working for a bit. But after awhile it stopped working with, for youtube at least, I get this error: "audio renderer error: please restart your computer". If I do this:
Code:
# /etc/init.d/alsasound restart
 * WARNING: you are stopping a boot service
 * Storing ALSA Mixer Levels ...
alsactl: get_control:256: Cannot read control '3,0,0,Playback Channel Map,0': Invalid argument
 * Error saving levels.                                                                                                                                                [ !! ]
 * Restoring Mixer Levels ... 

And it doesn't help. If I screw around a bit.. close Firefox and whatever else (because I read that 2 apps are trying to use the sound card and that causes the error - don't know if true as it used to work fine) sometimes I can get Chrome sound working again and a restart of /etc/init.d/alsasound goes without error.

If I fire up alsamixer as root, it opens on HDA Intel HDMI, Item S/PDIF. Hitting F6 to list cards there's default (which is this HDMI device) then 0 device (HDMI), the 1 device (PCH), and the 2 device (Scarlett). If I try opening it as my user, I get this:
Code:
$ alsamixer
cannot open mixer: Invalid argument


Just closed Firefox and restarted alsasound and the Chrome error goes away. So maybe it is time to give up on Firefox. Not sure... apologies for the ramblings.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43195
Location: 56N 3W

PostPosted: Fri Jan 18, 2019 7:31 pm    Post subject: Reply with quote

hunky,

The parameter index=1,0 has to be passed to snd-hda-intel when it is loaded for this method to work.

There are three cases to consider.
snd-hda-intel is built into the kernel binary. Pass snd-hda-intel.index=1,0 as a kernel parameter.
snd-hda-intel is loaded as a module, after the root filesystem is mounted. Pass index=1,0 according to your init system.
I use /etc/conf.d/modules
snd-hda-intel is loaded as a module in the initrd. Pass the parameter to snd-hda-intel in the initrd somehow.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1294
Location: Frankfurt, Germany

PostPosted: Fri Jan 18, 2019 7:40 pm    Post subject: Reply with quote

Quote:
I'm having a sound issue and was thinking if I could remap the order of cards

Look at: https://alsa.opensrc.org/MultipleCards
Back to top
View user's profile Send private message
hunky
l33t
l33t


Joined: 19 Nov 2003
Posts: 821
Location: Alaska

PostPosted: Sat Jan 19, 2019 7:46 am    Post subject: Reply with quote

Thanks for the replies! You've given me some meat to chew on.. will take awhile to digest.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1014

PostPosted: Tue Jan 22, 2019 8:32 am    Post subject: Reply with quote

Just another thought to interject if you have no personal disagreement with the idea of installing it I think that if you did install pulseaudio, and run that on top of a working ALSA configuration it might perform better with the browsers on your system. That is since web browsers like Firefox and Chrome et al tend to be pretty complicated/comprehensive software programs. This does not mean it WONT work with ALSA instead of pulseaudio, but it might just work out of the box better with them both...no guarantees of course.

Good luck!
Back to top
View user's profile Send private message
hunky
l33t
l33t


Joined: 19 Nov 2003
Posts: 821
Location: Alaska

PostPosted: Tue Jan 22, 2019 5:59 pm    Post subject: Reply with quote

Thanks for replies.

Pulseaudio: I had it installed several years ago and for a reason I don't really remember decided to ditch it. Could be from trying to get it to work while also using Jack - I like to use Ardour (multi-track editor) on occasion. However, after Jack went through some updates some years ago, I haven't been able to get that going again. Made one valiant attempt and got confused by all the old info out there and the couple different jacks out there. Maybe it has all settled down now - haven't looked recently.

Mike155 gave a link to an Alsa site I've been working through. A bit aggravating since it refers to kernel versions around 2.6 - so it too is old stuff. Not sure that matters.. but it does say to build everything as a module rather than into the kernel as I have presently.. haven't tried doing that yet. In the troubleshooting section of that (I think) there was some aplay examples to get wav files to play. I couldn't get that working until I finally changed my .asoundrc . Currently it is this (with the 2 old configs commented out):
Code:


$ cat ~/.asoundrc
pcm.!default {
  type plug
  slave {
    pcm "hw:1,0"
  }
}
ctl.!default {
  type hw
  card 1
}

#defaults.pcm.!card PCH
#defaults.pcm.!device 1
#defaults.pcm.!ctl PCH

##another attempt follows

#pcm.!default {
#type hw
#card 1
#device 0
#}

#ctl.!default {
#type hw
#card 1
#device 0
#}


So this .asoundrc gets the aplay test working, but so far the browser wars still wage. I actually get sound in Firefox v.64. But then get an error in Chrome. I have to close both browsers and restart alsa, then Chrome works. Firefox will too, but as soon as I use it, Chrome quits sound. So far I've just been living with it. I keep thinking Firefox is going all pulseaudio, so haven't looked much further in how to get only alsa working with both browsers. Tried Falkon as a browser replacement for Firefox, but some extensions I use seem to be not there yet- or perhaps I haven't looked far enough yet.

So more reading up on pulseaudio I guess.. I would like to get Ardour working again. Bottom line is not sure if I should mark this question as "Solved" yet.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum