[alsa-devel] Dell N5110 HDA External Speaker is mute

Takashi Iwai tiwai at suse.de
Thu Jan 12 17:05:58 CET 2012


At Thu, 12 Jan 2012 16:00:53 +0000,
Cefn Hoile wrote:
> 
> On 12 January 2012 15:18, Takashi Iwai <tiwai at suse.de> wrote:
> > At Thu, 12 Jan 2012 15:11:16 +0000,
> > Cefn Hoile wrote:
> >>
> >> On 12 January 2012 11:59, Takashi Iwai <tiwai at suse.de> wrote:
> >> > At Thu, 12 Jan 2012 11:51:12 +0000,
> >> > Cefn Hoile wrote:
> >> >>
> >> >> Thanks, Takashi.
> >> >>
> >> >> I don't know what tools and invocations to use test out the GPIO
> >> >> values you describe. I think you're saying I shouldn't bother toggling
> >> >> things through HDA Analyzer as there's nothing obviously wrong in that
> >> >> part of the configuration (as reported by alsa-info.sh which is
> >> >> attached as requested).
> >> >>
> >> >> I noticed in HD-Audio.txt a section which mentions a similar problem
> >> >> and IDT codecs specifically (below). Is there an IRC or mailing list
> >> >> where people could talk me through the basics of trying different
> >> >> GPIO/EAPD, Power Enable or Pin Sense manipulations. I wouldn't know
> >> >> how, yet. If I succeed I'll report back.
> >> >>
> >> >> Hopefully this will be worth it, as I think the N5110 is a pretty
> >> >> popular model with a common card, and probably a bunch of Dell
> >> >> hardware could get fixed if it could be figured out.
> >> >
> >> > You can change the GPIO setup via hda-verb on the fly.
> >> > For example, to set GPIO bit 0, try
> >> >        hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x01
> >> >        hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x01
> >> >        hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x01
> >> > where the output direction is assumed, and only GPIO 0 is set.
> >> > For GPIO bit 1,
> >> >        hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x02
> >> >        hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x02
> >> >        hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x02
> >> > and 0x04 for GPIO bit 2.  Your device have up to three GPIO bits.
> >> >
> >> > If none of above doesn't any change, try to set DATA 0 instead of 1,
> >> > and/or DIR 0 instead of 1.
> >> >
> >> >
> >> >
> >> > Takashi
> >> >
> >> >> QUOTING FROM HD-Audio.txt >>>>>>>
> >> >>
> >> >> If you are masochistic enough to debug the driver problem, note the
> >> >> following:
> >> >>
> >> >> - The speaker (and the headphone, too) output often requires the
> >> >>   external amplifier. This can be set usually via EAPD verb or a
> >> >>   certain GPIO. If the codec pin supports EAPD, you have a better
> >> >>   chance via SET_EAPD_BTL verb (0x70c). On others, GPIO pin (mostly
> >> >>   it's either GPIO0 or GPIO1) may turn on/off EAPD.
> >> >> - Some Realtek codecs require special vendor-specific coefficients to
> >> >>   turn on the amplifier. See patch_realtek.c.
> >> >> - IDT codecs may have extra power-enable/disable controls on each
> >> >>   analog pin. See patch_sigmatel.c.
> >> >> - Very rare but some devices don't accept the pin-detection verb until
> >> >>   triggered. Issuing GET_PIN_SENSE verb (0xf09) may result in the
> >> >>   codec-communication stall. Some examples are found in
> >> >>   patch_realtek.c.
> >> >>
> >> >> <<<<<<<<
> >> >>
> >> >> On 12 January 2012 11:25, Takashi Iwai <tiwai at suse.de> wrote:
> >> >> > At Thu, 12 Jan 2012 10:56:24 +0000,
> >> >> > Cefn Hoile wrote:
> >> >> >>
> >> >> >> In case anything has changed in my config since the original info run,
> >> >> >> here is the same script run right now...
> >> >> >>
> >> >> >> http://www.alsa-project.org/db/?f=d0a1fd23339878916b611c88e64e4868b45445ce
> >> >> >
> >> >> > Could you rather attach?  Then it'll be archived and searchable.
> >> >> >
> >> >> > Anyway, I don't see any obvious problem in the output.
> >> >> > If the pin assignment is correct, the routing and amp setups should be
> >> >> > OK with the current status.
> >> >> >
> >> >> > Maybe it's a missing GPIO setup.  Try to adjust GPIO mask, direction
> >> >> > and value bits.
> >> >> >
> >> >> >
> >> >> > Takashi
> >>
> >> I have tried the attached script, which hopefully corresponds with the
> >> GPIO exploration regime you wanted me to try. Please take a look at
> >> the sequence in case there could be some combination I missed based on
> >> trying to interpret your description, or if there's some kind of
> >> reload step I need to do.
> >
> > Yeah, there are some bugs :)
> > The combination should be (mask/dir/data)
> > 1/1/0 1/1/1 1/0/0 1/0/1
> > 2/2/0 2/2/2 2/0/0 2/0/2
> > 4/4/0 4/4/4 4/0/0 4/0/4
> >
> > Also, as a test, use aplay with -Dplughw option.
> > This skips PA and others.
> >
> >
> > Takashi
> >
> >> When running this GPIO script as...
> >> sudo ./setgpio.sh
> >> ...with headphones on my N5110 it plays the sample every time, and
> >> with speakers it is always silent.
> >>
> >> Here's an example log of execution...
> >>
> >> cefn at cefn-oneiric-dell:~$ sudo ./setgpio.sh
> >> [sudo] password for cefn:
> >> SETTING GPIO 0x01 MASK, DIRECTION AND DATA TO [0x01 0x00 0x00]
> >> nid = 0x1, verb = 0x716, param = 0x1
> >> value = 0x0
> >> nid = 0x0, verb = 0x717, param = 0x1
> >> value = 0x0
> >> nid = 0x0, verb = 0x715, param = 0x1
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x02 MASK, DIRECTION AND DATA TO [0x01 0x00 0x00]
> >> nid = 0x1, verb = 0x716, param = 0x2
> >> value = 0x0
> >> nid = 0x0, verb = 0x717, param = 0x2
> >> value = 0x0
> >> nid = 0x0, verb = 0x715, param = 0x2
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x04 MASK, DIRECTION AND DATA TO [0x01 0x00 0x00]
> >> nid = 0x1, verb = 0x716, param = 0x4
> >> value = 0x0
> >> nid = 0x0, verb = 0x717, param = 0x4
> >> value = 0x0
> >> nid = 0x0, verb = 0x715, param = 0x4
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x01 MASK, DIRECTION AND DATA TO [0x01 0x00 0x01]
> >> nid = 0x1, verb = 0x716, param = 0x1
> >> value = 0x0
> >> nid = 0x0, verb = 0x717, param = 0x1
> >> value = 0x0
> >> nid = 0x1, verb = 0x715, param = 0x1
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x02 MASK, DIRECTION AND DATA TO [0x01 0x00 0x01]
> >> nid = 0x1, verb = 0x716, param = 0x2
> >> value = 0x0
> >> nid = 0x0, verb = 0x717, param = 0x2
> >> value = 0x0
> >> nid = 0x1, verb = 0x715, param = 0x2
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x04 MASK, DIRECTION AND DATA TO [0x01 0x00 0x01]
> >> nid = 0x1, verb = 0x716, param = 0x4
> >> value = 0x0
> >> nid = 0x0, verb = 0x717, param = 0x4
> >> value = 0x0
> >> nid = 0x1, verb = 0x715, param = 0x4
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x01 MASK, DIRECTION AND DATA TO [0x01 0x01 0x00]
> >> nid = 0x1, verb = 0x716, param = 0x1
> >> value = 0x0
> >> nid = 0x1, verb = 0x717, param = 0x1
> >> value = 0x0
> >> nid = 0x0, verb = 0x715, param = 0x1
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x02 MASK, DIRECTION AND DATA TO [0x01 0x01 0x00]
> >> nid = 0x1, verb = 0x716, param = 0x2
> >> value = 0x0
> >> nid = 0x1, verb = 0x717, param = 0x2
> >> value = 0x0
> >> nid = 0x0, verb = 0x715, param = 0x2
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x04 MASK, DIRECTION AND DATA TO [0x01 0x01 0x00]
> >> nid = 0x1, verb = 0x716, param = 0x4
> >> value = 0x0
> >> nid = 0x1, verb = 0x717, param = 0x4
> >> value = 0x0
> >> nid = 0x0, verb = 0x715, param = 0x4
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x01 MASK, DIRECTION AND DATA TO [0x01 0x01 0x01]
> >> nid = 0x1, verb = 0x716, param = 0x1
> >> value = 0x0
> >> nid = 0x1, verb = 0x717, param = 0x1
> >> value = 0x0
> >> nid = 0x1, verb = 0x715, param = 0x1
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x02 MASK, DIRECTION AND DATA TO [0x01 0x01 0x01]
> >> nid = 0x1, verb = 0x716, param = 0x2
> >> value = 0x0
> >> nid = 0x1, verb = 0x717, param = 0x2
> >> value = 0x0
> >> nid = 0x1, verb = 0x715, param = 0x2
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >> SETTING GPIO 0x04 MASK, DIRECTION AND DATA TO [0x01 0x01 0x01]
> >> nid = 0x1, verb = 0x716, param = 0x4
> >> value = 0x0
> >> nid = 0x1, verb = 0x717, param = 0x4
> >> value = 0x0
> >> nid = 0x1, verb = 0x715, param = 0x4
> >> value = 0x0
> >> Home directory /home/cefn not ours.
> >> Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
> >> Little Endian, Rate 48000 Hz, Mono
> >>
> >>
> >> Cefn
> 
> Thanks again for your patience. It would be really useful if you could
> suggest a specific change to the section of my script which details
> the alternates, unless my script is more conceptually broken than
> that. That way I can't misinterpret which of the flags you're trying
> to describe with words. The problem I have looking at your "1/1/0"
> list is which arguments of the actual hda-verb command to bind them
> to: there are actually 4 values to vary in my mind. Three lines are
> executed as a block for every possible combination of values in my
> script (in the center of the nested loops)...
> 
> hda-verb /dev/snd/hwC0D0 "$GPIOMASK" SET_GPIO_MASK "$TARGETBIT"
> hda-verb /dev/snd/hwC0D0 "$GPIODIR" SET_GPIO_DIR "$TARGETBIT"				
> hda-verb /dev/snd/hwC0D0 "$GPIODATA" SET_GPIO_DATA "$TARGETBIT"
> 
> .... that is, GPIOMASK, GPIODIR, GPIODATA AND TARGETBIT. Your response
> details only 3 values, so what do I do with TARGETBIT, or is it
> identical to something else?.

No, the the first argument after /dev/snd/hwC0D0 is always 0x01.
It's the AFG node id which the GPIO is always bound to.  Only the last
value, i.e. the parameter to the exected verb, is changed.


Takashi


More information about the Alsa-devel mailing list