All of lore.kernel.org
 help / color / mirror / Atom feed
* Selecting Audio formats
@ 2012-07-19 14:21 Harman Kalra
  2012-07-19 15:00 ` Clemens Ladisch
  0 siblings, 1 reply; 3+ messages in thread
From: Harman Kalra @ 2012-07-19 14:21 UTC (permalink / raw)
  To: alsa-devel

Hello Everybody

I am a newbie to Linux Sound Programming, so few of my queries may sound
foolish, but kindly address them.

*I want to capture a video on my beagle board Xm rev C (TI DM3730). *So as
per as the audio capturing is concerned, I am very much confused about the
audio formats, like which format should I choose to get a better sound
quality in the least possible memory requirement.

Since so many PCM formats such as S8, U8, S16_LE, U16_LE, A-law, u-law-,
IMA_ADPCM, MPEG, GSM, etc are there so which format should I opt for.

Also

   1.  What is difference between signed and unsigned PCM format, how does
   it can affect the sound quality.
   2. If I go for MPEG format, does it mean that audio compression would
   handled at my audio port level and my DSP processor would not come into
   picture.
   3. In reference to my above query i.e. 2, if audio compression is
   handled at audio port level, so at the time of audio/video sync up, how
   would be my processor be able to time sync both audio and video, since
   audio is not being compressed by the DSP.
   4. If I opt for A-law or u-law, what could be benefits/disadvantages of
   using these formats. Would the audio sample be in compressed form in this
   case, if yes, how would audio/video sync up will happen in this case.


If possible kindly provide me a link where I can find differences between
these various formats, pros and cons of each of them.

Thanks & Regards
Harman

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Selecting Audio formats
  2012-07-19 14:21 Selecting Audio formats Harman Kalra
@ 2012-07-19 15:00 ` Clemens Ladisch
       [not found]   ` <CAA4JwzW3zNOCWeFoaCSxnx8WzsQTbu1+rOuq2jFxdt043MWSaQ@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Clemens Ladisch @ 2012-07-19 15:00 UTC (permalink / raw)
  To: Harman Kalra; +Cc: alsa-devel

Harman Kalra wrote:
> Since so many PCM formats such as S8, U8, S16_LE, U16_LE, A-law, u-law-,
> IMA_ADPCM, MPEG, GSM, etc are there so which format should I opt for.

In most cases, you should use some format supported by your hardware.
Typically, this is S16.

>    1.  What is difference between signed and unsigned PCM format, how does
>    it can affect the sound quality.

It does not affect the sound quality.

>    2. If I go for MPEG format, does it mean that audio compression would
>    handled at my audio port level and my DSP processor would not come into
>    picture.

If you tried to set MPEG format, ALSA would inform you that the device
does not support this.

>    4. If I opt for A-law or u-law, what could be benefits/disadvantages of
>    using these formats.

These formats use one byte per sample, like U8, but have more dynamic
range than U8.  They are still worse than S16.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Selecting Audio formats
       [not found]   ` <CAA4JwzW3zNOCWeFoaCSxnx8WzsQTbu1+rOuq2jFxdt043MWSaQ@mail.gmail.com>
@ 2012-07-19 18:35     ` Clemens Ladisch
  0 siblings, 0 replies; 3+ messages in thread
From: Clemens Ladisch @ 2012-07-19 18:35 UTC (permalink / raw)
  To: Harman Kalra; +Cc: alsa-devel

Harman Kalra wrote:
>     Can you please explain difference between signed and unsigned PCM
> formats,

Signed PCM formats have a sign, unsigned don't.  S16 allows values in the
range -32768..32767, U16, 0..65535.

> in what cases does unsigned is used,

In practice, never.  It was historically used by some 8-bit cards.

> which is more efficient (memory and sound clarity)

I refer the honourable gentleman to the reply I gave in the last mail.

>> If you tried to set MPEG format, ALSA would inform you that the device
>> does not support this.
>
>         But when I queried the hardware regarding the supported audio
> formats using the api " snd_pcm_format_name", it responded with a list of
> formats, including , A-law, u-law-, IMA_ADPCM, MPEG, GSM, so what does it
> mean.

It means that the sample format identified by the constant
SND_PCM_FORMAT_MPEG is indeed named "MPEG".  This has nothing to do
with what formats some particular hardware supports.

>       What would be audio sample file size in case of A-law, will it be
> same as U8.

I refer the honourable gentleman to the reply I gave in the last mail.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-19 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 14:21 Selecting Audio formats Harman Kalra
2012-07-19 15:00 ` Clemens Ladisch
     [not found]   ` <CAA4JwzW3zNOCWeFoaCSxnx8WzsQTbu1+rOuq2jFxdt043MWSaQ@mail.gmail.com>
2012-07-19 18:35     ` Clemens Ladisch

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.