Cant Use External mic, using hw mic jack

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

MrEen thanks a lot! i was out of town, i will try those! at this point i want to learn hda-verb too!
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

MrEen wrote: Fri Jan 18, 2019 3:47 pm I'm trying to learn some of this hda-verb stuff to possibly help you with that. I might actually learn enough to be helpful before Mint 23 comes out! :mrgreen:

Anyway, I've learned one thing and it will help to determine the NID for you. In this case, you believe 0x07 is the correct NID, and you can test that this way:

Code: Select all

sudo hda-verb /dev/snd/hwC0D0 0x07 GET_PIN_SENSE 0
When the mic is not connected it'll return 0x0 for the value and when it is connected it'll return 0x80000000 for the value.

At least that will get us one step closer.
plugged or not its always showing the same output

Code: Select all

nid = 0x7, verb = 0xf09, param = 0x0
value = 0x0
if i try with node 0x0f instead which is the headphones the output is as you said when plugged and when not

but if the node is not the 0x07 how do you explain the hda analyzer monitor behaivor? have you tried that script?
https://www.alsa-project.org/main/index ... A_Analyzer

should i try that on every posible node id?
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

i have tried all hexa combinations, and it works for pin 0x10

plugging and unplugging mic... but in

Code: Select all

cat /proc/asound/card*/codec\#*
is described as

Code: Select all

Node 0x10 [Pin Complex] [Jack] HP Out at Ext Front

Code: Select all


emi@machine~ $ sudo hda-verb /dev/snd/hwC0D0 0x10 GET_PIN_SENSE 0
nid = 0x10, verb = 0xf09, param = 0x0
value = 0x0
emi@maachine~ $ sudo hda-verb /dev/snd/hwC0D0 0x10 GET_PIN_SENSE 0
nid = 0x10, verb = 0xf09, param = 0x0
value = 0x80000000
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

node 0x11 responds too, to mic plug unplug
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

problems excecuting the command

Code: Select all

emi@machine~ $ sudo hda-verb /dev/snd/hwC0D0 0x10 SET_AMP_GAIN_MUTE AMP_IN_UNMUTE
No key matching with 'AMP_IN_UNMUTE'
No key matching with 'AMP_IN_UNMUTE'

sudo hda-verb -L

Code: Select all

known verbs:
  GET_STREAM_FORMAT
  GET_AMP_GAIN_MUTE
  GET_PROC_COEF
  GET_COEF_INDEX
  PARAMETERS
  GET_CONNECT_SEL
  GET_CONNECT_LIST
  GET_PROC_STATE
  GET_SDI_SELECT
  GET_POWER_STATE
  GET_CONV
  GET_PIN_WIDGET_CONTROL
  GET_UNSOLICITED_RESPONSE
  GET_PIN_SENSE
  GET_BEEP_CONTROL
  GET_EAPD_BTLENABLE
  GET_DIGI_CONVERT_1
  GET_DIGI_CONVERT_2
  GET_VOLUME_KNOB_CONTROL
  GET_GPIO_DATA
  GET_GPIO_MASK
  GET_GPIO_DIRECTION
  GET_GPIO_WAKE_MASK
  GET_GPIO_UNSOLICITED_RSP_MASK
  GET_GPIO_STICKY_MASK
  GET_CONFIG_DEFAULT
  GET_SUBSYSTEM_ID
  SET_STREAM_FORMAT
  SET_AMP_GAIN_MUTE
  SET_PROC_COEF
  SET_COEF_INDEX
  SET_CONNECT_SEL
  SET_PROC_STATE
  SET_SDI_SELECT
  SET_POWER_STATE
  SET_CHANNEL_STREAMID
  SET_PIN_WIDGET_CONTROL
  SET_UNSOLICITED_ENABLE
  SET_PIN_SENSE
  SET_BEEP_CONTROL
  SET_EAPD_BTLENABLE
  SET_DIGI_CONVERT_1
  SET_DIGI_CONVERT_2
  SET_VOLUME_KNOB_CONTROL
  SET_GPIO_DATA
  SET_GPIO_MASK
  SET_GPIO_DIRECTION
  SET_GPIO_WAKE_MASK
  SET_GPIO_UNSOLICITED_RSP_MASK
  SET_GPIO_STICKY_MASK
  SET_CONFIG_DEFAULT_BYTES_0
  SET_CONFIG_DEFAULT_BYTES_1
  SET_CONFIG_DEFAULT_BYTES_2
  SET_CONFIG_DEFAULT_BYTES_3
  SET_CODEC_RESET
known parameters:
  VENDOR_ID
  SUBSYSTEM_ID
  REV_ID
  NODE_COUNT
  FUNCTION_TYPE
  AUDIO_FG_CAP
  AUDIO_WIDGET_CAP
  PCM
  STREAM
  PIN_CAP
  AMP_IN_CAP
  CONNLIST_LEN
  POWER_STATE
  PROC_CAP
  GPIO_CAP
  AMP_OUT_CAP
  VOL_KNB_CAP

eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

Code: Select all


emi@Machine~ $ sudo hda-verb /dev/snd/hwC0D0 0x10 SET_AMP_GAIN_MUTE 0x64
nid = 0x10, verb = 0x300, param = 0x64
value = 0x0
emi@<Machine~ $ sudo hda-verb /dev/snd/hwC0D0 0x11 SET_AMP_GAIN_MUTE 0x64
nid = 0x11, verb = 0x300, param = 0x64
value = 0x0

using 0x64 in both node ids 10 and 11, cant get mic recording
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Cant Use External mic, using hw mic jack

Post by MrEen »

WOW. This stuff is not easy to figure out.

I got confused with something I read. The amp in appears in what I saw as mute only, and amp out as unmute only. Here where I saw it used: https://github.com/buserror/minifs/blob ... rsio.patch

Do a search (Ctrl-F) for ad1988_6stack_fp_init_verbs[] on that page as you'll see what I mean. I just now realized they are doing AMP_IN_MUTE(0) immediately followed by AMP_IN_MUTE(1) on the same node which I assume is mute then unmute maybe to wake it up?

Regarding your node 11. This I found interesting from your cat /proc/asound/card*/codec\#* output:
Node 0x11 [Pin Complex] wcaps 0x40058b: Stereo Amp-In
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
Amp-In vals: [0x00 0x00]
Pincap 0x00000134: IN OUT Detect
Vref caps: HIZ
Pin Default 0x02012014: [Jack] Line Out at Ext Front
Conn = 1/8, Color = Grey
DefAssociation = 0x1, Sequence = 0x4
Pin-ctls: 0x20: IN VREF_HIZ
This just confuses me more!! Is it IN or OUT? Is it a multi-jack?

I'm afraid I need a hda-verb for dummies book, but I'm still trying!

Regarding hda-analyzer, I've never used it as I've never had a need. Everything on my system just works. Well, except when I break it! But it's always pretty easy to fix. I'll install it and see if it helps me to help you in any way.
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

are you using a different version of hda-verb than me?

cause i dont have that parameter, and itrs not listen in the source code i posted. from where did you get hda-verb?

No key matching with 'AMP_IN_UNMUTE'
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Cant Use External mic, using hw mic jack

Post by MrEen »

I forgot to mention. I don't know if this will help in any way whatsoever, but cat /sys/class/sound/hwC0D0/init_pin_configs shows your present pin configs. I thought it might come in handy at some point, possibly.
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

This just confuses me more!! Is it IN or OUT? Is it a multi-jack?
its marked with the mic simbol, and function as a mic a lot of years ago when this machine has windows....
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

cat /sys/class/sound/hwC0D0/init_pin_configs

Code: Select all

0x0b 0x01014010
0x0c 0x014580f0
0x0d 0x014570f0
0x0e 0x01c530f0
0x0f 0x0221401f
0x10 0x02216011
0x11 0x02012014
0x12 0x37a791f0
0x13 0x908700f0
0x18 0x500000f0
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Cant Use External mic, using hw mic jack

Post by MrEen »

eMINT wrote: Wed Jan 23, 2019 10:02 pm are you using a different version of hda-verb than me?

cause i dont have that parameter, and itrs not listen in the source code i posted. from where did you get hda-verb?

No key matching with 'AMP_IN_UNMUTE'
No, I got confused from that page I linked to. AMP_IN_MUTE exists, and AMP_OUT_UNMUTE exists (at least on that page that is a patch for a different sound card.)

Your list that shows AMP_IN_CAP I believe the CAP can be certain things.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Cant Use External mic, using hw mic jack

Post by MrEen »

Here's a question I have for you. Take the most recent example:

Code: Select all

emi@Machine~ $ sudo hda-verb /dev/snd/hwC0D0 0x10 SET_AMP_GAIN_MUTE 0x64
How do you determine that 0x64 is something worth trying? In the little I've been able to find, I have found posts saying you can use numbers or words, but nowhere can I find what number correspond to what words. The only number that I can understand is 0x0 is the equivalent of off.

Notice on the page I liked how they turn it off then on like this:

Code: Select all

-	{0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-	{0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
I wonder if trying it that way might help you, assuming we're doing it to the correct node.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Cant Use External mic, using hw mic jack

Post by MrEen »

To add to my confusion. From the source code:

Code: Select all

#define AC_PAR_AMP_IN_CAP               0x0d
Now I know that param can have 2 settings (at least) so what does 0x0d mean?

Other than the defines, there's almost nothing else about the params in the source code nor the headers. :evil:

When I first learned programming, comments were a thing!!!
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

MrEen wrote: Wed Jan 23, 2019 10:43 pm Here's a question I have for you. Take the most recent example:

Code: Select all

emi@Machine~ $ sudo hda-verb /dev/snd/hwC0D0 0x10 SET_AMP_GAIN_MUTE 0x64
How do you determine that 0x64 is something worth trying? In the little I've been able to find, I have found posts saying you can use numbers or words, but nowhere can I find what number correspond to what words. The only number that I can understand is 0x0 is the equivalent of off.
in the souce code, there are the words and the corresponding hexa values defined as constants
https://fossies.org/linux/alsa-tools/hd ... hda-verb.c

anyway it was just an example from what you pointed me to try.. im confused too
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

Notice on the page I liked how they turn it off then on like this:

Code: Select all

-	{0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-	{0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
I wonder if trying it that way might help you, assuming we're doing it to the correct node.
[/quote]

i need to take a look at his code, cause thats not a command, but that functions must end executing a command
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

AMP_IN_MUTE() seems to be a function that returns sth but i cant find its definition, it must be imported from some utils package

http://140.136.149.249/lxr/source/the-t ... cal.h#0455
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Cant Use External mic, using hw mic jack

Post by MrEen »

eMINT wrote: Fri Jan 25, 2019 6:28 pm Notice on the page I liked how they turn it off then on like this:

Code: Select all

-	{0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-	{0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
I wonder if trying it that way might help you, assuming we're doing it to the correct node.


i need to take a look at his code, cause thats not a command, but that functions must end executing a command
Understand that he is not using hda-verb there.
eMINT

Re: Cant Use External mic, using hw mic jack

Post by eMINT »

MrEen wrote: Wed Jan 23, 2019 10:59 pm To add to my confusion. From the source code:

Code: Select all

#define AC_PAR_AMP_IN_CAP               0x0d
Now I know that param can have 2 settings (at least) so what does 0x0d mean?
Other than the defines, there's almost nothing else about the params in the source code nor the headers. :evil:
i think its just a constant, that you must send the 0x0d hexadecimal value to the system, to some file or memory to activate the option AC_PAR_AMP_IN_CAP

thats why in many post poeple instead of using the constants names are using the hexa values...

it seems they want people to think they are neo from THE MATRIX... so instead of putting

mic_node_id = 0x10

sudo hda-verb /dev/snd/hwC0D0 mic_node_id SET_AMP_GAIN_MUTE AMP_IN_CAP

they put:

sudo hda-verb /dev/snd/hwC0D0 0x10 0x0b00 0x0d

and we are lucky they dont write that in assembler and binary! hahaha that would be more NEO style
MrEen wrote: Wed Jan 23, 2019 10:59 pm When I first learned programming, comments were a thing!!!
yes u are right!! there is no documentation at all
Locked

Return to “Sound”