Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Ford <ipaqlinux@oliford.co.uk>
To: Mark Brown <broonie@sirena.org.uk>
Cc: alsa-devel@alsa-project.org
Subject: Re: Problem setting mixer switch with amixer/alsactl.
Date: Thu, 23 Oct 2008 23:55:05 +0100	[thread overview]
Message-ID: <490100C9.7030907@oliford.co.uk> (raw)
In-Reply-To: <4900851D.2050001@oliford.co.uk>

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

Oliver Ford wrote:

>>         name 'Speaker Playback Volume'
>>         value 1
>>     }
>>         
This is unrelated, I have just left it there from playing around.


>
>> One other thing that would be useful would be to put trace which logs
>> the register writes in ac97_write() in the driver and then try testing
>> both using alsamixer and then amixer to do the final enable of the
>> Speaker Mixer PCM Playback Switch.
>>       
Well...

In terms of the control's direct effect, setting it in alsamixer gives:
pxa2xx_ac97_write: 0c = af08

setting it in amixer:
pxa2xx_ac97_write: 0c = af09



Am I right in understanding that setting all the controls in amixer 
doesn't actually enable the control in the codec chip at that time but 
that the powering on/off is done by soc-dapm.c when the the DAC is 
actually enabled when playing some audio? This appears to be what is 
happening when it does work (looking at the log). I hadn't realised this.

However, after running the offending amixer command this no longer 
happens. It seems that the dapm_power_widgets() function determines that 
the DAC is off and so doesn't power any widgets on at all.

I've put some debugging in pxa2xx-ac97-write and in dapm_power_widgets() 
and the log is attached (stripped of non-audio stuff).



Oliver

[-- Attachment #2: consolelog-dapm-and-ac97regs-amixer-fail.txt --]
[-- Type: text/plain, Size: 2898 bytes --]

Clean boot...


** run speaker.sh setup without PCM->speaker setting... **
pxa2xx_ac97_write: 000c = ef08
pxa2xx_ac97_write: 001c = 0002
pxa2xx_ac97_write: 001c = 1802
pxa2xx_ac97_write: 001e = 0800
pxa2xx_ac97_write: 0006 = 0081
pxa2xx_ac97_write: 0002 = 0080

** run alsamixer, set PCM->speaker on: ** 
pxa2xx_ac97_write: 000c = af08


# aplay /stuff/400Hz-wav.wav
+hpipaq214_startup()
hpipaq214-audio: Enabling iPAQ Speaker...
hpipaq214_startup, gpio96 -> on
-hpipaq214_startup()

Playing WAVE '/stuff/400Hz-wav.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
pxa2xx_ac97_write: 002a = 0411
pxa2xx_ac97_write: 002c = ac44
DAPM: Path Widget 'DAC Inv Mux 2': off --> on
DAPM: Path Widget 'Out 4 Mux': off --> on
DAPM: Path Widget 'Left Speaker Out Mux': off --> on
DAPM: DAC Widget 'Right DAC': off --> on (w->active==1)
pxa2xx_ac97_write: 003c = 3abf
DAPM: DAC Widget 'Left DAC': off --> on (w->active==1)
pxa2xx_ac97_write: 003c = 3a3f
DAPM: Path Widget 'AC97 Mixer': off --> on
DAPM: Path Widget 'Speaker Mixer': off --> on
pxa2xx_ac97_write: 003c = 3a3d
DAPM: Path Widget 'Out 4': off --> on
pxa2xx_ac97_write: 003e = efff
DAPM: Path Widget 'Left Speaker': off --> on
pxa2xx_ac97_write: 003e = eeff
freq changed, set PCD to 5 (LCCR3 = 04700005, LCCR4 = 80000000)
DAPM: Path Widget 'iPAQ Speaker': off --> on
pxa2xx_ac97_write: 003c = 1a3d
hpipaq214_shutdown, gpio96 -> off

** aplay exits. **

** ... few seconds delay ... **

DAPM: Path Widget 'iPAQ Speaker': on --> off
DAPM: Path Widget 'Out 4': on --> off
pxa2xx_ac97_write: 003e = feff
DAPM: Path Widget 'Left Speaker': on --> off
pxa2xx_ac97_write: 003e = ffff
DAPM: Path Widget 'AC97 Mixer': on --> off
DAPM: Path Widget 'Speaker Mixer': on --> off
pxa2xx_ac97_write: 003c = 1a3f
DAPM: Path Widget 'Right DAC': on --> off
pxa2xx_ac97_write: 003c = 1a7f
DAPM: Path Widget 'Left DAC': on --> off
pxa2xx_ac97_write: 003c = 1aff
DAPM: Path Widget 'DAC Inv Mux 2': on --> off
DAPM: Path Widget 'Out 4 Mux': on --> off
DAPM: Path Widget 'Left Speaker Out Mux': on --> off
pxa2xx_ac97_write: 003c = 1aff
pxa2xx_ac97_write: 0026 = 0000


** all quiet **

#
#
# amixer cset numid=62 1 
pxa2xx_ac97_write: 000c = af09
numid=62,iface=MIXER,name='Speaker Mixer PCM Playback Swit'
  ; type=BOOLEAN,access=rw---,values=1
  : values=on



# aplay /stuff/400Hz-wav.wav
+hpipaq214_startup()
hpipaq214-audio: Enabling iPAQ Speaker...
hpipaq214_startup, gpio96 -> on
-hpipaq214_startup()

Playing WAVE '/stuff/400Hz-wav.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
freq changed, set PCD to 5 (LCCR3 = 04700005, LCCR4 = 80000000)
pxa2xx_ac97_write: 002a = 0411
pxa2xx_ac97_write: 002c = ac44
DAPM: DAC Widget 'Right DAC': off --> off (w->active==1)
DAPM: DAC Widget 'Left DAC': off --> off (w->active==1)
pxa2xx_ac97_write: 003c = 1aff
hpipaq214_shutdown, gpio96 -> off
# 
#
pxa2xx_ac97_write: 003c = 1aff
pxa2xx_ac97_write: 0026 = 0000

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2008-10-23 22:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-22 18:47 Problem setting mixer switch with amixer/alsactl Oliver Ford
2008-10-22 20:57 ` Mark Brown
2008-10-22 22:56   ` Oliver Ford
2008-10-23 14:00     ` Mark Brown
2008-10-23 14:07       ` Oliver Ford
2008-10-23 22:55         ` Oliver Ford [this message]
2008-10-27 20:44           ` Mark Brown
     [not found]         ` <4900F6D2.6030305@oliford.co.uk>
2008-10-23 23:54           ` Mark Brown
2008-10-24 17:26           ` Mark Brown
2008-10-23 13:27 ` Mark Brown
2008-10-23 13:56   ` Oliver Ford
2008-10-23 14:01     ` Mark Brown
2008-10-23 17:45       ` Robert Jarzmik
2008-10-24 17:25         ` Mark Brown
2008-10-24 19:09           ` Robert Jarzmik
2008-10-24 20:32             ` Mark Brown
2008-10-28 13:10             ` Mark Brown
2008-10-28 15:34               ` Mark Brown
2008-10-28 15:41                 ` Takashi Iwai
2008-10-28 15:48                   ` Mark Brown
2008-10-28 15:54                     ` Takashi Iwai
2008-10-28 21:51                 ` Oliver Ford
2008-10-29 14:53                   ` Mark Brown
2008-10-29 16:04                   ` Mark Brown
2008-10-30 11:40                     ` Mark Brown
2008-10-30 17:47                       ` Oliver Ford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=490100C9.7030907@oliford.co.uk \
    --to=ipaqlinux@oliford.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@sirena.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox