WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [wiki][intel analog] New tests and possible solution (test 7) to swap cards  (Read 1294 times)

aus9

  • Guest
Longer title: wiki not yet edittable but is now wrong in some sections.  These are tests run on 64 bit 11.1.x  GOAL for intel analog users with
Code: [Select]
aplay -l showing analog is card 1, swap the index.
Goal 2 so aplay -l will show analog has card 0 and if no pulseaudio is running....alsamixer will show analog mixer levels.  You can still run pulseaudio but then you will need
Code: [Select]
alsamixer -c0Unless  specified below, assume no ~/.asoundrc,  no /etc/asound.conf, no entry for intel in /etc/modprobe.conf, no script autoload with Desktop, no entry for intel in bootlocal.sh, no blacklist bootcode. Each test is independent of files for the other tests, but I will mention if I re-use some files. It is deliberate that I have named files with different names to help trouble-shoot if needed. 
FAILS=aplay -l shows analog on card 1 or higher........PASS=aplay -l shows analog on card=0

Test 1 FAILS
Boot with bootcode of  blacklist=snd_hda_intel
alsaconfig and alsa in your boot list
Manually load intel module by
Code: [Select]
$ sudo modprobe snd_hda_intel index=1
Test 2 FAILS
alsaconfig and alsa in your boot list
Code: [Select]
$ echo '/sbin/modprobe -r snd_hda_intel
/sbin/modprobe snd_hda_intel index=1' >> /opt/bootlocal.sh
Reboot with backup enabled

Test 3 FAILS
alsaconfig and alsa in your boot list
Create a home asoundrc config with
Code: [Select]
$ echo 'pcm.!default {
        type hw
        card 1
}

ctl.!default {
        type hw           
        card 1
} ' > ~/.asoundrc
https://www.alsa-project.org/wiki/Asoundrc
There are more complicated configs that can be made. This is just to swap cards.
Reboot with backup enabled

Test 4 FAILS
alsaconfig and alsa in your boot list
Code: [Select]
$ sudo echo 'options snd_hda_intel index=1 ' >> /etc/modprobe.conf  && echo 'etc/modprobe.conf ' >> /opt/.filetool.lst 
Reboot with backup enabled.

Test 5 PASS
Remove alsa-config and alsa from boot list
Keep /etc/modprobe.conf and /opt/.filetool.lst
Reboot with backup enabled
Manually load TCEs with
Code: [Select]
$ tce-load -i alsa-config alsa
###########################
Independent now save mixer levels
###########################
ref
https://linux.die.net/man/1/alsactl
With test 5 success time to save mixer levels by
Code: [Select]
alsamixer
# set your mixer levels, if you see your analog device
# press ESCape key to exit alsamixer
$ sudo alsactl store && echo 'usr/local/etc/alsa/asound.state'  >> /opt/.filetool.lst 


Test 6 PASS
No reboot
Keep /etc/modprobe.conf and /opt/.filetool.lst
Code: [Select]
$ echo '#!/bin/sh
tce-load -i alsa-config alsa
sudo alsactl restore ' > ~/.local/bin/intel && chmod 744 ~/.local/bin/intel   
Reboot with backup enabled
Code: [Select]
$ intel

Test 7 for non-wayland users PASS.................This is my current setup
Reboot
Keep /etc/modprobe.conf, /opt/.filetool.lst and ~/.local/bin/intel
Code: [Select]
echo  '~/.local/bin/intel   ' > ~/.X.d/intel-swap && chmod 644 ~/.X.d/intel-swap Reboot with backup enabled

In case its not obvious, test 7 means that on each boot up,
alsamixer shows card 0
aplay -l shows analog with card index=0
and my mixer levels are correct.
No alsa-config nor alsa are in my boot list
and I have files:
Quote
~/.X.d/intel-swap
~/.local/bin/intel
/etc/modprobe.conf
 /opt/.filetool.lst
/usr/local/etc/alsa/asound.state

/opt/.filetool.lst reads (in addition to your other lines)
Quote
etc/modprobe.conf
usr/local/etc/alsa/asound.state

~/.local/bin/intel  reads
Quote
#!/bin/sh
tce-load -i alsa-config alsa
sudo alsactl restore

~/.X.d/intel-swap reads
Quote
~/.local/bin/intel

/etc/modprobe.conf reads
Quote
options snd_hda_intel index=1

Hope this helps.
« Last Edit: April 23, 2020, 01:51:49 AM by aus9 »

aus9

  • Guest
In addition as per wiki Rich suggests some members may need

Code: [Select]
alsactl initI wrote that poorly IMHO it should have been written with a sudo prefix.

I don't need it but for some you may need to modify

~/.local/bin/intel  reads
Quote
#!/bin/sh
tce-load -i alsa-config alsa
sudo alsactl init
sudo alsactl restore

and you may need that init command before being able to see your mixer levels with alsamixer