NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/52912: hdafg: no sound from jack port on a laptop



The following reply was made to PR kern/52912; it has been noted by GNATS.

From: Jake Slazenger <jake.slazenger%yandex.com@localhost>
To: Fekete =?UTF-8?B?Wm9sdMOhbg==?= <fekete.zoltan%minux.hu@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, kern-bug-people%netbsd.org@localhost,
 gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/52912: hdafg: no sound from jack port on a laptop
Date: Fri, 16 Feb 2018 00:04:58 +0300

 On Mon,  8 Jan 2018 19:25:00 +0000 (UTC)
 Fekete Zolt=C3=A1n <fekete.zoltan%minux.hu@localhost> wrote:
 
 > The following reply was made to PR kern/52912; it has been noted by
 > GNATS.
 >=20
 > From: =3D?UTF-8?Q?Fekete_Zolt=3DC3=3DA1n?=3D <fekete.zoltan%minux.hu@localhost>
 > To: gnats-bugs%netbsd.org@localhost
 > Cc:=20
 > Subject: Re: kern/52912: hdafg: no sound from jack port on a laptop
 > Date: Mon, 08 Jan 2018 20:22:05 +0100
 >=20
 >  2018-01-08 07:50 id=C5=91pontban jake.slazenger%yandex.com@localhost ezt =C3=ADrta:
 >  >> Number:         52912
 >  >> Category:       kern
 >  >> Synopsis:       hdafg: no sound from jack port on a laptop
 >  >> Confidential:   no
 >  >> Severity:       non-critical
 >  >> Priority:       medium
 >  >> Responsible:    kern-bug-people
 >  >> State:          open
 >  >> Class:          sw-bug
 >  >> Submitter-Id:   net
 >  >> Arrival-Date:   Mon Jan 08 06:50:00 +0000 2018
 >  >> Originator:     Jake Slazenger
 >  >> Release:        CURRENT-8.0-171230
 >  >> Organization:
 >  >> Environment: =20
 >  > NetBSD localhost 8.0_BETA NetBSD 8.0_BETA (RUSTY) #0: Sun Jan  7
 >  > 16:30:08 MSK 2018
 >  > rusty@localhost:/usr/src/171230/src/sys/arch/amd64/compile/RUSTY
 >  > amd64 =20
 >  >> Description: =20
 >  > When I connect headphones to jack port on my laptop with Realtek
 >  > ALC268 sound chip, sound is not switching to the headphones and
 >  > continues to come out from built-in speakers.
 >  >=20
 >  > For example, on Linux-based systems sound is automatically switches
 >  > when headphones is connected.
 >  >=20
 >  > Is it a bug, or I do something wrong and it can be switched
 >  > manually? =20
 >  >> How-To-Repeat: =20
 >  > Connect headphones to jack port on a laptop with Realtek ALC268
 >  > sound chip. =20
 >  >> Fix: =20
 > =20
 > =20
 >  Hi Jake,
 > =20
 >  I had a similar problem, and finally I could figure out how to set
 > jack up. Probably your codec is not set up correctly, and it is not a
 > bug. There are several different codecs/setups, and kernel developers
 > do not have the capacity to program each one.
 > =20
 >  So, you have to solve it yourself. It's not really obvious however.
 > =20
 >  1. You have to read carefully the snd_hda man page. There you will=20
 >  understand how the hda driver groups the different in/out parts
 > =20
 >  2. Try to find a technical manual for your sound chip. Similar to
 > mine here (Analog Devices 1984A):
 >  http://www.analog.com/media/en/technical-documentation/obsolete-data-she=
 ets/AD1984.pdf
 > =20
 >  3. Use hdaudioctl get command to gain your current settings. You
 > have to read and decode hexadecimal numbers...
 > =20
 >  4. Then modify the xml file you got in point 3, and use hdaudioctl
 > set command with the modified file apply changes. Then try jack.
 > Repeat 3-4 until success.
 > =20
 >  Another aproach: if you can program, you could modify the kernel,
 > and recompile. Here is my patch, but this is device-dependent:
 >  https://minux.hu/netbsd-hdaudio-jack-detection
 > =20
 >  Good luck!
 > =20
 >  I'm working on a script that translates that output file into human=20
 >  readable form. Just time is always an issue.
 > =20
 >  Rgds,
 > =20
 >  FeZ
 > =20
 
 Thank you very much, FeZ, for the such detailed answer!
 
 But, anyway, I didn't understand how association and sequence numbers
 works (yes, I'm a little bit stupid).
 
 So I looked to FreeBSD sources to find required assoc and seq numbers:
 https://github.com/freebsd/freebsd/blob/d8596f6f687a64b994b065f3058155405df=
 c39db/sys/dev/sound/pci/hda/hdaa_patches.c
 
 And used it with Fekete's patches... And it worked!
 
 So problem is partially solved, I think.
 
 And again, thank you very much for the help, FeZ!
 
 Oh, and yes. I'm sorry for my very bad English.
 
 
 
 Patch for 7.1.1 kernel:
 --- src/sys/dev/pci/hdaudio/hdafg.c.orig	2018-02-15 15:23:24.000000000 +0300
 +++ src/sys/dev/pci/hdaudio/hdafg.c	2018-02-15 23:37:49.000000000 +0300
 @@ -657,6 +657,21 @@
  	}
  #endif
 =20
 +        /* XXX ALC268 */
 +        if (sc->sc_vendor =3D=3D HDA_VENDOR_REALTEK && sc->sc_product =3D=
 =3D 0x0268) {
 +	    if (COP_CFG_PORT_CONNECTIVITY(w->w_pin.config) =3D=3D COP_PORT_JACK) {
 +	        /* nid 20 */=20
 +	        if (w->w_nid =3D=3D 0x14) {
 +		  /* set assoc=3D1 */
 +		  w->w_pin.config &=3D ~0xf0;
 +		  w->w_pin.config |=3D 0x10;
 +		  /* set seq=3D15 */	=09
 +		  w->w_pin.config &=3D ~0x0f;
 +		  w->w_pin.config |=3D 0x0f;
 +		}
 +	    }
 +	}
 +  =20
  	conn =3D COP_CFG_PORT_CONNECTIVITY(w->w_pin.config);
  	color =3D COP_CFG_COLOR(w->w_pin.config);
  	defdev =3D COP_CFG_DEFAULT_DEVICE(w->w_pin.config);
 


Home | Main Index | Thread Index | Old Index