Re: Neo1973 WM8753/Alsa Configuration

2008-10-06 Thread Mark Brown
On Sat, Oct 04, 2008 at 12:39:26AM +0200, Joerg Reisenweber wrote:

> Also I'm pretty sure the "user visible control name" isn't exactly what you 
> get to see in alsamixer for example. Furthermore they are often wrong as they 

The user visible control name might get truncated due to limitations in
ALSA and it might get a prefix added to it but other than that it should
be presented directly - should certainly be good enough for searching.

> don't regard our particular hw-setup, where GSM-mic sensitivity is something 
> like "mono sidetone playback volume" or such weirdness.

Right, there's a certain assumption there that you'll be able to cross
reference with the design.  There have been efforts to fix this for end
user applications but not much for people working on scenario configuration
- there's much less call for doing it there, quite a few people would
find it confusing.

> The situation resembles using a "genuine PS/2 mouse" driver for a synaptics 
> touchpad. I really don't think there is any value or sane rationale behind 
> using a generic upstream driver for a very OM-specific hw-design, the usual 
> way for all hardware is manufacturer of device creates tailored-to-suit 
> drivers for their product, admittedly based on chip manuf's generic chip 
> driver sources usually.

That's what everyone used to do in Linux - what happened was that you
ended up with a pile of drivers, all replicating the same control for
the same chips but usually missing out bits of it.  Any kind of update
or improvement had to be made to each driver independently which was
very wasteful, causing a lot of duplicated work.

It's worth remembering here that the way things work in the Linux kernel
when you're trying to upstream (overall, not just for audio) is very
different to how things work in proprietary OSs.  Rather than forking
off a BSP for a particular system as you would with a proprietary OS all
systems work from the same kernel code.  System-specific changes to
generic drivers are strongly frowned on since they don't scale well, so
generic drivers that need such modifications don't go over too well.

___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-03 Thread Kyle Bassett
>From the last few days of hacking around with the system, I was able to make
some sense of the information.  Along with what Joerg had said, the state
files can be a pain to sift through because they are generic or used
differently in the openmoko configuration.

My largest concern is attempting to make sense of the controls, because the
only way I was able to re-map them was to search the source for the generic
"name" string, then look up what the register they modified was in the
datasheet, and *then* determine what function the control has.  It seems to
be a clouded way to work with the system, considering all the documentation
is generic, minus that block diagram I've been using...

(http://wiki.openmoko.org/wiki/Image:WM8753_ALSA_Mapping.png)  <--my only
saving grace, but only for the controls listed on the diagram...

It would be very helpful if I had information about how the controls are
interfaced for GTA01/02, or what each of the 95 controls logically changed
in GTA01/02.  In addition, its difficult to determeine the funcation of
controls such as #90, most capture controls due to the ambiguity.

I am using a GTA01v4- and can anyone recommend the best (most recent/stable)
GTA01 standard image to use for (audio/BT) development?

-Kyle



On Fri, Oct 3, 2008 at 6:39 PM, Joerg Reisenweber <[EMAIL PROTECTED]>wrote:

> Am Mi  1. Oktober 2008 schrieb Mark Brown:
> > On Wed, Oct 01, 2008 at 05:13:37PM +0200, Joerg Reisenweber wrote:
> >
> > > I tried to find name of a registers this way, but this code is so
> nested
> and
> > > cryptic and poorly commented, I really didn't success to understand the
> logic
> > > behind the data structures and defines.
> >
> > The actual register definitions are pretty direct AFAICS - the text
> > string with the user visible control name is immediately next to the
> > register names - for example:
> >
> >   SOC_DOUBLE_R_TLV("PCM Volume", WM8753_LDAC, WM8753_RDAC, 0, 255, 0,
> dac_tlv),
> >
> > is a control callled "PCM Volume" at bit 0 with value up to 255 in the
> > LDAC and RDAC registers.  Obviously, YMMV but it shouldn't be too hard
> > to find the user-visible name for a register bit or vice versa, I'd have
> > thought.
>
> 60sec reality check:
> PCF50633UM2.00.pdf -> search "RDAC" -> "error: no occurrence found"
>
> Also I'm pretty sure the "user visible control name" isn't exactly what you
> get to see in alsamixer for example. Furthermore they are often wrong as
> they
> don't regard our particular hw-setup, where GSM-mic sensitivity is
> something
> like "mono sidetone playback volume" or such weirdness.
> The situation resembles using a "genuine PS/2 mouse" driver for a synaptics
> touchpad. I really don't think there is any value or sane rationale behind
> using a generic upstream driver for a very OM-specific hw-design, the usual
> way for all hardware is manufacturer of device creates tailored-to-suit
> drivers for their product, admittedly based on chip manuf's generic chip
> driver sources usually.
>
> /jOERG
>
___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-03 Thread Joerg Reisenweber
Am Sa  4. Oktober 2008 schrieb Joerg Reisenweber:
> Am Mi  1. Oktober 2008 schrieb Mark Brown:
> > On Wed, Oct 01, 2008 at 05:13:37PM +0200, Joerg Reisenweber wrote:
> > 
> > > I tried to find name of a registers this way, but this code is so nested 
> and 
> > > cryptic and poorly commented, I really didn't success to understand the 
> logic 
> > > behind the data structures and defines.
> > 
> > The actual register definitions are pretty direct AFAICS - the text
> > string with the user visible control name is immediately next to the
> > register names - for example:
> > 
> >   SOC_DOUBLE_R_TLV("PCM Volume", WM8753_LDAC, WM8753_RDAC, 0, 255, 0, 
> dac_tlv),
> > 
> > is a control callled "PCM Volume" at bit 0 with value up to 255 in the
> > LDAC and RDAC registers.  Obviously, YMMV but it shouldn't be too hard
> > to find the user-visible name for a register bit or vice versa, I'd have
> > thought.
> 
> 60sec reality check:
WM8753_Rev3.4.pdf  -> search "RDAC" -> found "RDACVOL" in register "R9 Right 
channel Digital Volume"

OK, not that clear an example as with PCF50633 ;-), but anyway not THAT 
unambiguous and straight forward as it might be - and I think it gets worse 
on other registers' names.
The other (more important!) way round it's even more cloudy and difficult, 
from WM8753_Rev3.4.pdf or even WM8753_control_diag.pdf, I might imagine to 
search in src for "RDACVOL" or "R9" and won't find anything. 
And, maybe due to own blindness, I didn't figure how to map 
R9(09h)->WM8753_RDAC. :-/

cheers
jOERG


signature.asc
Description: This is a digitally signed message part.
___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-03 Thread Joerg Reisenweber
Am Sa  4. Oktober 2008 schrieb Joerg Reisenweber:
> Am Mi  1. Oktober 2008 schrieb Mark Brown:
> > On Wed, Oct 01, 2008 at 05:13:37PM +0200, Joerg Reisenweber wrote:
> > 
> > > I tried to find name of a registers this way, but this code is so nested 
> and 
> > > cryptic and poorly commented, I really didn't success to understand the 
> logic 
> > > behind the data structures and defines.
> > 
> > The actual register definitions are pretty direct AFAICS - the text
> > string with the user visible control name is immediately next to the
> > register names - for example:
> > 
> >   SOC_DOUBLE_R_TLV("PCM Volume", WM8753_LDAC, WM8753_RDAC, 0, 255, 0, 
> dac_tlv),
> > 
> > is a control callled "PCM Volume" at bit 0 with value up to 255 in the
> > LDAC and RDAC registers.  Obviously, YMMV but it shouldn't be too hard
> > to find the user-visible name for a register bit or vice versa, I'd have
> > thought.
> 
> 60sec reality check:
> PCF50633UM2.00.pdf -> search "RDAC" -> "error: no occurrence found"

ooops, sorry :o)


signature.asc
Description: This is a digitally signed message part.
___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-03 Thread Joerg Reisenweber
Am Mi  1. Oktober 2008 schrieb Mark Brown:
> On Wed, Oct 01, 2008 at 05:13:37PM +0200, Joerg Reisenweber wrote:
> 
> > I tried to find name of a registers this way, but this code is so nested 
and 
> > cryptic and poorly commented, I really didn't success to understand the 
logic 
> > behind the data structures and defines.
> 
> The actual register definitions are pretty direct AFAICS - the text
> string with the user visible control name is immediately next to the
> register names - for example:
> 
>   SOC_DOUBLE_R_TLV("PCM Volume", WM8753_LDAC, WM8753_RDAC, 0, 255, 0, 
dac_tlv),
> 
> is a control callled "PCM Volume" at bit 0 with value up to 255 in the
> LDAC and RDAC registers.  Obviously, YMMV but it shouldn't be too hard
> to find the user-visible name for a register bit or vice versa, I'd have
> thought.

60sec reality check:
PCF50633UM2.00.pdf -> search "RDAC" -> "error: no occurrence found"

Also I'm pretty sure the "user visible control name" isn't exactly what you 
get to see in alsamixer for example. Furthermore they are often wrong as they 
don't regard our particular hw-setup, where GSM-mic sensitivity is something 
like "mono sidetone playback volume" or such weirdness.
The situation resembles using a "genuine PS/2 mouse" driver for a synaptics 
touchpad. I really don't think there is any value or sane rationale behind 
using a generic upstream driver for a very OM-specific hw-design, the usual 
way for all hardware is manufacturer of device creates tailored-to-suit 
drivers for their product, admittedly based on chip manuf's generic chip 
driver sources usually.

/jOERG


signature.asc
Description: This is a digitally signed message part.
___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-01 Thread Joerg Reisenweber
Am Mi  1. Oktober 2008 schrieb Kyle Bassett:
> Do the channel numbers of the following block diagram still apply?
> http://wiki.openmoko.org/wiki/Image:WM8753_ALSA_Mapping.png
> 
> That's from the
> http://wiki.openmoko.org/wiki/Neo_1973_audio_subsystempage.  As long
> as the hardware connection information is correct on that
> page, I will just work backwards.
> 
> Another note: while playing back using stereoout.state, the headset and the
> stereo speakers play at the same time.  Is there a way to mute/switch off
> either output?  I don't recall if that was a GTA01v4 hardware glitch or
> something else.

audio subsystem is quite identical in GTA01 and GTA02 (except the mono amp in 
02 vs stereo in 01).
Speaker(s) and headhones are mutually exclusive, means you mustn't connect 
headphones and then play back thru speaker, as hp can't be disabled. Instead 
you have to switch amp to hp-mode when hp plugged in, what means speaker(s) 
is(/are) disabled. 

cheers
jOERG


signature.asc
Description: This is a digitally signed message part.
___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-01 Thread Kyle Bassett
Do the channel numbers of the following block diagram still apply?
http://wiki.openmoko.org/wiki/Image:WM8753_ALSA_Mapping.png

That's from the
http://wiki.openmoko.org/wiki/Neo_1973_audio_subsystempage.  As long
as the hardware connection information is correct on that
page, I will just work backwards.

Another note: while playing back using stereoout.state, the headset and the
stereo speakers play at the same time.  Is there a way to mute/switch off
either output?  I don't recall if that was a GTA01v4 hardware glitch or
something else.




On Wed, Oct 1, 2008 at 11:25 AM, Mark Brown <
[EMAIL PROTECTED]> wrote:

> On Wed, Oct 01, 2008 at 05:13:37PM +0200, Joerg Reisenweber wrote:
>
> > I tried to find name of a registers this way, but this code is so nested
> and
> > cryptic and poorly commented, I really didn't success to understand the
> logic
> > behind the data structures and defines.
>
> The actual register definitions are pretty direct AFAICS - the text
> string with the user visible control name is immediately next to the
> register names - for example:
>
>  SOC_DOUBLE_R_TLV("PCM Volume", WM8753_LDAC, WM8753_RDAC, 0, 255, 0,
> dac_tlv),
>
> is a control callled "PCM Volume" at bit 0 with value up to 255 in the
> LDAC and RDAC registers.  Obviously, YMMV but it shouldn't be too hard
> to find the user-visible name for a register bit or vice versa, I'd have
> thought.
>
___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-01 Thread Kyle Bassett
I haven't thought of that one...but in theory that should work just as
well.  I'll give it a try tonight.

On Wed, Oct 1, 2008 at 4:48 AM, Alastair Johnson <[EMAIL PROTECTED]>wrote:

> Kyle Bassett wrote:
> > Hey guys,
> >
> > I am attempting to utilize the Neo as a mobile filtering system for a
> > project, using alsa and dmix's features for the audio modification.  I
> > am able to get the Neo to record and playback, but not simultaneously.
> > I have been attempting to merge the two .state files to allow
> > simultaneous rec/playback, but haven't been successful.
> >
> > Playback only:
> > #alsactl -f /usr/share/openmoko/scenarios/stereoout.state restore
> > #aplay --device neo1973 -f cd /media/card/song.wav
> >
> > Recording only:
> > #alsactl -f /usr/share/openmoko/scenarios/capturehandset.state restore
> > #arecord --device neo1973 -f cd /media/card/mic_audio.wav
> >
> > ...and when I try to perform something like:
> > #arecord -D neo1973 -f cd | aplay -D neo1973 -f cd
> >
> > it execs successfully but I don't end up hearing any audio output.  I
> > have also tried changing the DAI Mode to 2 with no luck.  I was not able
> > to find a wiki page describing the the controls in the alsa mixer/.state
> > files...and how those controls are routed to the hardware.  I've been
> > trying to parse the Neo1973 Audio Subsystem page with no luck.
> >
> > Any ideas are much appreciated!  (I will update the wiki with any
> > breakthroughs)
>
> I know there are some differences between the Freerunner and the 1973,
> but it is probably worth looking at
> http://www.koolu.org/voip-handset.state since voip apps route the
> handset mic and earpiece to the PCM interface.
>
> ___
> hardware mailing list
> hardware@lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/hardware
>
___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-01 Thread Mark Brown
On Wed, Oct 01, 2008 at 05:13:37PM +0200, Joerg Reisenweber wrote:

> I tried to find name of a registers this way, but this code is so nested and 
> cryptic and poorly commented, I really didn't success to understand the logic 
> behind the data structures and defines.

The actual register definitions are pretty direct AFAICS - the text
string with the user visible control name is immediately next to the
register names - for example:

  SOC_DOUBLE_R_TLV("PCM Volume", WM8753_LDAC, WM8753_RDAC, 0, 255, 0, dac_tlv),

is a control callled "PCM Volume" at bit 0 with value up to 255 in the
LDAC and RDAC registers.  Obviously, YMMV but it shouldn't be too hard
to find the user-visible name for a register bit or vice versa, I'd have
thought.

___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-01 Thread Joerg Reisenweber
Am Mi  1. Oktober 2008 schrieb Mark Brown:
> The controls for the WM8753 itself are all defined in
> sound/soc/codecs/wm8753.c in the kernel source - they're all done with
> macros which map them into register fields in the codec.

I tried to find name of a registers this way, but this code is so nested and 
cryptic and poorly commented, I really didn't success to understand the logic 
behind the data structures and defines.

@Kyle: you could try to learn from a diff between the two state files (plus 
maybe a third one, for reference to distinguish the specific controls to set 
for a particular state)

cheers
jOERG


signature.asc
Description: This is a digitally signed message part.
___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-01 Thread Mark Brown
On Wed, Oct 01, 2008 at 04:21:20AM -0400, Kyle Bassett wrote:

> also tried changing the DAI Mode to 2 with no luck.  I was not able to find
> a wiki page describing the the controls in the alsa mixer/.state files...and
> how those controls are routed to the hardware.  I've been trying to parse
> the Neo1973 Audio Subsystem page with no luck.

The controls for the WM8753 itself are all defined in
sound/soc/codecs/wm8753.c in the kernel source - they're all done with
macros which map them into register fields in the codec.

___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Re: Neo1973 WM8753/Alsa Configuration

2008-10-01 Thread Alastair Johnson
Kyle Bassett wrote:
> Hey guys,
> 
> I am attempting to utilize the Neo as a mobile filtering system for a 
> project, using alsa and dmix's features for the audio modification.  I 
> am able to get the Neo to record and playback, but not simultaneously.  
> I have been attempting to merge the two .state files to allow 
> simultaneous rec/playback, but haven't been successful.
> 
> Playback only:
> #alsactl -f /usr/share/openmoko/scenarios/stereoout.state restore
> #aplay --device neo1973 -f cd /media/card/song.wav
> 
> Recording only:
> #alsactl -f /usr/share/openmoko/scenarios/capturehandset.state restore
> #arecord --device neo1973 -f cd /media/card/mic_audio.wav
> 
> ...and when I try to perform something like:
> #arecord -D neo1973 -f cd | aplay -D neo1973 -f cd
> 
> it execs successfully but I don't end up hearing any audio output.  I 
> have also tried changing the DAI Mode to 2 with no luck.  I was not able 
> to find a wiki page describing the the controls in the alsa mixer/.state 
> files...and how those controls are routed to the hardware.  I've been 
> trying to parse the Neo1973 Audio Subsystem page with no luck.
> 
> Any ideas are much appreciated!  (I will update the wiki with any 
> breakthroughs)

I know there are some differences between the Freerunner and the 1973, 
but it is probably worth looking at 
http://www.koolu.org/voip-handset.state since voip apps route the 
handset mic and earpiece to the PCM interface.

___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware


Neo1973 WM8753/Alsa Configuration

2008-10-01 Thread Kyle Bassett
Hey guys,

I am attempting to utilize the Neo as a mobile filtering system for a
project, using alsa and dmix's features for the audio modification.  I am
able to get the Neo to record and playback, but not simultaneously.  I have
been attempting to merge the two .state files to allow simultaneous
rec/playback, but haven't been successful.

Playback only:
#alsactl -f /usr/share/openmoko/scenarios/stereoout.state restore
#aplay --device neo1973 -f cd /media/card/song.wav

Recording only:
#alsactl -f /usr/share/openmoko/scenarios/capturehandset.state restore
#arecord --device neo1973 -f cd /media/card/mic_audio.wav

...and when I try to perform something like:
#arecord -D neo1973 -f cd | aplay -D neo1973 -f cd

it execs successfully but I don't end up hearing any audio output.  I have
also tried changing the DAI Mode to 2 with no luck.  I was not able to find
a wiki page describing the the controls in the alsa mixer/.state files...and
how those controls are routed to the hardware.  I've been trying to parse
the Neo1973 Audio Subsystem page with no luck.

Any ideas are much appreciated!  (I will update the wiki with any
breakthroughs)

Regards,

Kyle
___
hardware mailing list
hardware@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/hardware