Bug 111021

Summary: No Sound, SB ZxRi Card not showing in lspci, Codec is detected. SSID 1458:A046
Product: Drivers Reporter: David Giard (swe3tdave)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: NEW ---    
Severity: normal CC: jk, kernel, robink, superquad.vortex2, szg00000, tiwai
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.4.0 Tree: Mainline
Regression: No
Attachments: Alsa-Info
dmesg
lspci
alsa-info with model=generic to snd-hda-intel and --no-upload command line option
Patch to degrade the error message level about i915 component
Patch to fix model=generic
Alsa-info with sound.git kernel, model=generic and 2 patches
Patch #1: SB Z support
Patch #2: SB ZxRi support
alsa-info with SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZXRI),
alsa-info with SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZ),
Alsa-info second kernel with model=generic
alsa-info with model=generic and clean shutdown, kernel with SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZXRI),
alsa-info with model=generic and clean shutdown, kernel with SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZ),
alsa-info with model=generic, with flash of bios from backup and kernel with CA0132_GEN_FIXUP_SBZXRI
alsa-info without model=generic, and kernel with CA0132_GEN_FIXUP_SBZXRI
alsa-info without model=generic, and kernel with CA0132_GEN_FIXUP_SBZ
Alsa-Info on Ubuntu-Mate 15.10
Alsa-Info with both headphone barely port working
Example not to be applied

Description David Giard 2016-01-19 19:54:27 UTC
Created attachment 200481 [details]
Alsa-Info

No sound, Integrated Sound Blaster ZxRi on Gigabyte Z170X Gaming G1 motherboard.

I tried the back and front ports as well. The card does not show in lspci -nn.

I was wondering if the card was tied up with the HDMI audio on the board...

Here's a few info i got on windows:

DeviceName        : Sound Blaster ZxRi
DeviceClass       : MEDIA
DeviceClassGUID       : {4d36e96c-e325-11ce-bfc1-08002be10318}
DeviceID      : HDAUDIO\FUNC_01&VEN_1102&DEV_0011&SUBSYS_1458A046&REV_1009\4&313518F0&0&0001
DeviceHardwareID  : HDAUDIO\FUNC_01&VEN_1102&DEV_0011&SUBSYS_1458A046&REV_1009
DriverVersion     : 6.0.101.1042
DriverProvider        : CREATIVE
DriverDescription : Sound Blaster ZxRi
DeviceManufacturer    : Creative Technology Ltd.

CompatibleID	: HDAUDIO\FUNC_01&CTLR_VEN_8086&CTLR_DEV_A170&VEN_1102&DEV_0011&REV_1009
Siblings	: HDAUDIO\FUNC_01&VEN_8086&DEV_2809&SUBSYS_80860101&REV_1000\4&313518f0&0&0201
Comment 1 David Giard 2016-01-19 19:56:44 UTC
Created attachment 200491 [details]
dmesg
Comment 2 David Giard 2016-01-19 19:57:06 UTC
Created attachment 200501 [details]
lspci
Comment 3 David Giard 2016-01-19 23:42:46 UTC
ok found information here from someone that has the same motherboard:

https://www.redhat.com/archives/vfio-users/2015-October/msg00225.html
https://www.redhat.com/archives/vfio-users/2015-October/msg00258.html

Seems like he is passing through the intel hd audio(1f.3) as a bus and the creative chip is in there... He got sound working on a windows virtual machine... i guess that's a start, but i want to get rid of windows not slow it down.. ;)
Comment 4 Takashi Iwai 2016-01-20 11:30:45 UTC
Please take alsa-info.sh snapshot and attach to Bugzilla.  Run the script with --no-upload option.

The current CA0132 driver is very specific to some models, and doesn't work generically well.  You can try to pass pass model=generic to snd-hda-intel driver.  Then the generic driver will be used instead.  But this requires that BIOS sets up the pin configuration properly matching with the actual I/O.
Comment 5 David Giard 2016-01-20 12:58:44 UTC
Created attachment 200551 [details]
alsa-info with model=generic to snd-hda-intel and --no-upload command line option
Comment 6 David Giard 2016-01-20 13:08:47 UTC
still no sound, and no device, i mean, in the sound settings i only see the nvidia hdmi audio(this one works...)... and this time i even got these in dmesg...

[    8.932153] snd_hda_intel 0000:00:1f.3: failed to add i915 component master (-19)
[    8.945762] hdaudio hdaudioC0D0: Unable to bind the codec

i've seen that first error before but that's the first time i see the other... Could the creative device be at 00:1f.1 ?? It seems to be missing from lspci...
Comment 7 Takashi Iwai 2016-01-20 13:43:22 UTC
The message about i915 component is harmless message.  Your system seems having no i915 graphics, so it failed to bind, but continue probing.

The question is why it still couldn't bind with the codec although the codec itself was detected.  Try to modprobe snd-hda-codec-generic manually, and reload snd-hda-intel module again.

Also, try my sound.git tree for-linus branch, or the latest Linus git tree.
  git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
Comment 8 Takashi Iwai 2016-01-20 14:07:49 UTC
The i915 component error message should be downgraded as info level, at least.  The patch below should do that.  (But it won't fix anything else.)
Comment 9 Takashi Iwai 2016-01-20 14:08:35 UTC
Created attachment 200561 [details]
Patch to degrade the error message level about i915 component
Comment 10 Takashi Iwai 2016-01-20 14:58:21 UTC
OK, I found the culprit why codec binding failed.  Try another patch below in addition.
Comment 11 Takashi Iwai 2016-01-20 14:58:50 UTC
Created attachment 200591 [details]
Patch to fix model=generic
Comment 12 David Giard 2016-01-20 17:08:49 UTC
still no sound.. still dont see a creative device... and all i see is Internal Audio(1 output/2 input), but that could be the intel hdmi audio...

[    9.571935] snd_hda_intel 0000:00:1f.3: failed to add i915 component master (-19)
[    9.588397] snd_hda_codec_generic hdaudioC0D0: autoconfig for Generic: line_outs=1 (0xd/0x0/0x0/0x0/0x0) type:line
[    9.588399] snd_hda_codec_generic hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    9.588400] snd_hda_codec_generic hdaudioC0D0:    hp_outs=2 (0x10/0xf/0x0/0x0/0x0)
[    9.588400] snd_hda_codec_generic hdaudioC0D0:    mono: mono_out=0x0
[    9.588401] snd_hda_codec_generic hdaudioC0D0:    dig-out=0xc/0x0
[    9.588402] snd_hda_codec_generic hdaudioC0D0:    inputs:
[    9.588403] snd_hda_codec_generic hdaudioC0D0:      Mic=0x12
Comment 13 David Giard 2016-01-20 17:09:33 UTC
Created attachment 200601 [details]
Alsa-info with sound.git kernel, model=generic and 2 patches
Comment 14 Takashi Iwai 2016-01-20 17:13:23 UTC
(In reply to David Giard from comment #12)
> still no sound.. still dont see a creative device... and all i see is
> Internal Audio(1 output/2 input), but that could be the intel hdmi audio...

No, this is the one from Creative.  How can the HDMI audio have two *inputs*? :)
 
> [    9.571935] snd_hda_intel 0000:00:1f.3: failed to add i915 component
> master (-19)
> [    9.588397] snd_hda_codec_generic hdaudioC0D0: autoconfig for Generic:
> line_outs=1 (0xd/0x0/0x0/0x0/0x0) type:line
> [    9.588399] snd_hda_codec_generic hdaudioC0D0:    speaker_outs=0
> (0x0/0x0/0x0/0x0/0x0)
> [    9.588400] snd_hda_codec_generic hdaudioC0D0:    hp_outs=2
> (0x10/0xf/0x0/0x0/0x0)
> [    9.588400] snd_hda_codec_generic hdaudioC0D0:    mono: mono_out=0x0
> [    9.588401] snd_hda_codec_generic hdaudioC0D0:    dig-out=0xc/0x0
> [    9.588402] snd_hda_codec_generic hdaudioC0D0:    inputs:
> [    9.588403] snd_hda_codec_generic hdaudioC0D0:      Mic=0x12

The BIOS doesn't seem to set up the pin configuration.  So, unless you manually set up the pin configuration by yourself, it won't work.

The first thing you need is to identify which pin corresponds to which I/O.  For the I/O jacks, you can try hdajackretask or such and measure the jack detection by plugging / unplugging at each jack.  It's all trial-and-error effort.
Comment 15 David Giard 2016-01-20 18:13:25 UTC
when i try anything in hdajackretask the codec doesn't bind anymore... also, when i connect and disconnect a jack, am i supposed to see a change in the gui? Because i can't see any... or do i have to reboot everytime?

[ 4361.718546] hdaudio hdaudioC0D0: hda-codec: reconfiguring
[ 4361.718783] snd_hda_codec_generic hdaudioC0D0: autoconfig for Generic: line_outs=1 (0x10/0x0/0x0/0x0/0x0) type:line
[ 4361.718788] snd_hda_codec_generic hdaudioC0D0:    speaker_outs=1 (0xb/0x0/0x0/0x0/0x0)
[ 4361.718792] snd_hda_codec_generic hdaudioC0D0:    hp_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 4361.718795] snd_hda_codec_generic hdaudioC0D0:    mono: mono_out=0x0
[ 4361.718797] snd_hda_codec_generic hdaudioC0D0:    inputs:
[ 4361.720082] snd_hda_intel 0000:00:1f.3: control 3:0:0:Playback Channel Map:0 is already present
[ 4361.720133] snd_hda_codec_generic: probe of hdaudioC0D0 failed with error -16
[ 4361.721619] snd_hda_codec_generic hdaudioC0D0: autoconfig for Generic: line_outs=1 (0x10/0x0/0x0/0x0/0x0) type:line
[ 4361.721623] snd_hda_codec_generic hdaudioC0D0:    speaker_outs=1 (0xb/0x0/0x0/0x0/0x0)
[ 4361.721626] snd_hda_codec_generic hdaudioC0D0:    hp_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 4361.721628] snd_hda_codec_generic hdaudioC0D0:    mono: mono_out=0x0
[ 4361.721629] snd_hda_codec_generic hdaudioC0D0:    inputs:
[ 4361.722907] snd_hda_intel 0000:00:1f.3: control 3:0:0:Playback Channel Map:0 is already present
[ 4361.722948] snd_hda_codec_generic: probe of hdaudioC0D0 failed with error -16
[ 4361.722951] hdaudio hdaudioC0D0: Unable to bind the codec
Comment 16 David Giard 2016-01-20 18:27:57 UTC
sometimes i get device and resources busy when i press apply, and i get this in dmesg:

[  437.946496] snd_hda_codec_generic hdaudioC0D0: hda-codec: reconfiguring
[  438.026450] snd_hda_codec_generic hdaudioC0D0: autoconfig for Generic: line_outs=1 (0xd/0x0/0x0/0x0/0x0) type:line
[  438.026458] snd_hda_codec_generic hdaudioC0D0:    speaker_outs=1 (0xb/0x0/0x0/0x0/0x0)
[  438.026463] snd_hda_codec_generic hdaudioC0D0:    hp_outs=2 (0x10/0xf/0x0/0x0/0x0)
[  438.026467] snd_hda_codec_generic hdaudioC0D0:    mono: mono_out=0x0
[  438.026471] snd_hda_codec_generic hdaudioC0D0:    dig-out=0xc/0x0
[  438.026474] snd_hda_codec_generic hdaudioC0D0:    inputs:
[  438.026478] snd_hda_codec_generic hdaudioC0D0:      Mic=0x12
[  438.029773] input: HDA Intel PCH Mic as /devices/pci0000:00/0000:00:1f.3/sound/card0/input22
[  438.032883] input: HDA Intel PCH Line Out as /devices/pci0000:00/0000:00:1f.3/sound/card0/input23
[  438.033319] input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1f.3/sound/card0/input24
[  438.033578] input: HDA Intel PCH Front Headphone as /devices/pci0000:00/0000:00:1f.3/sound/card0/input25
[  438.034785] snd_hda_intel 0000:00:1f.3: control 2:0:0:IEC958 Default PCM Playback Switch:0 is already present
Comment 17 David Giard 2016-01-20 18:29:05 UTC
sorry the exact error message is: 

tee: /sys/class/sound/hwC0D0/reconfig: Device or resource busy
Comment 18 David Giard 2016-01-20 20:14:01 UTC
after 5 reboot without any luck i activated advanced settings and put the same override on all ports... i actually got sound but only on the motherboard's rear headphone port and the right channel was 5 times as strong as the left... i tried another 2 or 3 times after that but could not get any sound...

i am getting strong reboot anxiety so i'm gonna stop for now...
Comment 19 Takashi Iwai 2016-01-21 11:33:13 UTC
The most important thing for now is to identify which pin corresponds to which I/O jack.  Whether it actually works is the next thing, and you don't need to reboot for identifying jacks at all.

If a jack is a detectable one (e.g. the normal mini jack), it can be identified by the jack detection mechanism.  Plug/unplug a jack, and check the result of GET_SENSE pin verb for each pin.  For example, with hda-verb program included in alsa-tools,
   hda-verb /dev/snd/hwC0D0 0x0b GET_PIN_SENSE 0

will show the pin sense of the pin NID 0x0b.  Your codec has pins from 0x0b to 0x13.  (0x18 is also a pin but it has no jack detection capability.)

Of course, this won't give any chance for identifying the built-in I/O like built-in speaker or built-in mic.  A guess work is needed for these instead.
Comment 20 David Giard 2016-01-21 12:16:10 UTC
ok, lets see this is the back panel connector of the motherboard:

(j)  (m)

(k)  (n)

[l]  (o)


i'll give you the port name from the manual along with the port NID

j - 0x12 - Line In/Mic In
k - 0x0d - Line Out (2 speaker or front in 5.1 configuration)
l - i tried hookin up a small optical to rca converter and there was no sensing here...
m - 0x10 - Center/Subwoofer Speaker Out
n - 0x11 - Rear Speaker Out
o - 0x0f - Headphone/Speaker Out This one support audio amplifying the manual suggest using this for headphone.

Front Mic port: 0x12
Front Headphone: No sensing
Comment 21 Takashi Iwai 2016-01-21 12:50:05 UTC
Thanks, now it's a good start.

Though, it's still strange that the front headphone has no jack sense.  Is the front panel connected properly?  In the past, often a machine was set up wrongly in the old connection mode for AC97.

RCA connector has no jack sense, but it's a digital output, so the search range is narrow.
Comment 22 Takashi Iwai 2016-01-21 13:40:07 UTC
Below are two patches for adding the generic parser support to CA0132 codec driver.  Try to apply these and drop model=generic option.

If this doesn't give any sound (from neither line out nor hp/speaker out), try to modify the line defining ca0132_gen_fixup_tbl[]
	SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZXRI),
to
	SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZ),
Comment 23 Takashi Iwai 2016-01-21 13:40:39 UTC
Created attachment 200641 [details]
Patch #1: SB Z support
Comment 24 Takashi Iwai 2016-01-21 13:41:04 UTC
Created attachment 200651 [details]
Patch #2: SB ZxRi support
Comment 25 David Giard 2016-01-21 14:01:10 UTC
i haven't tried these patches yet, i will right after this...

i was sure i unhooked the headphone/speaker port on the back before testing the front ports but now i'm detecting 0x0f on the Front Headphone port... So two jack with the same port?

Also, i'm detecting something on 0x0b now... could be the optical cable... i tried unhooking it but there is no change..
Comment 26 Takashi Iwai 2016-01-21 14:08:58 UTC
It's possible that the front HP has no special pin but always shares.  Creative's board has always strange problem regarding the front jack.
Comment 27 David Giard 2016-01-21 16:54:18 UTC
no codec found on both... did a uname -a just to be sure.. i'm running the right kernel... the first time i didn't do make menuconfig, does that change anything?
Comment 28 Takashi Iwai 2016-01-21 16:56:27 UTC
Please give the kernel message and alsa-info.sh output.  Otherwise difficult to diagnose.
Comment 29 David Giard 2016-01-21 16:58:28 UTC
Created attachment 200751 [details]
alsa-info with 	SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZXRI),
Comment 30 David Giard 2016-01-21 16:59:57 UTC
Created attachment 200761 [details]
alsa-info with SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZ),
Comment 31 Takashi Iwai 2016-01-21 17:00:26 UTC
Hm, if you load with model=generic, it still probes the codec properly?
Comment 32 David Giard 2016-01-21 17:07:47 UTC
Created attachment 200781 [details]
Alsa-info second kernel with model=generic
Comment 33 Takashi Iwai 2016-01-21 17:14:01 UTC
So even model=generic doesn't work.  It implies something wrong in the hardware state.  Maybe a clean shutdown is needed?
Comment 34 David Giard 2016-01-21 18:10:01 UTC
Created attachment 200801 [details]
alsa-info with model=generic and clean shutdown, kernel with	SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZXRI),
Comment 35 David Giard 2016-01-21 18:12:06 UTC
Created attachment 200811 [details]
alsa-info with model=generic and clean shutdown, kernel with SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", CA0132_GEN_FIXUP_SBZ),
Comment 36 David Giard 2016-01-21 18:22:03 UTC
something is indeed wrong the sound doesn't work on windows now...
Comment 37 David Giard 2016-01-21 18:56:01 UTC
Created attachment 200821 [details]
alsa-info with model=generic, with flash of bios from backup and kernel with CA0132_GEN_FIXUP_SBZXRI

After flashing a bios backup back now i see the device but no sound
Comment 38 David Giard 2016-01-21 19:08:22 UTC
Created attachment 200841 [details]
alsa-info without model=generic, and kernel with CA0132_GEN_FIXUP_SBZXRI

This time it sees the card as well but no sound
Comment 39 David Giard 2016-01-21 19:19:43 UTC
Created attachment 200861 [details]
alsa-info without model=generic, and kernel with CA0132_GEN_FIXUP_SBZ

Still no sound, can't see 5.1 or 4.0
Comment 40 David Giard 2016-01-21 19:26:46 UTC
just to be sure, back on windows, sound still works, FYI the sound was working on windows after i flashed the bios...

i dont know what happened but i sure hope it doesn't happen to much... That was Scary... :)
Comment 41 Raymond 2016-01-22 02:13:17 UTC
Do your pin fixup correct since green jacks was not plugged? 


control.10 { iface CARD name 'Line Out Front Jack' value false comment { access read type BOOLEAN count 1 } } 

control.11 { iface CARD name 'Line Out Surround Jack' value true comment { access read type BOOLEAN count 1 } } 

control.12 { iface CARD name 'Line Out CLFE Jack' value true comment { access read type BOOLEAN count 1 }
Comment 42 David Giard 2016-01-22 16:03:01 UTC
i just remembered, on the windows software for this card, there is a switch to choose from the headphone or the speakers... so, how do i enable only a single pin?
Comment 43 Takashi Iwai 2016-01-22 16:06:12 UTC
Just keep the value for the pin to test and fill the rest pins with 0x411111f0, which means to disable it.  Then rebuild and retest.
Comment 44 David Giard 2016-01-22 16:50:22 UTC
ok with just 0x0f enabled i only hear a small clicks or chipping...
Comment 45 Takashi Iwai 2016-01-22 17:01:02 UTC
... from where?  NID 0x0f might be tricky, as this can be connected to both line out and HP.  You can try LO2 (0x0d) instead, too.
Comment 46 David Giard 2016-01-22 17:17:19 UTC
0x0f i hear small clicks on both the back HP/Speaker port and the front HP port
Comment 47 David Giard 2016-01-22 17:31:47 UTC
0x0d is registering as an hdmi output, i did activate the intel video in the bios earlier, still can't get video though
Comment 48 David Giard 2016-01-22 20:06:54 UTC
ok when using 0x0d with 0x010110f0 and the others disabled, i get 
scratchy sound on the Line Out port on the back of the motherboard.
Comment 49 David Giard 2016-01-22 23:01:30 UTC
when using only 0x0c 0x014b1010, i get optical audio out working fine. 
if i add 0x0d 0x010140f0, then optical audio still works but its in the 
Analog Stereo Duplex profile in the Sound Preferences.. Line out port 
does not work in this case. Still can't get the headphone ports to work...
Comment 50 David Giard 2016-01-22 23:27:08 UTC
when using these:

0x0d 0x010140f0
0x10 0x010110f1
0x11 0x010110f2

disabling the others, i get small scrambled atari/c64 sounds on 
front/center/lfe/rear
Comment 51 David Giard 2016-01-23 05:05:26 UTC
i was getting sounds but not always on ubuntu 16.04 so i erased windows for good and installed 15.10 back using the same kernel i was using on 16.04. turns out i have the same problem... but no more garbled atari/c64 sounds... :) if i can catch the sound when its actually working, i can start my mp3 and enjoy my music all i want... sweet sweet hi-fi, i missed you so much!

this is the numbers i'm using right now, also i'm gonna make another alsa-info maybe that could help as well...

0x0b 0x41454110
0x0c 0x01451010
0x0d 0x010140f0
0x0e 0x41c520f0
0x0f 0x0221401f
0x10 0x01011011
0x11 0x01011012
0x12 0x02a000f0
0x13 0x908700f0
0x18 0x500000f0


i'm gonna continue playing with it until everything works... but not right now.. got music.. :) and its late..
Comment 52 David Giard 2016-01-23 05:06:55 UTC
Created attachment 201041 [details]
Alsa-Info on Ubuntu-Mate 15.10
Comment 53 David Giard 2016-01-23 12:08:06 UTC
sensing on 0x0f disable audio on 0x0d, can't get sound on 0x10 and 0x11
Comment 54 David Giard 2016-01-23 12:10:23 UTC
i remember reading you couldn't have hi-fi and 5.1 at the same time on line-out 0x0d, not sure about HP 0x0f...
Comment 55 David Giard 2016-01-23 15:50:17 UTC
0x0c 0x014510f0
0x0d 0x010140f0
0x0f 0x01114010
0x10 0x01011011
0x11 0x01011012

with these sometimes i get sound on optical, sometimes on lineout(hi-fi), but i can never get 5.1 going properly, i only ear 0x11 rear channel. 0x0f headphone/speaker port never worked...

its all pretty glitchy, but part of it could be alsa or pulseaudio i guess...
Comment 56 David Giard 2016-01-23 18:23:41 UTC
what i meant is that all i do is change "Settings for the selected device" in Sound Preferences, i sometimes i get different result for the same Profile.
Comment 57 David Giard 2016-01-23 21:16:08 UTC
ok i need to switch back and forth 2 to 4 times between profiles for the change to happen in the audio... i can leave music running and switch between profile. i said 5.1 before but that was 4.1, i can only see analog surround 4.1 and 4.0. but its distorted most of the time and when it plays correctly only the rear plays(the volume seems to low as well)...

when i stop playing music, wait a bit and start it again, sometimes it wont make any sound. But, stopping the music, waiting 10 to 15 seconds and trying again usually solve the problem without too much retries... i wonder if both issues are related...
Comment 58 David Giard 2016-01-25 02:42:19 UTC
my brain need a tuning fork... when i said that the rear 0x11 worked in 5.1 or 4.1, sometimes distorted, sometimes not.. that was not the rear.. that was LFE 0x10...
Comment 59 David Giard 2016-01-25 02:56:56 UTC
Enabling only Lineout, i could use a silent mp3 on a loop and forget i ever had any problem at least until i reboot... its not that the sound would get better if everything works... i mean even in windows i had to choose between 5.1 and hi-fi... i got a dolby headphone with a processor so that's not an issue for me 2 channel is enough and the dolby pro logic does the rest.. i just feel i should finish what i started.. but i must say i'm flying blind right now...

Here i'm getting the LFE on the Lineout(0x0d) port???, with a few tries i still get lineout hifi but this is weird...:
0x0b 0x411111f0
0x0c 0x41451130
0x0d 0x01014010
0x0e 0x41c520f0
0x0f 0x01114020
0x10 0x01011011
0x11 0x01011013
0x12 0x02a000a0
0x13 0x411111f0
0x18 0x411111f0

Yeah, LFE on Lineout(0x0d) port... Sound like squeeky audio software filter to me:

0x0b 0x411111f0
0x0c 0x41451130
0x0d 0x01014010
0x0e 0x41c520f0
0x0f 0x01114010
0x10 0x01011010
0x11 0x01011010
0x12 0x02a000a0
0x13 0x411111f0
0x18 0x411111f0
Comment 60 David Giard 2016-01-25 19:11:14 UTC
got the headphone port working a tiny bit, barely audible... work on the front port(case) and back port(motherboard) seems to be on 0x0f and 0x10

my guess is that the windows software might be reconfiguring the port on the card...

0x0b 0x414511f0
0x0c 0x414510f0
0x0d 0x41014010
0x0e 0x41c520f0
0x0f 0x02214010
0x10 0x01216012
0x11 0x41011014
0x12 0x42a090f0
0x13 0x508700f0
0x18 0x500000f0
Comment 61 David Giard 2016-01-25 19:12:27 UTC
Created attachment 201441 [details]
Alsa-Info with both headphone barely port working
Comment 62 Raymond 2016-02-01 02:37:20 UTC
You need to modify driver since it is hardcode dacs 0x02, 0x03 and 0x04 but your green line out connected to 0x06
Comment 63 David Giard 2016-02-26 05:06:13 UTC
i've been trying another round of tests, this time with all connector hooked up from cold boot.

i am currently running sound.git from feb 14, with the last two patches that where provided here. i found out that as is, without any boot override, i get very low sound on the rear speaker/headphone port (0x0f). However, it seems that if i want to change back for lets say this override:

0x0b 0x41014111
0x0c 0x414520f0
0x0d 0x01014010
0x0e 0x41c501f0
0x0f 0x42214010
0x10 0x41214010
0x11 0x41012014
0x12 0x37a790f0
0x13 0x77a701f0
0x18 0x500000f0

i need a complete power off. Simply rebooting will not change anything and the sound will still be very low and will still come from the rear speaker/headphone port. i can't say for sure if this is intermittent or not. 

in any case this override works fine, it gives me the lineout, which is one of the hifi ports. On ubuntu, i changed 2 lines in /etc/pulse/daemon.conf

default-sample-format = s24le
default-sample-rate = 192000

it seemed to sound better afterward. i get that the driver needs to be modified and i'm sorry to say that i dont have the skills to do that.. :)
Comment 64 Scott Doty 2016-03-03 23:49:57 UTC
Hi, got sound working,

I applied the patches listed above with no dice, but then tried:

--- patch_ca0132.c~	2016-03-03 14:38:19.000000000 -0800
+++ patch_ca0132.c	2016-03-03 15:24:03.862769579 -0800
@@ -785,6 +785,7 @@
 	SND_PCI_QUIRK(0x1028, 0x0688, "Alienware 17 2015", QUIRK_ALIENWARE),
 	SND_PCI_QUIRK(0x1102, 0x0010, "Sound Blaster Z", QUIRK_GENERIC_PARSER),
 	SND_PCI_QUIRK(0x1458, 0xa046, "SB ZxRi", QUIRK_GENERIC_PARSER),
+	SND_PCI_QUIRK(0x1458, 0xa036, "SB ZxRi2", QUIRK_GENERIC_PARSER),

(note the board id "0xa036"), and now I get sound out of SPDIF, which is a lot better than I was doing before.  I assume this sets that board to "model=generic", which I hadn't tried yet.

The DSP goodies disappeared from alsamixer (of course) so I'd love to poke at this some more and try to get better functionality.

I still don't know where the development tree for alsa is, though, the alsa-project page seems to have some dead links, or I'm not reading it right.

Here is my motherboard:

http://www.gigabyte.com/products/product-page.aspx?pid=5481#ov

I will test the analog ports shortly.
Comment 65 Scott Doty 2016-03-04 07:30:32 UTC
Just got done trying out the analog ports, using mic and headphones.  Nothing I could do seemed to work with this driver.  So, only optical SPDIF is working.

However, on the CD that came with the motherboard, I found this directory:

Audio/CreativeZxRiW10/ZxRi/program files/Creative/Sound Blaster ZxRi/Program/Driver

Which contains a file ctHda.inf,

which includes the following list:

[PinConfig.AddReg]
HKR,PinConfig,Config_0B,  0x00010001,0x01014110         ;; Port G : LineOut Front L/R
HKR,PinConfig,ConfigEx_0B,0x00010001,0x00000002
HKR,PinConfig,Config_0C,  0x00010001,0x014510f0         ;; SpdifOut1
HKR,PinConfig,ConfigEx_0C,0x00010001,0x00000004
HKR,PinConfig,Config_0D,  0x00010001,0x014510f0         ;; DigitalOut
HKR,PinConfig,ConfigEx_0D,0x00010001,0x00000006
HKR,PinConfig,Config_0E,  0x00010001,0x41c520f0          ;;SpdifIn
HKR,PinConfig,ConfigEx_0E,0x00010001,0x00000005
HKR,PinConfig,Config_0F,  0x00010001,0x0221401f          ;;Port A  -- BackPanel HP
HKR,PinConfig,ConfigEx_0F,0x00010001,0x00000002
HKR,PinConfig,Config_10,  0x00010001,0x01016011          ;;Port D -- Center/LFE or FP Hp
HKR,PinConfig,ConfigEx_10,0x00010001,0x00000013
HKR,PinConfig,Config_11,  0x00010001,0x01011014          ;;Port B -- LineMicIn2 / Rear L/R
HKR,PinConfig,ConfigEx_11,0x00010001,0x00000101          ;;Not input
HKR,PinConfig,Config_12,  0x00010001,0x02a090f0          ;;Port C -- LineIn1
HKR,PinConfig,ConfigEx_12,0x00010001,0x00000051
HKR,PinConfig,Config_13,  0x00010001,0x908700f0          ;;WUHIn
HKR,PinConfig,ConfigEx_13,0x00010001,0x00000000

;;Device Specific
HKR,PinConfig\1028064C,ConfigEx_0B,0x00010001,0x00000003
HKR,PinConfig\1028064C,ConfigEx_10,0x00010001,0x00000001
HKR,PinConfig\1028064C,ConfigEx_11,0x00010001,0x00000002
HKR,PinConfig\1458A046,ConfigEx_0B,0x00010001,0x00000002
HKR,PinConfig\1458A046,ConfigEx_0F,0x00010001,0x00000005
HKR,PinConfig\1458A046,ConfigEx_10,0x00010001,0x00000003
HKR,PinConfig\1458A046,ConfigEx_11,0x00010001,0x00000004
HKR,PinConfig\1458A046,ConfigEx_12,0x00010001,0x00000001
HKR,PinConfig\1458A046,ConfigEx_0D,0x00010001,0x00000002

[CodecConfig.AddReg]
HKR,CodecConfig,FP_DetectPin, 0x00010001,0x00000000
HKR,CodecConfig,HeadphoneAlwaysDual, 0x00010001,0x00000001
HKR,CodecConfig,PortA10KOhmLoad, 0x00010001,0x00000001
HKR,CodecConfig,LineOutMaxVolume, 0x00010001,0x00000000                    ;;0 mB (0dB)
HKR,CodecConfig,SpdifOutBasicRatesOnly, 0x00010001,0x00000000

HKR,CodecConfig\1458A046,UseSPDIFDAC, 0x00010001, 0x00000001
HKR,CodecConfig\1458A046,UseAltDACMapping, 0x00010001, 0x00000000
HKR,CodecConfig\1458A046,AltDACMapping, 0x00010001,0xff010200

Is any of this information useful?  Can I just attach the .inf file to this bug?

Also came across two files there:

-r-------- 1 scott scott  17545 Jul  1  2015 CTHRFX32.hda
-r-------- 1 scott scott  19873 Jul  1  2015 CTHRFX64.hda

Which look suspiciously like firmware files...

Please advise? :)
Comment 66 Scott Doty 2016-03-05 02:53:49 UTC
Created attachment 207691 [details]
Example not to be applied

I got curious, so I tried jamming those values from the .inf file into the pin configuration.  I barely know what I am doing, so if you are laughing at me, I completely understand. ;)  I was hoping that the analog audio would work even a little bit after this, but it didn't.

The attached patch includes the struct with the values found in the .inf file (in case that is valuable for any of this), as well as basically a cargo-cult of the standard driver assignments, handled as a quirk.  I suspect to get analog working, some of the other pins mentioned in the .inf file will have to be monitored for headphone sense, selecting headphone impedance, and so forth.

My homework for this weekend is to read the patch_ files under sound/pci/hda and try to suss out what is necessary for success.  Pointers in the right direction (or making this work) would naturally be greatly appreciated. :)
Comment 67 Scott Doty 2016-03-08 08:35:29 UTC
Still trying to grok it all -- I'm definitely in over my head.

Are those values from the .inf file any help?
Comment 68 David Giard 2016-03-10 13:28:27 UTC
you should probably open a specific bug, follow https://bugzilla.kernel.org/show_bug.cgi?id=55541#c178

also the .inf from my Windows driver did not help for me. Only thing that did, is activating each output one by one and see if it worked. as you can see from the log one of them did and i've been using this output ever since without any issue.
Comment 69 Scott Doty 2016-03-14 21:00:49 UTC
Thanks, David.  I'll open the ticket, and include Takashi's patch that made the optical spdif work.

Folks who find this from out in the cold should look for the bug that
includes "1458:a036" in the title.
Comment 70 David Giard 2016-08-12 13:45:49 UTC
this might help, detailed pictures of all the chips

http://www.pctekindia.com/Reviews/Z170XGAMINGG1.aspx

i dont get it, if there is a cirrus logic 8416 in there, what is the ca0132-4an hf even there for?