alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Colin Guthrie <gmane@colin.guthr.ie>
To: alsa-devel@alsa-project.org
Subject: Re: Help! Need to switch between normal speaker and BT headset dynamically
Date: Tue, 06 Apr 2010 15:30:21 +0100	[thread overview]
Message-ID: <hpfghv$dm8$1@dough.gmane.org> (raw)
In-Reply-To: <27215555.734641270553822178.JavaMail.weblogic@epml05>

'Twas brillig, and ANISH KUMAR at 06/04/10 12:37 did gyre and gimble:
> As my question is related to the query what pradeep is asking and mark brown also suggested to me to use PA.
> I have some additional questions regarding PA which i would like to clarify before starting:
> 
> 1.Does PA have good resampler code if my hardware doesn't support resampling?

Yes. Infact this code will likely be needed in several cases when the
h/w does support resampling. If PA has multiple streams playing at once,
the h/w will likely only be able to cope with one rate at a time.

The resamplers are pluggable and can have optimized implementation for
some hardware - e.g. I believe Palm wrote an ARM specific resampler to
do this for their Pre platform (I could be mis-remembering tho').

> I have a system where we are using ALSA as the base and on top(application side) of it there is a thread running which 
> is pumping data and this thread is started by java code.Combination of LINUX+JAVA.
> This thread can perform these tasks:
> 1.Resampling for some rates.
> 2.Talking to PV framework to get the decoded PCM data and pumping audio data to alsa.
> 3.Routing support using asound.conf file.
> Can i replace this thread with PA by writing some wrapper over PA??
> What extra features PA is going to provide additionally if i start using PA other than what is listed above??As i know 
> PA is kind of sound deamon which my thread is not.

One very interesting feature of PA that is particularly relevant to
mobile platforms is the use of a timer-based model to drive the hard
ware. This allows for very large latencies to be used (e.g. 10-20s)
allowing for very efficient processor usage - only waking up when
absolutely necessary, not to service interrupts.

More info:
http://0pointer.de/blog/projects/pulse-glitch-free.html

This approach can bring power savings and thus increased battery life.

> Is there any good resampler code which i can use without any licensing problem  and which can be 
> easily integrated???

I pretty sure the included resamplers are OK to use, but it's all
clearly documented so just take a look.

Like I say it's easy enough to include your own too if needs be.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

  reply	other threads:[~2010-04-06 14:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06 11:37 Help! Need to switch between normal speaker and BT headset dynamically ANISH KUMAR
2010-04-06 14:30 ` Colin Guthrie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-04-04 15:50 Pradeep Kumar Jilagam
2010-04-04 19:36 ` Daniel Chen
2010-04-06  5:06   ` Pradeep Kumar Jilagam
2010-04-06  8:19     ` Colin Guthrie

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='hpfghv$dm8$1@dough.gmane.org' \
    --to=gmane@colin.guthr.ie \
    --cc=alsa-devel@alsa-project.org \
    /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;
as well as URLs for NNTP newsgroup(s).