View previous topic :: View next topic |
Author |
Message |
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Fri May 08, 2020 12:51 pm Post subject: Kernel config and HDMI |
|
|
Hi,
I would like to use the utility pactl to change the audio output device from CLI.
Until a couple of months ago it was working as expected, unfortunately I can not define exactly what is the difference.
If I type:
Code: |
pactl move-sink-input 1 5
|
to move the sink-input 5 to 1, where 1 is hdmi, while a video is playing on mpv or via youtube, the video starts to hardly stutter (a lot of dropped frames) even if there is no heavy load on the CPU.
Instead if I move to 0 (speaker) it returns to normal playback.
I have tried to ru the same command on a Kubuntu 20.04 live and the problem is not present.
Any ideas?
Thanks
Last edited by yellowhat on Sun May 10, 2020 1:39 pm; edited 1 time in total |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sat May 09, 2020 4:12 pm Post subject: |
|
|
I have tried:
Code: |
$ echo "options snd_hda_intel index=1,0" > /etc/modprobe.d/alsa-base.conf
|
Code: |
$ diff /etc/pulse/default.pa
< load-module module-udev-detect
---
> load-module module-udev-detect tsched=0
|
- Commenting "load-module module-switch-on-port-available" in /etc/pulse/default.pa
but nothing is changed.
This is the list of modules loaded:
Code: |
$ pact list short modules
0 module-device-restore
1 module-stream-restore
2 module-card-restore
3 module-augment-properties
4 module-switch-on-port-available
5 module-udev-detect tsched=0
6 module-alsa-card device_id="2" name="pci-0000_01_00.1" card_name="alsa_card.pci-0000_01_00.1" namereg_fail=false tsched=no fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
7 module-alsa-card device_id="0" name="pci-0000_00_03.0" card_name="alsa_card.pci-0000_00_03.0" namereg_fail=false tsched=no fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
8 module-alsa-card device_id="1" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=no fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
9 module-bluetooth-policy
10 module-bluetooth-discover
11 module-bluez5-discover
12 module-native-protocol-unix
13 module-gsettings
14 module-default-device-restore
15 module-rescue-streams
16 module-always-sink
17 module-intended-roles
18 module-suspend-on-idle
19 module-console-kit
20 module-systemd-login
21 module-position-event-sounds
22 module-role-cork
23 module-filter-heuristics
24 module-filter-apply
25 module-cli-protocol-unix
|
|
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sun May 10, 2020 10:04 am Post subject: |
|
|
Seems to be a kernel configuration issue, with gentoo-kernel-bin works expected.
How can I check which config options should I check?
Thanks |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sat Nov 21, 2020 11:59 am Post subject: |
|
|
If I try to grep the Audio devices I get:
Code: |
$ sudo lspci -vnnn | grep Audio -A 10
00:03.0 Audio device [0403]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
Subsystem: Lenovo Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [17aa:2211]
Flags: bus master, fast devsel, latency 0, IRQ 38, IOMMU group 3
Memory at b2a30000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [50] Power Management version 2
Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit-
Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
Kernel driver in use: snd_hda_intel
--
00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 04)
Subsystem: Lenovo 8 Series/C220 Series Chipset High Definition Audio Controller [17aa:2211]
Flags: bus master, fast devsel, latency 0, IRQ 37, IOMMU group 8
Memory at b2a34000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [50] Power Management version 2
Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
Capabilities: [100] Virtual Channel
Kernel driver in use: snd_hda_intel
--
01:00.1 Audio device [0403]: NVIDIA Corporation GK106 HDMI Audio Controller [10de:0e0b] (rev a1)
Subsystem: Lenovo GK106 HDMI Audio Controller [17aa:221e]
Flags: bus master, fast devsel, latency 0, IRQ 17, IOMMU group 1
Memory at b1000000 (32-bit, non-prefetchable) [size=16K]
Capabilities: [60] Power Management version 3
Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [78] Express Endpoint, MSI 00
Kernel driver in use: snd_hda_intel
|
as you can see there are 3 audio devices, instead:
Code: |
$ pactl list short sinks
1 alsa_output.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 48000Hz SUSPENDED
4 alsa_output.pci-0000_00_03.0.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
|
returns only 2 devices.
How do I enable the missing one?
Thanks |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sat Nov 21, 2020 12:27 pm Post subject: |
|
|
I manage to get mpv working.
The following allows to get a list of audio devices:
Code: |
$ mpv --audio-device=help
List of detected audio devices:
'auto' (Autoselect device)
'pulse/alsa_output.pci-0000_00_03.0.hdmi-stereo' (Built-in Audio Digital Stereo (HDMI))
'pulse/alsa_output.pci-0000_00_1b.0.analog-stereo' (Built-in Audio Analog Stereo)
'alsa' (Default (alsa))
'alsa/upmix' (Plugin for channel upmix (4,6,8))
'alsa/vdownmix' (Plugin for channel downmix (stereo) with a simple spacialization)
'alsa/hdmi:CARD=HDMI,DEV=0' (HDA Intel HDMI, HDMI 0/HDMI Audio Output)
'alsa/hdmi:CARD=HDMI,DEV=1' (HDA Intel HDMI, HDMI 1/HDMI Audio Output)
'alsa/hdmi:CARD=HDMI,DEV=2' (HDA Intel HDMI, HDMI 2/HDMI Audio Output)
'alsa/hdmi:CARD=HDMI,DEV=3' (HDA Intel HDMI, HDMI 3/HDMI Audio Output)
'alsa/hdmi:CARD=HDMI,DEV=4' (HDA Intel HDMI, HDMI 4/HDMI Audio Output)
'alsa/usbstream:CARD=HDMI' (HDA Intel HDMI/USB Stream Output)
'alsa/sysdefault:CARD=PCH' (HDA Intel PCH, ALC3232 Analog/Default Audio Device)
'alsa/front:CARD=PCH,DEV=0' (HDA Intel PCH, ALC3232 Analog/Front output / input)
'alsa/surround21:CARD=PCH,DEV=0' (HDA Intel PCH, ALC3232 Analog/2.1 Surround output to Front and Subwoofer speakers)
'alsa/surround40:CARD=PCH,DEV=0' (HDA Intel PCH, ALC3232 Analog/4.0 Surround output to Front and Rear speakers)
'alsa/surround41:CARD=PCH,DEV=0' (HDA Intel PCH, ALC3232 Analog/4.1 Surround output to Front, Rear and Subwoofer speakers)
'alsa/surround50:CARD=PCH,DEV=0' (HDA Intel PCH, ALC3232 Analog/5.0 Surround output to Front, Center and Rear speakers)
'alsa/surround51:CARD=PCH,DEV=0' (HDA Intel PCH, ALC3232 Analog/5.1 Surround output to Front, Center, Rear and Subwoofer speakers)
'alsa/surround71:CARD=PCH,DEV=0' (HDA Intel PCH, ALC3232 Analog/7.1 Surround output to Front, Center, Side, Rear and Woofer speakers)
'alsa/usbstream:CARD=PCH' (HDA Intel PCH/USB Stream Output)
'alsa/hdmi:CARD=NVidia,DEV=0' (HDA NVidia, HDMI 0/HDMI Audio Output)
'alsa/hdmi:CARD=NVidia,DEV=1' (HDA NVidia, HDMI 1/HDMI Audio Output)
'alsa/hdmi:CARD=NVidia,DEV=2' (HDA NVidia, HDMI 2/HDMI Audio Output)
'alsa/hdmi:CARD=NVidia,DEV=3' (HDA NVidia, HDMI 3/HDMI Audio Output)
'alsa/usbstream:CARD=NVidia' (HDA NVidia/USB Stream Output)
|
It works if I select Code: | alsa/hdmi:CARD=HDMI,DEV=0 |
Any ideas why Code: | pulse/alsa_output.pci-0000_00_03.0.hdmi-stereo | is no working? |
|
Back to top |
|
|
poe_1957 Apprentice
Joined: 26 Sep 2018 Posts: 192 Location: Mortsel
|
Posted: Mon Nov 30, 2020 11:51 am Post subject: my 2 cents |
|
|
DId you check alsamixergui ? _________________ Linuxpioneer
ALUG |
|
Back to top |
|
|
Banana Moderator
Joined: 21 May 2004 Posts: 1721 Location: Germany
|
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Mon Nov 30, 2020 6:12 pm Post subject: |
|
|
So alsamixer returns 4 cards:
1. (default)[/code] that is pulseaudio
2. HDA Intel HDMI that has 5 S/PDIF
3. HDA Intel PCH that has Master/Headphone/Speaker/PCM/...
4. HDA NVidia that has 4 S/PDIF
even if I try to change the sound card with "F6" the output sound does not change.
And got the same behavior in mpv.
Code: |
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC3232 Analog [ALC3232 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
|
|
|
Back to top |
|
|
poe_1957 Apprentice
Joined: 26 Sep 2018 Posts: 192 Location: Mortsel
|
Posted: Sat Dec 05, 2020 3:19 pm Post subject: Alsmixer |
|
|
If one is working then the other ways of decoding do not work.
for example if the analog audio is working the digital audio does not work. You have to switch manually.
Also check if your headphone is not connected.
Sound volume is not muted etc on each channel. _________________ Linuxpioneer
ALUG |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sat Dec 05, 2020 3:59 pm Post subject: |
|
|
I am not sure what do you mean by "for example if the analog audio is working the digital audio does not work. You have to switch manually.". How can switch it?
There is no headphone connect, just the displayport to hdmi cable.
I do not think is a problem of muting as when I select the pulse/alsa_output.pci-0000_00_03.0.hdmi-stereo output the video freezes in mpv |
|
Back to top |
|
|
poe_1957 Apprentice
Joined: 26 Sep 2018 Posts: 192 Location: Mortsel
|
Posted: Sun Dec 06, 2020 5:00 pm Post subject: |
|
|
Even if you have no headphone connected to it your motherboard has probably a socket for headphones or analog output besides HDMI. Look for red, green, connectors
You switch it in KMIX on your desktopbar if you have KDE desktop. ( you have 2 icons then).
On other desktops it will be a similar option in your audiocontrol application.
You might be missing a software application that you need to install if you cannot do it. Anyway that is the way forward.
Currently there is a problem with the alsamixergui. It does not compile due to a illegal converting from string to char issue.
What also helps : instead of putting it as a module put everything in the kernel. <*> instead of <M>.
That may also be a problem : everything as a module or everything included. _________________ Linuxpioneer
ALUG |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sun Dec 06, 2020 5:06 pm Post subject: |
|
|
I am using sway on pure wayland.
The problem is that it works if I use the gentoo-kernel-bin, so it is definitely related to my kernel config.
I have tried to compile a kernel with make allmodconfig, but it will just kernel panic on boot. |
|
Back to top |
|
|
poe_1957 Apprentice
Joined: 26 Sep 2018 Posts: 192 Location: Mortsel
|
Posted: Sun Dec 06, 2020 6:09 pm Post subject: |
|
|
Yes, wayland is a problem. Too much loose ends to me. Still experimental.
I stay with X11 and KDE. I recently switched to SYSTEMD. It works but if it fails...
New software is not so stable as it used to be. _________________ Linuxpioneer
ALUG |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Fri Apr 09, 2021 5:55 pm Post subject: |
|
|
Recently I was not able to having audio over HDMI, to make it works I have to comment the entire content of /etc/modprobe.d/alsa.conf.
But the sound is crackling any suggestions?
Thanks |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Tue Sep 07, 2021 5:36 pm Post subject: |
|
|
After a long time I have decided to have another look at this.
I have tried to enable:
Code: |
[*] Verbose printk
[*] Debug
[*] More verbose debug
[*] Enable PCM ring buffer overrun/underrun debugging
[*] Perform sanity-checks for each control element access
[*] Sound jack injection interface via debugfs
|
under Device drivers -> Sound card support -> ALSA.
But I am not able to see anything different in dmesg.
Is there anything else to enable?
Thanks |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Fri Sep 17, 2021 9:07 pm Post subject: |
|
|
Another small update.
I have noticed that if I apply the following changes:
< # CONFIG_SND_DEBUG is not set
---
> CONFIG_SND_DEBUG=y
> CONFIG_SND_DEBUG_VERBOSE=y
> CONFIG_SND_PCM_XRUN_DEBUG=y
> CONFIG_SND_CTL_VALIDATION=y
> CONFIG_SND_JACK_INJECTION_DEBUG=y
Wait about 90 seconds after boot (do not ask me how I find out, took many many trials), audio over display port works as expected.
Am I missing something in my config?
Is this related to nouveau? |
|
Back to top |
|
|
|