Advertisement
emilwojcik93

pulseaudio dla głupiego Wieśka :)

Dec 27th, 2021
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.25 KB | None | 0 0
  1. #####
  2. Upgrade systemu i problemy z dźwiękiem
  3. z poziomu usera:
  4. systemctl --user stop pulseaudio.service && systemctl --user stop pulseaudio.socket
  5. z poziomu roota:
  6. apt autoremove --purge -y alsa-base alsa-utils pulseaudio linux-sound-base libatopology2 libwebrtc-audio-processing1 xfce4-pulseaudio-plugin
  7. rm -rf ~/.config/pulse /tmp/pulse* ~/.pulse ~/.pulse-cookie /etc/pulse
  8. apt autoclean && sudo apt autoremove -y
  9. apt update && sudo apt upgrade -y
  10. shutdown now
  11.  
  12. apt install -y alsa-base alsa-utils pulseaudio linux-sound-base libatopology2 libwebrtc-audio-processing1 xfce4-pulseaudio-plugin
  13.  
  14.  
  15. sudo cat << EOF >> /etc/pulse/default.pa
  16.  
  17. ### Enable Echo/Noise-Cancellation
  18. load-module module-echo-cancel use_master_format=1 aec_method=webrtc aec_args="analog_gain_control=0\ digital_gain_control=1\ noise_suppression=1\ voice_detection=1\ agc_start_volume=85" source_name=echoCancel_source sink_name=echoCancel_sink
  19. set-default-source echoCancel_source
  20. #set-default-sink echoCancel_sink
  21. EOF
  22.  
  23. tail -n4 /etc/pulse/default.pa
  24.  
  25. z poziomu usera
  26. systemctl --user enable pulseaudio
  27. shutdown now
  28.  
  29.  
  30. Statyczny szum (opcjonalnie/profilaktycznie)
  31. znajdz i odkomentuj (usuń ";") i zmień wartość w "/etc/pulse/daemon.conf" (zapewne linia 54)
  32. avoid-resampling = yes
  33.  
  34. sudo sed 's/; avoid-resampling = false/avoid-resampling = yes/g' -i /etc/pulse/daemon.conf && grep -Fx "avoid-resampling = yes" /etc/pulse/daemon.conf
  35.  
  36. sprawdź "hw:x, y" twojej karty dźwiękowej
  37. arecord --list-devices | grep card
  38.  
  39. card 1: PCH [HDA Intel PCH], device 0: ALC3226 Analog [ALC3226 Analog]
  40.  
  41.  
  42. nagraj próbkę
  43. arecord -f dat -r 60000 -D hw:1,0 -d 5 ~/Desktop/test.wav
  44.  
  45. Recording WAVE 'Desktop/test.wav' : Signed 16 bit Little Endian, Rate 60000 Hz, Stereo
  46. Warning: rate is not accurate (requested = 60000Hz, got = 48000Hz)
  47.          please, try the plug plugin
  48.  
  49. sprawdź aktualną wartość
  50. grep "default-sample-rate" /etc/pulse/daemon.conf
  51. ; default-sample-rate = 44100
  52.  
  53. Podmień wartość za pomocą komendy:
  54. sudo sed 's/; default-sample-rate = 44100/default-sample-rate = 48000/g' -i /etc/pulse/daemon.conf && grep -Fx "default-sample-rate = 48000" /etc/pulse/daemon.conf
  55.  
  56. systemctl --user restart pulseaudio.service
  57.  
  58. arecord -f dat -r 48000 -D hw:1,0 -d 10 Desktop/test.wav
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement