LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   How do I change the order of sound cards? (https://www.linuxquestions.org/questions/linux-hardware-18/how-do-i-change-the-order-of-sound-cards-4175600743/)

lucmove 02-28-2017 02:03 AM

How do I change the order of sound cards?
 
I did something stupid to my system and the sound system got damaged.

Hopefully, I still can fix it. Sound works, but there are several glitches that probably result from a shuffling in the order. Look at this:

Code:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 7/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 7/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: PCH [HDA Intel PCH], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Whenever I run alsamixer, the Loopback device is always selected as default, so I get a big blank screen with the message "This sound device does not have any controls." I have to press F6 and select my actual sound card, then everything works, but whenever I run alsamixer again, I have to do this again.

I don't think that Loopback thingie used to be there. Or at least ALC887-VD Analog used to be the card 0. Is there some way I can restore the old law and order?

DavidMcCann 02-28-2017 11:47 AM

This has a couple of solutions (under Troubleshooting)
http://wiki.debian.org/ALSA

lucmove 02-28-2017 08:14 PM

I have tried the first one and it didn't work.

The second one is complicated and I don't understand it. I've had many .asoundrc files over the last few years, sometimes copied from elsewhere sometimes edited by some application. I don't understand the contents of that file.

ferrari 02-28-2017 09:14 PM

Not sure why you have the loopback device, but AFAIU it is a virtual device provided by 'snd-aloop'
Code:

lsmod|grep snd
Post your current sound configuration eg assuming /etc/modprobe.d/sound
Code:

cat /etc/modprobe.d/sound

Shadow_7 02-28-2017 09:22 PM

You can force index-ing with various tricks in /etc/modprobe.d/ with the .conf files. But you don't need to. With pulseaudio you select your soundcard with pavucontrol. In alsa you can make a card other than 0 be the default. And there's OSS emulation layers for both of those to do the same for ancient apps that require /dev/dsp.

FILE: .asoundrc
Code:

defaults.ctl.card 1
defaults.pcm.card 1
defaults.pcm.device 0

For the alsa option to override your default card. Otherwise most applications let you "select" your output on a per application basis.

$ speaker-test -c 2 -l 1 -D hw:1

ferrari 02-28-2017 09:43 PM

Yes, assuming PulseAudio is in use, selecting the sound card with pavucontrol is the way to go, but if loopback is not required, it should be removed.

lucmove 03-01-2017 12:36 AM

I need snd-aloop because it's used by Cadence to provide a bridge between ALSA and JACK. It's a bedroom music producer thing. It all worked fine. The problem began when I did something stupid (deleting /proc entries willy-nilly) and Loopback became a problem.

ferrari 03-01-2017 01:26 AM

Quote:

I need snd-aloop because it's used by Cadence to provide a bridge between ALSA and JACK. It's a bedroom music producer thing. It all worked fine.
Thanks for clarifying :)

Are you also using PulseAudio?

lucmove 03-01-2017 02:06 AM

No, Pulseaudio has been banned from my computer for years.

ferrari 03-01-2017 02:45 AM

Just checking as it will influence the advice given. I'm not familiar with Cadence, but can you not configure it to point at the desired input/output devices?

http://kxstudio.linuxaudio.org/Docum..._configuration

ferrari 03-01-2017 02:52 AM

You haven't posted the requested audio configuration file from /etc/modprobe.d/ directory yet (assuming it exists).

lucmove 03-01-2017 02:56 AM

Yes, I can and I have sound, but Audacious kept popping up a mysterious error message for days (which has disappeared just as mysteriously) and I can no longer control volume with script+keys+amixer. And the patchbay is now polluted with two dozen MIDI I/O ports that I'll never use and weren't there until I had the incident. I have MANY sound apps, don't which ones may throw an error, I haven't checked them all.

lucmove 03-01-2017 03:45 AM

Quote:

Originally Posted by ferrari (Post 5677452)
You haven't posted the requested audio configuration file from /etc/modprobe.d/ directory yet (assuming it exists).

You mean /etc/modprobe.d/sound? I don't have that file. I applied the suggested changes to /etc/modprobe.d/alsa-base.conf, according to some instruction I found on the ALSA page.

Shadow_7 03-01-2017 07:32 AM

Quote:

Originally Posted by lucmove (Post 5677418)
...(deleting /proc entries willy-nilly)...

That's a virtual fs that is populated at boot. A reboot should correct that.

Shadow_7 03-01-2017 07:56 AM

A /etc/modprobe.d/alsa_custom.conf that I used long long ago.

FILE: /etc/modprobe.d/alsa_custom.conf
Code:

alias  char-major-116      snd
alias  char-major-14      soundcore

options snd                major=116      cards_limit=4
options snd-atiixp          index=0
options snd-atiixp-modem    index=1
options snd-usb-audio      index=2
options snd-virmidi        index=3


alias  snd-card-0          snd-atiixp
alias  snd-card-1          snd-atiixp-modem
alias  snd-card-2          snd-usb-audio
alias  snd-card-3          snd-virmidi

alias  sound-slot-0        snd-card-0
alias  sound-service-0-0  snd-mixer-oss
alias  sound-service-0-1  snd-seq-oss
alias  sound-service-0-3  snd-pcm-oss
alias  sound-service-0-8  snd-seq-oss
alias  sound-service-0-12  snd-pcm-oss

alias  sound-slot-1        snd-card-1
alias  sound-service-1-0  snd-mixer-oss
alias  sound-service-1-1  snd-seq-oss
alias  sound-service-1-3  snd-pcm-oss
alias  sound-service-1-8  snd-seq-oss
alias  sound-service-1-12  snd-pcm-oss

alias  sound-slot-2        snd-card-2
alias  sound-service-2-0  snd-mixer-oss
alias  sound-service-2-1  snd-seq-oss
alias  sound-service-2-3  snd-pcm-oss
alias  sound-service-2-8  snd-seq-oss
alias  sound-service-2-12  snd-pcm-oss

alias  sound-slot-3        snd-card-3
alias  sound-service-3-0  snd-mixer-oss
alias  sound-service-3-1  snd-seq-oss
alias  sound-service-3-3  snd-pcm-oss
alias  sound-service-3-8  snd-seq-oss
alias  sound-service-3-12  snd-pcm-oss

In days of old a configuration like that allows the modules for sound to load when you try to use the device. Which happened at boot when mixer settings are restored. The index part allows you to hardcode the indexing of soundcards. And this particular setup uses the OSS emulation layer so snd-pcm-oss and friends are used. But it was the "simpler" way to have this type of config. It's mostly not needed these days.

# modinfo snd-whatever-applies

There's and ID option that you can use on the options part that sets an index in the above. You can add id= and whatever you see in /proc/asound/card#/id if you have more than one card handled by the same driver. So "options snd-hda-intel index=0,id=SB" in the case of my current amd APU. But you shouldn't need that type of stuff these days. The .asoundrc lets you route things to non-0 cards. And few things are restricted to the ancient OSS style /dev/dsp sound setups these days. As long as your distro doesn't date back that far. But be aware that index numbers can shift between boots, if they are not hardcoded like the above.


All times are GMT -5. The time now is 03:28 PM.