From nobody Fri Mar 11 15:24:18 2022 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 158E91A09945 for ; Fri, 11 Mar 2022 15:24:37 +0000 (UTC) (envelope-from olivares14031@gmail.com) Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KFV8z2jdYz3s5M for ; Fri, 11 Mar 2022 15:24:35 +0000 (UTC) (envelope-from olivares14031@gmail.com) Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-2dc242a79beso96680597b3.8 for ; Fri, 11 Mar 2022 07:24:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=CJQvYTECCUo+PHfb/M+EzzIH4FwO2Fp9syDxky4Civg=; b=IdaRnz7V2oRFG2FM7BBcPTfKgxDK4p2I2IMMuLbXs+70g4TaGVQyX7ut19q1L3b2eQ a/2ZYGpMcXABUdgQw64v7MEgmT7iqC4IAmYB8LFU2WKXTmA3T6yxQ08up0TcPVEaNdGm mXbSIWAst7IMKAQUM9HV9uGwd9QiGlL+lfhrG5seXyZgQyibFj941ddNy2ZpWkp0Pu39 aeFmnjK2ur62LWeg4pf+cjmg67paEpZP2okcE/Tv/YGiobhv23E4JS67Boczd47e8j75 +34JlzoTdbQnC3P7vg8jAd6EF4Ho7xgMdzI4CN3T1/iKKQXNEep2yKr8CvN3fBMYmVGN iTxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=CJQvYTECCUo+PHfb/M+EzzIH4FwO2Fp9syDxky4Civg=; b=fuZi5CYZLI6tMB09WFgwZY433YwIZ2tpmij4dWVgvcPGKZD7vCb9/ZH5PncQt+uF6t ikyT19guQcWWuM+HyJYhDSBMb3rPlj11WF3wD+WsGoG5dRYXdx4C6GW9I7BRrCOpPspy AVniy7Ty1xFMF0je0ey9iaBp5wVISclFgobvX8mHyUSsElGFsjyT8yGpw97gMlAKfsDU lSXLaUvHWRVFdiobPjWxk59l80za5K0onFjGtxTWUlEcJjTlhu7C2U5K+nGVnFrDZROA KMt/kFrotTEq2XEVlYTBoWTTkXkPPabIImoOGfNPW34Eq35UXrHihB07sp9gntqBlr20 p1mQ== X-Gm-Message-State: AOAM531PdcAozSsSr71PhF+Xqi/lyuv5mybE+xXa8IN9knE+3t4rd873 ryIhKTVI2InJ/EXdqu6wfx5ZLhvvnpxaqKYyyxoKDf8isF6o4A== X-Google-Smtp-Source: ABdhPJyG6KHcfhliDSyy8AgEfduj6e98upe8gm6wJwgFzPw8POz9wIzGcvHcrWGT8+20w4PHwJ3TEfK29KT2PVJuzIc= X-Received: by 2002:a0d:ca12:0:b0:2dc:2dbf:8cac with SMTP id m18-20020a0dca12000000b002dc2dbf8cacmr8663059ywd.417.1647012268906; Fri, 11 Mar 2022 07:24:28 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Antonio Olivares Date: Fri, 11 Mar 2022 09:24:18 -0600 Message-ID: Subject: Re: get sound from headphones To: FreeBSD Questions Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4KFV8z2jdYz3s5M X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=IdaRnz7V; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of olivares14031@gmail.com designates 2607:f8b0:4864:20::1135 as permitted sender) smtp.mailfrom=olivares14031@gmail.com X-Spamd-Result: default: False [-3.06 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.06)[-0.063]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::1135:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-ThisMailContainsUnwantedMimeParts: N On Wed, Mar 9, 2022 at 4:15 AM Antonio Olivares wrote: > > On Wed, Mar 9, 2022 at 4:14 AM Antonio Olivares wrote: > > > > Dear kind folks, > > > > I am trying to get sound from headphones, but have not succeeded. I > > have booted in verbose mode and I get the following: > > > > --------- > > olivares@ryzen$ cat boot.txt > > Preloaded elf obj module "snd_hda.ko" at 0xffffffff81db3a40. > > hdac0.pci6.pcib6.pci0.pcib0.acpi0.nexus0.root0 > > hdac0: [tentative] mem > > 0xfcf40000-0xfcf43fff irq 55 at device 0.1 on pci6 > > hdac0: PCI card vendor: 0x1545, device: 0xaa68 > > hdac0: HDA Driver Revision: 20120126_0002 > > hdac0: Config options: on=0x00000000 off=0x00000000 > > hdac0: link ctrl 0x2930 > > hdac0: disable nosnoop > > hdac0: Reserved 0x4000 bytes for rid 0x10 type 3 at 0xfcf40000 > > hdac0: attempting to allocate 1 MSI vector (1 supported) > > hdac0: using IRQ 16 on cpu3 for MSI > > hdac0: Caps: OSS 1, ISS 0, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256 > > hdac0: [attached!] mem > > 0xfcf40000-0xfcf43fff irq 16,55 at device 0.1 on pci6 > > hdac1.pci8.pcib8.pci0.pcib0.acpi0.nexus0.root0 > > hdac1: [tentative] mem > > 0xfca00000-0xfca07fff irq 36 at device 0.4 on pci8 > > hdac1: PCI card vendor: 0x1043, device: 0x8760 > > hdac1: HDA Driver Revision: 20120126_0002 > > hdac1: Config options: on=0x00000000 off=0x00000000 > > hdac1: link ctrl 0x2830 > > hdac1: disable nosnoop > > hdac1: Reserved 0x8000 bytes for rid 0x10 type 3 at 0xfca00000 > > hdac1: attempting to allocate 1 MSI vector (1 supported) > > hdac1: using IRQ 16 on cpu5 for MSI > > hdac1: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256 > > hdac1: [attached!] mem > > 0xfca00000-0xfca07fff irq 16,36 at device 0.4 on pci8 > > hdacc0.hdac0.pci6.pcib6.pci0.pcib0.acpi0.nexus0.root0 > > hdacc0: [tentative] at cad 0 on hdac0 > > hdaa0.hdacc0.hdac0.pci6.pcib6.pci0.pcib0.acpi0.nexus0.root0 > > hdaa0: [tentative] at nid 1 on hdacc0 > > hdaa0: Subsystem ID: 0x00aa0100 > > hdaa0: NumGPIO=0 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=0 > > hdaa0: Original pins configuration: > > hdaa0: nid 0x as seq device conn jack loc color misc > > hdaa0: 3 18560010 1 0 Digital-out Jack Digital 0x18 Unknown 0 > > hdaa0: Patched pins configuration: > > hdaa0: nid 0x as seq device conn jack loc color misc > > hdaa0: 3 18560010 1 0 Digital-out Jack Digital 0x18 Unknown 0 > > hdaa0: 1 associations found: > > hdaa0: Association 0 (1) out: > > hdaa0: Pin nid=3 seq=0 > > hdaa0: Tracing association 0 (1) > > hdaa0: Pin 3 traced to DAC 2 > > hdaa0: Association 0 (1) trace succeeded > > hdaa0: Looking for additional DAC for association 0 (1) > > hdaa0: Tracing input monitor > > hdaa0: Tracing other input monitors > > hdaa0: Tracing beeper > > hdaa0: Pin sense: nid=3 sense=0x7fffffff (disconnected, ELD valid) > > hdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref > > pcm0.hdaa0.hdacc0.hdac0.pci6.pcib6.pci0.pcib0.acpi0.nexus0.root0 > > pcm0: [tentative] at nid 3 on hdaa0 > > pcm0: [attached!] at nid 3 on hdaa0 > > hdaa0: [attached!] at nid 1 on hdacc0 > > hdacc0: [attached!] at cad 0 on hdac0 > > hdacc1.hdac1.pci8.pcib8.pci0.pcib0.acpi0.nexus0.root0 > > hdacc1: [tentative] at cad 0 on hdac1 > > hdaa1.hdacc1.hdac1.pci8.pcib8.pci0.pcib0.acpi0.nexus0.root0 > > hdaa1: [tentative] at nid 1 on hdacc1 > > hdaa1: Subsystem ID: 0x10438760 > > hdaa1: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1 > > hdaa1: GPIO0: disabled > > hdaa1: GPIO1: disabled > > hdaa1: Original pins configuration: > > hdaa1: nid 0x as seq device conn jack loc color misc > > hdaa1: 17 90460130 3 0 SPDIF-out Fixed Digital Internal Unknown 1 > > hdaa1: 18 40330000 0 0 CD None ATAPI 0x00 Unknown 0 > > hdaa1: 20 01014010 1 0 Line-out Jack 1/8 Rear Green 0 > > hdaa1: 21 411111f0 15 0 Speaker None 1/8 Rear Black 1 > > hdaa1: 22 411111f0 15 0 Speaker None 1/8 Rear Black 1 > > hdaa1: 23 411111f0 15 0 Speaker None 1/8 Rear Black 1 > > hdaa1: 24 01a19040 4 0 Mic Jack 1/8 Rear Pink 0 > > hdaa1: 25 02a19050 5 0 Mic Jack 1/8 Front Pink 0 > > hdaa1: 26 0181304f 4 15 Line-in Jack 1/8 Rear Blue 0 > > hdaa1: 27 02214020 2 0 Headphones Jack 1/8 Front Green 0 > > hdaa1: 28 411111f0 15 0 Speaker None 1/8 Rear Black 1 > > hdaa1: 29 4046c629 2 9 SPDIF-out None Digital 0x00 Res.C 6 > > hdaa1: 30 411111f0 15 0 Speaker None 1/8 Rear Black 1 > > hdaa1: 31 411111f0 15 0 Speaker None 1/8 Rear Black 1 > > hdaa1: Patching widget caps nid=29 0x00400400 -> 0x00700400 > > hdaa1: Patched pins configuration: > > hdaa1: nid 0x as seq device conn jack loc color misc > > hdaa1: 17 90460130 3 0 SPDIF-out Fixed Digital Internal Unknown 1 > > hdaa1: 18 40330000 0 0 CD None ATAPI 0x00 Unknown 0 DISA > > hdaa1: 20 01014010 1 0 Line-out Jack 1/8 Rear Green 0 > > hdaa1: 21 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA > > hdaa1: 22 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA > > hdaa1: 23 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA > > hdaa1: 24 01a19040 4 0 Mic Jack 1/8 Rear Pink 0 > > hdaa1: 25 02a19050 5 0 Mic Jack 1/8 Front Pink 0 > > hdaa1: 26 0181304f 4 15 Line-in Jack 1/8 Rear Blue 0 > > hdaa1: 27 02214020 2 0 Headphones Jack 1/8 Front Green 0 > > hdaa1: 28 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA > > hdaa1: 30 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA > > hdaa1: 31 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA > > hdaa1: 5 associations found: > > hdaa1: Association 0 (1) out: > > hdaa1: Pin nid=20 seq=0 > > hdaa1: Association 1 (2) out: > > hdaa1: Pin nid=27 seq=0 > > hdaa1: Association 2 (3) out: > > hdaa1: Pin nid=17 seq=0 > > hdaa1: Association 3 (4) in: > > hdaa1: Pin nid=24 seq=0 > > hdaa1: Pin nid=26 seq=15 > > hdaa1: Association 4 (5) in: > > hdaa1: Pin nid=25 seq=0 > > hdaa1: Tracing association 0 (1) > > hdaa1: Pin 20 traced to DAC 2 > > hdaa1: Association 0 (1) trace succeeded > > hdaa1: Tracing association 1 (2) > > hdaa1: Pin 27 traced to DAC 3 > > hdaa1: Association 1 (2) trace succeeded > > hdaa1: Tracing association 2 (3) > > hdaa1: Pin 17 traced to DAC 16 > > hdaa1: Association 2 (3) trace succeeded > > hdaa1: Tracing association 3 (4) > > hdaa1: Pin 24 traced to ADC 8 > > hdaa1: Pin 26 traced to ADC 8 > > hdaa1: Association 3 (4) trace succeeded > > hdaa1: Tracing association 4 (5) > > hdaa1: Pin 25 traced to ADC 9 > > hdaa1: Association 4 (5) trace succeeded > > hdaa1: Looking for additional DAC for association 0 (1) > > hdaa1: Looking for additional DAC for association 1 (2) > > hdaa1: Looking for additional DAC for association 2 (3) > > hdaa1: Looking for additional ADC for association 3 (4) > > hdaa1: Looking for additional ADC for association 4 (5) > > hdaa1: Tracing input monitor > > hdaa1: Tracing nid 11 to out > > hdaa1: nid 11 is input monitor > > hdaa1: Tracing nid 34 to out > > hdaa1: Tracing nid 35 to out > > hdaa1: Tracing other input monitors > > hdaa1: Tracing nid 24 to out > > hdaa1: Tracing nid 25 to out > > hdaa1: Tracing nid 26 to out > > hdaa1: Tracing beeper > > hdaa1: Pin sense: nid=20 sense=0x80000000 (connected) > > hdaa1: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref > > pcm1.hdaa1.hdacc1.hdac1.pci8.pcib8.pci0.pcib0.acpi0.nexus0.root0 > > pcm1: [tentative] at nid 20 and 24,26 on hdaa1 > > pcm1: [attached!] at nid 20 and 24,26 on hdaa1 > > pcm2.hdaa1.hdacc1.hdac1.pci8.pcib8.pci0.pcib0.acpi0.nexus0.root0 > > pcm2: [tentative] at nid 27 and 25 on hdaa1 > > pcm2: [attached!] at nid 27 and 25 on hdaa1 > > pcm3.hdaa1.hdacc1.hdac1.pci8.pcib8.pci0.pcib0.acpi0.nexus0.root0 > > pcm3: [tentative] at nid 17 on hdaa1 > > pcm3: [attached!] at nid 17 on hdaa1 > > hdaa1: [attached!] at nid 1 on hdacc1 > > hdacc1: [attached!] at cad 0 on hdac1 > > ------ > > > > I am trying to copy from the following website as example: > > https://srinicame.blogspot.com/2018/11/auto-switching-of-audio-output-to.html > > But do not know what to put in /boot/device.hints > > Thanks for your help. > > Best Regards, > > > Antonio Dear fellow users, Back in 2010, I used a script I found online and it setup specifically what was needed to put into /boot/device.hints. This is a new machine and script does not work as it used to. Script is ####### olivares@rosewill:~/Downloads/kerTeX/Documents $ cat snd_head.pm #!/usr/local/bin/perl #------------------------------------------------------------------ # If you find bug in this, fix it or leave it. # Script to get your headphones jack to work on freebsd # applies only for those having an snd_hda # c0ded by sch A|T csis.dk / selven pirabarlen cheenaramen # just in case someone else is having this issue. # and yes the obvious: am not responsible if this script fucks up # bsd licensed #------------------------------------------------------------------ use strict; use warnings; #---- Main Body ------------ fixHeadphone(); #---- Function List -------- sub fixHeadphone { my( $nid_head, $nid_mic, $lines_to_add); my %nidList=getNid(); $lines_to_add=""; $nid_head=$nidList{'line_out'}; #hahaha yeah 'nid head'! hahaha $nid_mic=$nidList{'mic'}; if(trim($nid_head) ne "" && trim($nid_mic) ne "") { $lines_to_add= "hint.hdac.0.cad0.nid".$nid_head.".config=\"as=1 seq=15 device=Headphones\"\nhint.hdac.0.cad0.nid".$nid_mic.".config=\"as=4 seq=0\"\n"; } elsif(trim($nid_head) ne "" && trim($nid_mic) eq "") { $lines_to_add= "hint.hdac.0.cad0.nid".$nid_head.".config=\"as=1 seq=15 device=Headphones\"";} if($lines_to_add ne "") { if(appendDevHints($lines_to_add)==1) { print "\n\n device hints have been added\n"; print " I have made a copy of your original device.hints in /boot/device.hints.head.orig just in case of trouble\n"; print " Try REBOOTING, cross fingers and hope it works\n"; print " If it didnt i guess i screwed up somewhere"; print " sysctl dev.hdac.0.pindump=1 and post your dmesg and /boot/device.hints on freebsd.org forum \n"; print " Hope it works out for you :) \n"; print " selven / pcthegreat A|T gmail\n"; print "\n Go on reboot, what are you reading?\n\n"; } } } sub appendDevHints { my($snd_hda_lines)= @_; `cp /boot/device.hints /boot/device.hints.head.orig`; my $device_hints="/boot/device.hints"; open(DEVICEHINTS,">>$device_hints") || die("Cannot Open Device Hints"); print DEVICEHINTS $snd_hda_lines; close(DEVICEHINTS); return 1; } sub getNid { my ($line,@hda_lines,$headPhoned, $miked, $nid_head, $nid_mic, $HDALOUT, $HDAHP, $MIC); my %nidList=(); $HDALOUT="Line-out"; $HDAHP="Headphones"; $MIC="Mic"; @hda_lines=getHda(); $headPhoned=0; $miked=0; foreach(@hda_lines) { $line=$_; if(($line=~ /$HDALOUT/ || $line=~/$HDAHP/) && $line=~/loc\s+2/ && !$headPhoned) { $line=$_; #print $line; $nid_head=grepInBetween($line, "nid", "0x"); $headPhoned=1; #just not to go through the whole lot } if($line=~ /$MIC/ && $line=~/loc\s+2/ && !$miked) { $line=$_; #print $line; $nid_mic=grepInBetween($line, "nid", "0x"); $miked=1; #just not to go through the whole lot } } $nidList{'line_out'}=$nid_head; $nidList{'mic'}=$nid_mic; return %nidList; } sub grepInBetween { my($value, $start_boundary, $end_boundary )= @_; return trim($1) if $value =~ /\Q$start_boundary\E(.*?)\Q$end_boundary\E/; } sub getHda { my (@dmesg_dump, $line,@hda_line, $nid_head, $nid_mic, $HDADEV); $HDADEV="hdac0:"; @dmesg_dump=getDmesg(); foreach(@dmesg_dump) { #print $_; $line=$_; if($line=~ /$HDADEV/) { push(@hda_line, $line); } } return @hda_line; } sub getDmesg { my $result; my @dmesg_dump; `sysctl dev.hdac.0.pindump=1`; $result = `dmesg 2>&1`; @dmesg_dump=split("\n", $result); return @dmesg_dump; } sub trim { my($string)= @_; $string =~ s/^\s+//; $string =~ s/\s+$//; return $string; } ###### output from script : ##### root@rosewill:/home/olivares/Downloads/kerTeX/Documents # ./snd_head.pm Use of uninitialized value $string in substitution (s///) at ./snd_head.pm line 139. Use of uninitialized value $string in substitution (s///) at ./snd_head.pm line 140. Use of uninitialized value in string ne at ./snd_head.pm line 27. Use of uninitialized value $string in substitution (s///) at ./snd_head.pm line 139. Use of uninitialized value $string in substitution (s///) at ./snd_head.pm line 140. Use of uninitialized value in string ne at ./snd_head.pm line 29. root@rosewill:/home/olivares/Downloads/kerTeX/Documents # uname -a FreeBSD rosewill 13.0-RELEASE-p7 FreeBSD 13.0-RELEASE-p7 #0: Mon Jan 31 18:24:03 UTC 2022 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 Any pointers, fixes or thoughts to get this going will be appreciated. Best Regards, Antonio