From: stan <ghjeold_i_mwee@cox.net>
To: "Mitul Sen (misen)" <misen@cisco.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Setting format to SND_PCM_FORMAT_MU_LAW does not let me apply hardware parameters
Date: Tue, 01 Jul 2008 06:59:39 -0700 [thread overview]
Message-ID: <486A384B.6090103@cox.net> (raw)
In-Reply-To: <3B6F5C9068D5864096EB291236C3386F02CE1628@xmb-sjc-21d.amer.cisco.com>
Mitul Sen (misen) wrote:
> I am a newbie to ALSA and any help will be much appreciated.
>
> I have an application which sets up the signaling between an IP phone
> and my desktop and then sets up the audio path between the two.
>
> On my desktop application, I am able to receive RTP packets from IP
> phone. I use an RTP stack to parse the data and after going through the
> RTP stack, I try to play back the audio using ALSA. When I use the ALSA
> code to play back (in real time) using sound card of my device, there is
> only noise, I cannot hear the audio that I speak into the IP phone.
> However, if I take the raw data coming from the RTP stack and write it
> to a file, I can play back the file successfully.
>
> Since my data from IP phone is G.711 encoded, I have set the sampling
> rate within ALSA to 8000. Also I am using one source (mono) and
> non-interleaved data option for preparing ALSA for playback. When I set
> the format to SND_PCM_FORMAT_MU_LAW, at runtime it lets me set that
> format ie. snd_pcm_hw_params_set_format (for SND_PCM_FORMAT_MU_LAW) is
> successful. However I get a runtime error while applying the hardware
> parameters using snd_pcm_hw_params(..) if the format set earlier is
> SND_PCM_FORMAT_MU_LAW. Using any other format like SND_PCM_FORMAT_U8 or
> SND_PCM_FORMAT_S8, lets me apply the hardware parameters but it gives
> the problem of the noise (no "audible" voice) that I described earlier.
>
This sounds like there is a mismatch in the data. Two suggestions.
Look at the code that implements SND_PCM_FORMAT_MU_LAW in alsa-lib
and make sure it is correct (or actually there and not a stub). See if
there is some
other parameter(s) you have to set in order for it to function.
Write the output being sent to alsa-lib to a file as you are sending it
and compare it
to the raw data you have captured that plays OK. You want it to be the
same. If it
isn't, that is your problem. If it is, the problem is in the alsa-lib
decoding for this case.
Obviously, the coding must work in some case, because you are playing the
raw data successfully. Either the application or alsa is decoding it
successfully. Compare
the successful decoding process with the unsuccessful decoding process.
next prev parent reply other threads:[~2008-07-01 13:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-30 22:09 Setting format to SND_PCM_FORMAT_MU_LAW does not let me apply hardware parameters Mitul Sen (misen)
2008-07-01 7:39 ` Clemens Ladisch
2008-07-01 17:01 ` Mitul Sen (misen)
2008-07-01 13:59 ` stan [this message]
2008-07-01 18:42 ` Mitul Sen (misen)
2008-07-01 22:12 ` stan
2008-07-01 23:50 ` Mitul Sen (misen)
2008-07-02 2:20 ` stan
2008-07-03 18:55 ` Mitul Sen (misen)
2008-07-16 23:36 ` Mitul Sen (misen)
2008-07-17 3:30 ` stan
2008-07-23 0:11 ` Mitul Sen (misen)
2008-07-23 18:25 ` stan
2008-07-23 21:31 ` Mitul Sen (misen)
2008-07-24 0:46 ` stan
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=486A384B.6090103@cox.net \
--to=ghjeold_i_mwee@cox.net \
--cc=alsa-devel@alsa-project.org \
--cc=misen@cisco.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.