1. How can I change the default audio device from command line?
- Normally Gui of Ubuntu allows you to do that (System->Preferences->Sound), like the default input/output device and setting the volume.
If that not works
1 2 3 4 5 6 7 8 |
You can control PulseAudio pacmd and pactl commands. For options see man pages or the wiki at PulseAudio: pacmd list-sinks to list name or index number of possible sinks pacmd set-default-sink "SINKNAME" to set the default output sink pacmd set-default-source "SOURCENAME" to set the default input pacmd set-sink-volume index volume pacmd set-source-volume index volume for volume control (0 = Mute, 65536 = 100%) and many many more CLI options. |
2. Use The AlsaMixer
F1 – Help
F2 – System Information
F6 – Select Sound Card
Esc – Exit the menu
3. Show the all of the sound devices
1 |
$ aplay -l |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
**** List of PLAYBACK Hardware Devices **** card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Generic [HD-Audio Generic], device 0: CX20757 Analog [CX20757 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 ~# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: SB [HDA ATI SB], device 0: ALC1150 Analog [ALC1150 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: SB [HDA ATI SB], device 1: ALC1150 Digital [ALC1150 Digital] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Generic [HD-Audio Generic], device 7: HDMI 1 [HDMI 1] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Generic [HD-Audio Generic], device 8: HDMI 2 [HDMI 2] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Generic [HD-Audio Generic], device 9: HDMI 3 [HDMI 3] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Generic [HD-Audio Generic], device 10: HDMI 4 [HDMI 4] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Generic [HD-Audio Generic], device 11: HDMI 5 [HDMI 5] Subdevices: 1/1 Subdevice #0: subdevice #0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
$ pacmd list-cards CODE: SELECT ALL Welcome to PulseAudio! Use "help" for usage information. >>> 2 card(s) available. index: 0 name: <alsa_card.pci-0000_00_01.1> driver: <module-alsa-card.c> owner module: 5 properties: alsa.card = "0" alsa.card_name = "HDA ATI HDMI" alsa.long_card_name = "HDA ATI HDMI at 0xf0244000 irq 46" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:00:01.1" sysfs.path = "/devices/pci0000:00/0000:00:01.1/sound/card0" device.bus = "pci" device.vendor.id = "1002" device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]" device.product.id = "9902" device.product.name = "Trinity HDMI Audio Controller" device.form_factor = "internal" device.string = "0" device.description = "Built-in Audio" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" profiles: output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: unknown) off: Off (priority 0, available: unknown) active profile: <output:hdmi-stereo> sinks: alsa_output.pci-0000_00_01.1.hdmi-stereo/#0: Built-in Audio Digital Stereo (HDMI) sources: alsa_output.pci-0000_00_01.1.hdmi-stereo.monitor/#0: Monitor of Built-in Audio Digital Stereo (HDMI) ports: hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: yes) properties: device.icon_name = "video-display" index: 1 name: <alsa_card.pci-0000_00_14.2> driver: <module-alsa-card.c> owner module: 6 properties: alsa.card = "1" alsa.card_name = "HD-Audio Generic" alsa.long_card_name = "HD-Audio Generic at 0xf0240000 irq 16" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:00:14.2" sysfs.path = "/devices/pci0000:00/0000:00:14.2/sound/card1" device.bus = "pci" device.vendor.id = "1022" device.vendor.name = "Advanced Micro Devices, Inc. [AMD]" device.product.id = "780d" device.product.name = "FCH Azalia Controller" device.form_factor = "internal" device.string = "1" device.description = "Built-in Audio" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" profiles: input:analog-stereo: Analog Stereo Input (priority 60, available: unknown) output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown) output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown) off: Off (priority 0, available: unknown) active profile: <output:analog-stereo> sinks: alsa_output.pci-0000_00_14.2.analog-stereo/#1: Built-in Audio Analog Stereo sources: alsa_output.pci-0000_00_14.2.analog-stereo.monitor/#1: Monitor of Built-in Audio Analog Stereo ports: analog-input-microphone-internal: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown) properties: device.icon_name = "audio-input-microphone" analog-input-microphone: Microphone (priority 8700, latency offset 0 usec, available: no) properties: device.icon_name = "audio-input-microphone" analog-output-speaker: Speakers (priority 10000, latency offset -30000 usec, available: unknown) properties: device.icon_name = "audio-speakers" analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no) properties: device.icon_name = "audio-headphones" |
Other Option list cards
1 |
lspci -nn | grep -i audio |
4. Change it from GRUB
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$nano /etc/default/grub Open grub as administrator with a text editor. Then change the line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.audio=1" Type on the terminal: sudo update-grub Reboot and your HDMI sound will work again. |
5. Change the config files and test it by Command Line
1 2 3 4 5 6 7 8 9 10 11 |
alsamixer lshw -c sound pacmd list-cards pacmd list-sinks load-module module-stream-restore restore_device=false apt-get install pulseaudio pulseaudio nano /etc/pulse/default.pa pac pacmd |
1 2 3 4 5 6 |
speaker-test -c 2 -r 48000 -D hw:0,3 speaker-test -c 2 -r 48000 -D hw:0,0 speaker-test -c 2 -r 48000 -D hw:0,1 speaker-test -c 2 -r 48000 -D hw:1,1 speaker-test -c 2 -r 48000 -D hw:1,3 gedit /etc/pulse/default.pa |
Reconfigure again for sound-base
1 2 3 4 5 6 7 8 |
dpkg-reconfigure linux-sound-base apt-get install linux-sound-base oss4-base alsactl store/alsactl nano /etc/asound.conf cat /proc/asound/modules nano /etc/modprobe.d/alsa-base.conf alsactl |
Restart PC test again, It works on my pc.
1 |
speaker-test -c 2 -r 48000 -D hw:1,3 |
This test is very important to find which sound card you need to use, 1, and 3 is important first is Device other is port.