Sorry about the confusion - I am interested in routing between the speaker
and the phone speaker. The script you sent is for the wired headphone which
the N900 automatically switches to once it detects a connected device.

Regards,
-Saurabh

On Thu, May 6, 2010 at 2:30 PM, Daniil Ivanov <daniil.iva...@gmail.com>wrote:

> Hi Saurabh!
>
>  You can use the following script for routing playback between speaker
> and headphones:
>
> #!/bin/sh
>
> if [ "${1}" == "speaker" ] ; then
>  # low headphone playback volume
>  amixer -qc0 cset iface=MIXER,name='Headphone Playback Volume' 5,5
>
>  amixer -qc0 cset iface=MIXER,name='Left DAC_L1 Mixer Line Switch' off
>  amixer -qc0 cset iface=MIXER,name='Left DAC_L1 Mixer HP Switch' on
>  amixer -qc0 cset iface=MIXER,name='Right DAC_R1 Mixer Line Switch' off
>  amixer -qc0 cset iface=MIXER,name='Right DAC_R1 Mixer HP Switch' on
>
>  amixer -qc0 cset iface=MIXER,name='HP DAC Playback Volume' 50,50
>  amixer -qc0 cset iface=MIXER,name='Speaker Function' 1
> else if [ "${1}" == "headphone" ] ; then
>  amixer -qc0 cset iface=MIXER,name='Left DAC_L1 Mixer HP Switch' off
>  amixer -qc0 cset iface=MIXER,name='Left DAC_L1 Mixer Line Switch' on
>  amixer -qc0 cset iface=MIXER,name='Right DAC_R1 Mixer HP Switch' off
>  amixer -qc0 cset iface=MIXER,name='Right DAC_R1 Mixer Line Switch' on
>
>  amixer -qc0 cset iface=MIXER,name='HP DAC Playback Volume' 0,0
>  amixer -qc0 cset iface=MIXER,name='Speaker Function' 0
> else
>    echo 'Please specify option: "speaker" or "headphone"' ;
> fi
> fi
>
> Thanks, Daniil.
>
> On Sun, May 2, 2010 at 6:29 PM, Chitti Babu <chitti_ma...@yahoo.com>
> wrote:
> >
> > Hi Saurabh,
> > Were n't you using Telepathy for your VOIP application ? I think farsight
> (StreamedMedia plugin on gstreamer) handles all such intricacies.
> >
> > If your application is SIP based, you can just use telepathy-sofiasip as
> your backend.
> >
> > Regards,
> > Chitti
> >
> > --- On Sun, 5/2/10, maemo-developers-requ...@maemo.org <
> maemo-developers-requ...@maemo.org> wrote:
> >
> > Message: 8
> > Date: Sun, 2 May 2010 08:43:04 +0530
> > From: saurabh aggarwal <aggarwal.saur...@gmail.com>
> > Subject: Re: Audio Routing API
> > To: Martin Grimme <martin.gri...@gmail.com>
> > Cc: maemo-developers@maemo.org
> > Message-ID:
> >     <l2le3a9904f1005012013q167658ccre8a0d368ff6b3...@mail.gmail.com>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > Thanks Martin, I have a feeling that I should be able to set those flags
> in
> > alsa using the gstreamer APIs and pulsesink.
> >
> > The pulsesink object does accept a propllist, and using pactl if you look
> at
> > the pulsesink, there seem to be properties that should be able to switch
> > between headset and speaker. Like x-maemo.mode which seems to be IHF or
> HP
> > depending on whether pulsesink is in headset or speaker mode.
> >
> > I have been trying to use these flags, but haven't been able to do so
> till
> > now. If someone can help here, that would be great.
> >
> > -Saurabh
> >
> > On Sat, May 1, 2010 at 3:46 AM, Martin Grimme <martin.gri...@gmail.com
> >wrote:
> >
> > > Hi,
> > >
> > > alsamixer -c0
> > > reveals a switch to route audio to the earpiece (I don't remember it's
> > > exact name). I don't think you can route sound to the earpiece any
> > > other way. Somebody please correct me if I'm wrong.
> > >
> > >
> > > Martin
> > >
> > >
> > > 2010/4/28, saurabh aggarwal <aggarwal.saur...@gmail.com>:
> > >  > We are developing a VoIP application, and have it running for Maemo5
> > > (using
> > > > gstreamer/pulseaudio).
> > > >
> > > > The problem now is that the output being used is the speaker, and not
> the
> > > > headphone/earpiece.
> > > >
> > > > I have tried a couple of things (which haven't worked) like -
> > > > gst-launch pulsesrc device=source.voice ! pulsesink device=sink.voice
> > > > (outputs voice from speaker)
> > > >
> > > > gst-launch pulsesrc  ! pulsesink device=sink.hw0 x-maemo.mode="hp" (I
> get
> > > an
> > > > error no element "hp"). Have tried the same with "ihf".
> > > >
> > > > If someone can point me to the right direction, that would be really
> > > > appreciated.
> > > >
> > > > -Saurabh
> > > >
> > >
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: <
> http://lists.maemo.org/pipermail/maemo-developers/attachments/20100502/31d0d54f/attachment-0001.htm
> >
> > ***********************************************
> >
> >
> > _______________________________________________
> > maemo-developers mailing list
> > maemo-developers@maemo.org
> > https://lists.maemo.org/mailman/listinfo/maemo-developers
> >
>
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to