# Need a simple command/method for boot hints



## quakerdoomer (Nov 19, 2022)

From the output of `sysctl /dev.hdaa`
I got

```
dev.hdaa.1.nid2
dev.hdaa.1.nid3

Also got:
dev.hdaa.0.nid2
dev.hdaa.0.nid3
dev.hdaa.0.nid4
```
.
.
till
.
.
`dev.hdaa.0.nid36`

My autoconfiguration is incorrect and my internal mic does not work. Speaker does.

I am ready to try placing every nid/pin as a hint. 

Questions: 
1. Do I have to use the as= and seq= as is from the log or should I change that also in a series from 1,2,3.. ?
2. Can some one tell me the the exact steps to use boot hints  and if possible how to apply the changes without rebooting (if possible). Thanks.

P.S. 

My /dev/sndstat is:

```
Installed devices:
pcm0: <Realtek ALC257 (Analog)> (play/rec) default
pcm1: <Realtek ALC257 (Right Analog Headphones)> (play)
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> (play)
No devices installed from userspace.
```

I am currently using virtualoss to use an external earphones' mic, but would like to use the internal mic which works on Win and Lin.
Thanks.


----------



## PMc (Nov 19, 2022)

quakerdoomer said:


> *Questions:
> 1. Do I have to use the as= and seq= as is from the log or should I change that also in a series from 1,2,3.. ?
> 2. Can some one tell me the the exact steps to use boot hints  and if possible how to apply the changes without rebooting (if possible). Thanks.*


Basically you can do everything - but whether it then will work, that may depend on the actual internal wiring on your board.
So, maximize your debugging output, try it out, and then see if the association gets accepted or disabled. As you say, win+lin do work, it must be possible to find a working config.

I didn't use a way to do this in the running system. But if the sound is not compiled into the kernel, then it may be possible to kldload/kldunload the sound drivers, and modify the hints with `kenv`, which then should do that trick.

A different approach might be to disable the sound in the kernel, and instead install audio/oss from ports. That one uses a somehow different approach, and, depending on the specific soundcard, it may or may not work better


----------



## quakerdoomer (Nov 19, 2022)

So any steps how to use boot hints file?
Please tell me more about `kenv`





> to disable the sound in the kernel, and instead install audio/oss



So do I kndunload everything related to sound and then??  Or are you suggesting a complete kernel recompilation? Could you please give me some examples? Thanks for your response.


----------



## PMc (Nov 19, 2022)

quakerdoomer said:


> So any steps how to use boot hints file?
> Please tell me more about `kenv`


`kenv` allows to view the settings from the /boot/device.hints (and /boot/loader.conf) files that are currently loaded into the kernel.
It also allows to change these settings temporarily in the kernel, without changing the files.
Examples are in `man 1 kenv`.



quakerdoomer said:


> So do I kndunload everything related to sound and then??


Then you install the port or pkg audio/oss like you install any port. And then follow the documentation that comes with that package. Or, it might "just work" when starting it with `service oss start` and then running `ossxmix` in the graphical display.


----------



## quakerdoomer (Nov 19, 2022)

Here's what I have ben doing:
I did not discover any sound driver loaded under kldstat. My speakers work fine.
I went through the log of sysctl /dev/hdaa and selected those nids that have  as= and seq=
Next here's what I tried:

Step 1: 
	
	



```
kenv "hint.hdaa.0.nid18_config=as1 seq=0"
```
Step 2: Record using audacity using all 4 options one by one.
/dev/dsp: Sprk
/dev/dsp: Mic
/dev/dsp0: Sprk
/dev/dsp0: Mic

Check if it played the recorded audio.
If not,

```
kenv -q  -u hint.hdaa.0.nid18_config
```

Then on to the next nid.
Not firing the commands for nids that have 

```
vendor widget [ DISABLED ]
Widget cap: 0x00f00000
```

I am NOT rebooting my system since kenv was suggested. Is the above process correct?

Audacity:


			https://oshi.at/FBvq


----------



## quakerdoomer (Nov 19, 2022)

PMc said:


> `service oss start` and then running `ossxmix` in the graphical display.


Tried this as well. osstest played fancy music but upon starting the service it said"



> "You must recompile your kernel without the built in sound"



ossinfo shows


> pcm0:record:dsp0.r0        /dev/dsp0.r0   (device index 3)



Audacity does not show this device.
Tried `ossrecord -d /dev/dsp0.r0 -t 2 out.wav`and it said


> /dev/dsp0.r0: Device busy
> 
> There is some other application using this audio device.



I think trying the nid/pins is a better idea. Please read my earlier post.


----------



## quakerdoomer (Nov 21, 2022)

I recompiled my kernel leaving sound aside
Installed oss and startd it via rc.conf - also rebooted. It played no ball. Here's the output of ossmix, ossinfo etc.


```
Loading the osscore module failed
Version info: OSS 4.2 (b 2019/202211080434) (0x00040100) BSD
Platform: FreeBSD/amd64 13.1-RELEASE FreeBSD 13.1-RELEASE GENERIC-NOSOUND (-)

Number of audio devices:    0
Number of audio engines:    0
Number of MIDI devices:        0
Number of mixer devices:    0


Device objects

MIDI devices (/dev/midi*)

Mixer devices

Audio devices

Nodes
Sound subsystem and version: OSS 4.2 (b 2019/202211080434) (0x00040100)
Platform: FreeBSD/amd64 13.1-RELEASE FreeBSD 13.1-RELEASE GENERIC-NOSOUND


NOTICE! You don't have any audio devices available.
        It looks like your audio hardware was not recognized
        by OSS.
           
        If you have installed OSS just a moment ago then it may be necessary to.
        to rebot the system before trying to use the device(s).
```
 Yes rebot and not reboot 
So I reverted back to the original kernel with snd_hda preloaded.

Alternatively I tried the following uncommented nids with as=1 and as=3 one by one with reboots.

```
#Setting as=3
#hint.hdaa.0.nid24.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid20.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid18.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid19.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid25.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid26.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid27.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid29.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid30.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid33.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid3.config="as=3 seq=0 device=mic"

#Setting as=1
#hint.hdaa.0.nid24.config="as=1 seq=0 device=mic"
#hint.hdaa.0.nid20.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid18.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid19.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid25.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid26.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid27.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid29.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid30.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid33.config="as=3 seq=0 device=mic"
#hint.hdaa.0.nid3.config="as=3 seq=0 device=mic"
#TRIED ALL OF THE ABOVE - DID NOT WORK!!
```

*I have a request*: I*f you are reading this and you have a working internal mic, could you all please post your output of*

`sysctl -a | grep hint.hd | grep as=` ?


I get that for mic it should be different than the output stream. I am just trying to sense a pattern to try out more combinations.
Also do I need to mention conn=, ctype= and loc= ?
I am trying to understand which are the most common as and seq observed and maybe I can tweak these a little better.

Thanks.


----------



## BSDoneLove (Nov 23, 2022)

Thanks!!!


----------



## quakerdoomer (Nov 24, 2022)

Can you choose a pcm?
					

Short: How to enforce a specific nid onto a pcm? This is what I have: pcm0, pcm1 and pcm2 ------------------ pcm0 is play/rec nid20/nid25 pcm1 is play nid33 pcm2 is HDMI ------------------   This is what I want ------------------ pcm0 rec nid25 pcm1 play nid33 or nid20 pcm2 HDMI...




					forums.freebsd.org


----------

