You are not logged in.

#1 2018-10-26 00:06:32

Cryptix_00
Member
Registered: 2008-07-16
Posts: 112

[Solved] Dual alc1220 - Front Headphone audio plays through rear

I've had this issue for almost a year and done many hours of searching without success. the AX370 Gaming-5 has dual alc1220 audio.

Both of these detect correctly in hdajackretask, but when I plug my headphones in the front audio port, audio just continues playing out the speakers. I can see in pavucontrol it detects and switches to 'headphone' when I plug in headphones, but I'm not having any luck getting audio actually playing through the headphones.

❯ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALC1220 Analog [ALC1220 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: ALC1220 Digital [ALC1220 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 4: ALC1220 Analog [ALC1220 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

following this guide: https://frdmtoplay.com/gigabyte-front-p … ith-linux/

pacmd shows 2 sinks after running

pacmd load-module module-alsa-sink device=hw:1,4

before:

❯ pacmd list-sinks
1 sink(s) available.
  * index: 0
	name: <alsa_output.pci-0000_12_00.3.analog-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9039
	volume: front-left: 30771 /  47% / -19.70 dB,   front-right: 30771 /  47% / -19.70 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 0
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
	card: 1 <alsa_card.pci-0000_12_00.3>
	module: 7
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC1220 Analog"
		alsa.id = "ALC1220 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HDAudio-Gigabyte-ALC1220DualCodecs"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:12:00.3"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:12:00.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		device.product.id = "1457"
		device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
		device.string = "front:1"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "Family 17h (Models 00h-0fh) HD Audio Controller Analog Stereo"
		alsa.mixer_name = "Realtek ALC1220"
		alsa.components = "HDA:10ec1220,1458a0b8,00100003"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		analog-output-lineout: Line Out (priority 9900, latency offset 0 usec, available: yes)
			properties:
				
		analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
	active port: <analog-output-lineout>

after:

❯ pacmd list-sinks
2 sink(s) available.
  * index: 0
	name: <alsa_output.pci-0000_12_00.3.analog-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9039
	volume: front-left: 30771 /  47% / -19.70 dB,   front-right: 30771 /  47% / -19.70 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 0
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
	card: 1 <alsa_card.pci-0000_12_00.3>
	module: 7
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC1220 Analog"
		alsa.id = "ALC1220 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HDAudio-Gigabyte-ALC1220DualCodecs"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:12:00.3"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:12:00.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		device.product.id = "1457"
		device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
		device.string = "front:1"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "Family 17h (Models 00h-0fh) HD Audio Controller Analog Stereo"
		alsa.mixer_name = "Realtek ALC1220"
		alsa.components = "HDA:10ec1220,1458a0b8,00100003"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		analog-output-lineout: Line Out (priority 9900, latency offset 0 usec, available: yes)
			properties:
				
		analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
	active port: <analog-output-lineout>
    index: 1
	name: <alsa_output.hw_1_4>
	driver: <module-alsa-sink.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: IDLE
	suspend cause: (none)
	priority: 9030
	volume: front-left: 65532 / 100% / -0.00 dB,   front-right: 65532 / 100% / -0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 1363.64 ms
	max request: 344 KiB
	max rewind: 344 KiB
	monitor source: 1
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 1999.82 ms; range is 0.50 .. 1999.82 ms
	module: 27
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC1220 Analog"
		alsa.id = "ALC1220 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "4"
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HDAudio-Gigabyte-ALC1220DualCodecs"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:12:00.3"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:12:00.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		device.product.id = "1457"
		device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
		device.string = "hw:1,4"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.description = "Family 17h (Models 00h-0fh) HD Audio Controller"
		device.icon_name = "audio-card-pci"

Front panel audio works fine in win10 and I've double checked the connection on the motherboard. I'm at a complete loss for fixing this. Please help

additionally, pacmd can't seem to find my sinks (both 0 and 1 don't work)

❯ pacmd play-file test.mp3 0
No sink by that name.

Last edited by Cryptix_00 (2018-10-28 18:17:59)

Offline

#2 2018-10-26 00:26:12

Cryptix_00
Member
Registered: 2008-07-16
Posts: 112

Re: [Solved] Dual alc1220 - Front Headphone audio plays through rear

I am able to get some audio to play through the headphones with:

❯ aplay /dev/urandom -f dat -D plughw:1,4

and through the speakers with:

❯ aplay /dev/urandom -f dat -D plughw:1,0

But I still can't get anything else routed through the headphones.

Someone had a similar issue: https://bbs.archlinux.org/viewtopic.php?id=229543

and they posted the link I mentioned in the OP, but

pacmd move-sink-input 0 1

(the sink index) shows "No sink input found with this index"

Last edited by Cryptix_00 (2018-10-26 00:26:48)

Offline

#3 2018-10-26 08:59:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 5,723

Re: [Solved] Dual alc1220 - Front Headphone audio plays through rear

well are you sure that that sink input is actually the correct index? You have to use the sink index as printed by

pacmd list-sink-inputs

for any given audio stream (and as it's incremented for each new stream it will only be "0" for the very first attempt at playing something, therefore quite unlikely). Also before you continue pursuing this manual alsa sink loading raindance, which kernel are you using? If you are on LTS it has some known problems with this codec that shouldn't be present anymore with the 4.18 kernel. FWIW you might also want to use pavucontrol as it gives you a GUI to help you grok the workings of pulse if you aren't yet familiar with it.

Also, you might have some global trigger to switch behaviour, what's the output of

amxer -c1

Last edited by V1del (2018-10-26 09:03:30)

Offline

#4 2018-10-27 02:21:24

Cryptix_00
Member
Registered: 2008-07-16
Posts: 112

Re: [Solved] Dual alc1220 - Front Headphone audio plays through rear

Thanks for replying, I think you're right I wasn't using the correct index, list-sink-inputs:

❯ pacmd list-sink-inputs
1 sink input(s) available.
    index: 31
	...
❯ pacmd move-sink-input 31 1

this gets audio playing out of the front headphones, but i'd rather not have to do it manually every time.

uname shows I am on the 4.18 kernel

❯ uname -ar
Linux leshowbox 4.18.16-arch1-1-ARCH #1 SMP PREEMPT Sat Oct 20 22:06:45 UTC 2018 x86_64 GNU/Linux
❯ amixer -c1
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 67 [77%] [-15.00dB] [on]
  Front Right: Playback 67 [77%] [-15.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Front',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [on]
  Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Front Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 3 [100%] [30.00dB]
  Front Right: 3 [100%] [30.00dB]
Simple mixer control 'Front-Panel',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 0 [0%] [-17.25dB] [off]
  Front Right: Capture 0 [0%] [-17.25dB] [off]
Simple mixer control 'Surround',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 0 [0%] [-65.25dB] [off]
  Front Right: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'Center',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'LFE',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'Line Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 0 [0%] [-17.25dB] [off]
  Front Right: Capture 0 [0%] [-17.25dB] [off]
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Rear Mic' 'Line'
  Item0: 'Line'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Rear Mic' 'Line'
  Item0: 'Rear Mic'
Simple mixer control 'Rear Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Rear-Panel',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 0 [0%] [-17.25dB] [off]
  Front Right: Capture 0 [0%] [-17.25dB] [off]

With the headphones plugged in, switching port under "output devices" in pavucontrol only does what it did before: alternate playing through the speakers at different levels of volume. I can see that it is definitely switching something, changing the volume when headphones are plugged in affects the headphone volume. But no audio is going through headphones unless I manually move the sink input over.

any ideas how I can get this working when I plug in the headphones? route all audio to a particular sink?

edit: It appears if I go to the playback tab on pavucontrol and show all streams I can move a particular sink between the two, so that works. It would be nice to move everything over automatically when it's plugged in though

Last edited by Cryptix_00 (2018-10-27 02:34:04)

Offline

#5 2018-10-28 18:16:53

Cryptix_00
Member
Registered: 2008-07-16
Posts: 112

Re: [Solved] Dual alc1220 - Front Headphone audio plays through rear

I'll mark this as solved, as I was able to get some level of automation over switching all sinks over.

I came across paswitch, which will route everything through a particular output device https://www.tablix.org/~avian/blog/arch … ut_device/

For posterity, this is my current solution:

find your device in pacmd list-sinks, then

paswitch alsa_output.hw_1_4

for headphones and

paswitch alsa_output.pci-0000_12_00.3.analog-stereo

for speakers. Obviously, your device names will be different. I did find a script someone made that automates this on the headphone event, but I have yet to try it: https://unix.stackexchange.com/question … -connected

Offline

#6 2018-11-05 00:41:24

Mannex
Member
From: Sweden
Registered: 2010-02-26
Posts: 12

Re: [Solved] Dual alc1220 - Front Headphone audio plays through rear

Thanks for a simple solution; Chiming in with one of my own for the AX370 Gaming K7, not much difference between them really.
Enabled my Front panel Headphone audio just now,
editing

/usr/share/alsa/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/HiFi.conf

owned by the alsa-lib package interpreted by pulseaudio.
from:

cdev "hw:PCH"

be aware of variants like cdev "hw:PCH,4" exist
into:

cdev "hw:Generic"
cdev "hw:Generic,4"

What led me there is aplay -l shows PCH on Intel motherboard with the same ALC1220 dual-codecs, on ours it should be Generic from "2: Generic [HD-Audio Generic], device 0: ALC1220 Analog [ALC1220 Analog]"

You can probably tweak even further since I suspect you may have to create something for the Digital devices too.

Last edited by Mannex (2018-11-07 20:03:45)

Offline

#7 2018-11-09 04:22:02

Cryptix_00
Member
Registered: 2008-07-16
Posts: 112

Re: [Solved] Dual alc1220 - Front Headphone audio plays through rear

Did you edit every entry in that file from PCH -> Generic? Sorry for the dumb question, but you did this in order to solve the same issue?

One annoying thing about the way I solved it is I still have to stick a `pacmd load-module` command somewhere on startup.

Offline

#8 2018-11-09 08:24:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 5,723

Re: [Solved] Dual alc1220 - Front Headphone audio plays through rear

You can also stick the load-module command (without the pacmd) into your /etc/pulse/default.pa that way it will be invoked on each pulse start, without having to worry about which environment is starting pulse

Offline

#9 2018-11-16 10:28:30

Mannex
Member
From: Sweden
Registered: 2010-02-26
Posts: 12

Re: [Solved] Dual alc1220 - Front Headphone audio plays through rear

Cryptix_00 wrote:

Did you edit every entry in that file from PCH -> Generic? Sorry for the dumb question, but you did this in order to solve the same issue?

One annoying thing about the way I solved it is I still have to stick a `pacmd load-module` command somewhere on startup.

Sorry, didn't see this until now.
Same issue, I did also give pulseaudio paths/profile-set a go, but with less successful results, I'm still trying to figure out Capture channels.

Anyway with this, Rear Headphone is on "Line Out" and Front HP is now shared Headphone + Speaker.
https://gist.github.com/dyrverE/f377215 … 8359288d94 there it is currently

Offline

Board footer

Powered by FluxBB