Advertisement
pierostrada

audiocheck.sh

Feb 23rd, 2023 (edited)
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.19 KB | Source Code | 0 0
  1. #!/bin/bash
  2. version="5-2023-03-06@16:48"
  3. author="https://forum.endeavouros.com/u/storm/"
  4. about="Generates a set of log files in current or '$1' directory
  5. about the current kernel/audio configuration in case of 'Dummy Output', as happens with
  6. kernels 'linux-lts 6.1.15-1' and 'linux 6.2.2.arch1-1' with audio via HDMI
  7. (Kernel '5.15.96.61.realtime1-1-rt-lts' works well)."
  8.  
  9. Hn="`hostname | tr '[:upper:]' '[:lower:]'`"
  10. Kt=$(uname -r | cut -d- -f 3-)  #Kernel type [rt-]lts or '_'
  11. [[ "$Kt" = '' ]] && Kt='_'
  12. pfix="aud-${Kt}"
  13.  
  14. [[ -d "$1" ]] && pth=${@%/} || pth="`pwd`"
  15. echo "Audio report di [($pth/)$Hn] in corso:"
  16.  
  17. #https://forum.endeavouros.com/t/pulseaudio-speakers-not-getting-detected-port-is-unplugged/38049
  18. ouFile="$pth/$Hn-$pfix-pipedaemons.log"
  19. echo "Generazione $ouFile"
  20. echo '$ systemctl --user status pipewire pipewire-pulse' > "$ouFile"
  21. systemctl --user status pipewire pipewire-pulse >> "$ouFile"
  22.  
  23. #https://bbs.archlinux.org/viewtopic.php?id=96337
  24. ouFile="$pth/$Hn-$pfix-modinfo.log"
  25. echo "Generazione $ouFile"
  26. echo '$ sudo modinfo soundcore' > "$ouFile"
  27. sudo modinfo soundcore >> "$ouFile"
  28.  
  29. ouFile="$pth/$Hn-$pfix-alsa-info.log"
  30. echo "Generazione $ouFile"
  31. echo '$ sudo alsa-info.sh --stdout' > "$ouFile"
  32. sudo alsa-info.sh --stdout >> "$ouFile"
  33.  
  34. ouFile="$pth/$Hn-$pfix-pac-alsa.log"
  35. echo "Generazione $ouFile"
  36. echo '$ pacman -Qs alsa' > "$ouFile"
  37. pacman -Qs alsa >> "$ouFile"
  38.  
  39. ouFile="$pth/$Hn-$pfix-pac-pulseaudio.log"
  40. echo "Generazione $ouFile"
  41. echo '$ pacman -Qs pulseaudio' > "$ouFile"
  42. pacman -Qs pulseaudio >> "$ouFile"
  43.  
  44. ouFile="$pth/$Hn-$pfix-pac-pipewire.log"
  45. echo "Generazione $ouFile"
  46. echo '$ pacman -Qs pipewire' > "$ouFile"
  47. pacman -Qs pipewire >> "$ouFile"
  48.  
  49. ouFile="$pth/$Hn-$pfix-iaa.log"
  50. echo "Generazione $ouFile"
  51. echo '$ inxi -Aa' > "$ouFile"
  52. inxi -Aa >> "$ouFile"
  53.  
  54. ouFile="$pth/$Hn-$pfix-alsa.log"
  55. echo "Generazione $ouFile"
  56. echo '$ uname -a' > "$ouFile"
  57. uname -a >> "$ouFile"
  58. echo >> "$ouFile"
  59. echo '$ grep "^GRUB_CMDLINE" /etc/default/grub' >> "$ouFile"
  60. grep '^GRUB_CMDLINE' /etc/default/grub >> "$ouFile"
  61. echo >> "$ouFile"
  62. echo '$ cat /proc/asound/modules' >> "$ouFile"
  63. cat /proc/asound/modules >> "$ouFile"
  64. echo >> "$ouFile"
  65. #As suggested by [joekamprad](https://forum.endeavouros.com/u/joekamprad) Der Doktor in https://forum.endeavouros.com/t/no-sound-from-front-audio-jack/30375/14
  66. echo "sudo modprobe snd_hda_codec >> $ouFile"
  67. sudo modprobe snd_hda_codec >> "$ouFile" 2>&1
  68. echo "sudo modprobe snd_hda_intel >> $ouFile"
  69. sudo modprobe snd_hda_intel >> "$ouFile" 2>&1
  70. #echo '$ sudo modprobe snd_hda_intel_codec' >> "$ouFile"
  71. #sudo modprobe snd_hda_intel_codec >> "$ouFile" 2>&1
  72. echo >> "$ouFile"
  73. echo '$ lsmod | grep snd' >> "$ouFile"
  74. lsmod | grep snd >> "$ouFile"
  75. echo >> "$ouFile"
  76. echo '$ ls /etc/modprobe.d/ ' >> "$ouFile"
  77. ls /etc/modprobe.d/ >> "$ouFile"
  78. echo >> "$ouFile"
  79. echo '$ cat /etc/modprobe.d/blacklist.conf' >> "$ouFile"
  80. cat /etc/modprobe.d/blacklist.conf >> "$ouFile" 2>&1
  81. echo >> "$ouFile"
  82. echo '$ cat /etc/modprobe.d/disable-dmic.conf' >> "$ouFile"
  83. cat /etc/modprobe.d/disable-dmic.conf >> "$ouFile" 2>&1
  84. echo >> "$ouFile"
  85. echo '$ cat /etc/modprobe.d/alsa-base.conf' >> "$ouFile"
  86. cat /etc/modprobe.d/alsa-base.conf >> "$ouFile" 2>&1
  87. echo '$ aplay -l' >> "$ouFile"
  88. aplay -l >> "$ouFile"
  89. echo >> "$ouFile"
  90. echo '$ lspci -v | grep -A7 -i "audio"' >> "$ouFile"
  91. lspci -v | grep -A7 -i "audio" >> "$ouFile"
  92. echo >> "$ouFile"
  93. echo '$ sudo lspci -v | grep -A7 -i "audio"' >> "$ouFile"
  94. sudo lspci -v | grep -A7 -i "audio" >> "$ouFile"
  95.  
  96. ouFile="$pth/$Hn-$pfix-iFull.log"
  97. echo "Generazione $ouFile"
  98. echo '$ inxi -Fxxxza --no-host' > "$ouFile"
  99. inxi -Fxxxza --no-host >> "$ouFile"
  100.  
  101. ouFile="$pth/$Hn-$pfix-neofetch.log"
  102. echo "Generazione $ouFile"
  103. echo '$ neofetch --off --stdout' > "$ouFile"
  104. neofetch --off --stdout >> "$ouFile"
  105.  
  106. ouFile="$pth/$Hn-$pfix-pactl-sinks.log"
  107. echo "Generazione $ouFile"
  108. echo '$ pulsemixer -l' > "$ouFile"
  109. pulsemixer -l >> "$ouFile"
  110. echo >> "$ouFile"
  111. echo '$ pactl list short sinks' >>"$ouFile"
  112. pactl list short sinks >> "$ouFile"
  113. echo >> "$ouFile"
  114. echo '$ pactl list sinks' >> "$ouFile"
  115. pactl list sinks >> "$ouFile"
  116. echo
  117. echo "Audio report concluso, test con $ speaker-test -c 2"
  118. echo
  119. ls $pth/$Hn-$pfix-*.log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement