All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raymond <rayau@netvigator.com>
To: Dino Puller <dino@e4a.it>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Alsa mix in HW
Date: Sat, 20 Aug 2005 16:30:31 +0800	[thread overview]
Message-ID: <4306EA27.7060000@netvigator.com> (raw)
In-Reply-To: <42EBAE72.9090608@e4a.it>

Manuel Jander wrote:
> On Wed, 2005-08-17 at 19:25 +0200, Takashi Iwai wrote:
>
>>At Wed, 17 Aug 2005 12:42:26 -0400,
>>Lee Revell wrote:
>>
>>>On Wed, 2005-08-17 at 20:42 +0800, Raymond wrote:
>>>
>>>>Do anyone have a list of the sound cards ( alsa driver ) which
>>>>support the above features ?
>>>
>>>Vortex and emu10k1/2 at least...
>>
>>You can count ymfpci and trident, too.
>
>
> ESS Maestro. The 3D HRTF pipelines does not seem to be clear how they
> can be used, but AFAIK the hardware mixing and pitch programming
> should be possible.
>

Since ALSA support multiple sound cards, it is possible to use onboard
sound chip as capturing device.

Is it feasible to use one or more sound cards for playback ? (e.g. 
on-board sound chip with dmix is capable of playing stereo background 
music, or you have two sound cards which support hardware mixing)


Refer to 4.3.2 Source Attributes

Get/Set Offset

AL_SEC_OFFSET - the playback position expressed in seconds.
...
This value is based on byte position, so a pitch-shifted source will
have an exaggerated playback speed. For example you can be 0.500 seconds
into a buffer having taken only 0.250 seconds to get there if the pitch
is set to 2.0

AL_SAMPLE_OFFSET - the playback position  expressed in samples

AL_BYTE_OFFSET - the playback position, expressed in bytes.


Do "SNDRV_PCM_RATE_CONTINUOUS" in snd_hardware_t mean that sample rate 
can be any integer between .rate_min and .rate_max ?

Since changing sample rate while playing is not offically supported by
ALSA. The audio are usually play in LOOP, is it feasible to change the
sample rate at the start of each loop if doppler effect is required ?


Refer to src/alc_device.c

#define _ALC_DEF_FREQ 44100
#define _ALC_NUM_PERIODS 2
#define _ALC_BUFFER_SIZE 4096


	if (snd_pcm_hw_params_set_channels(src->handle, hw_params, 2))
		return ALC_FALSE;

	src->freq = dev->freq;
	if (snd_pcm_hw_params_set_rate_near(src->handle, hw_params, &src->freq, 0))
		return ALC_FALSE;

	src->periods = _ALC_NUM_PERIODS;
	if (snd_pcm_hw_params_set_periods_near(src->handle, hw_params, 
&src->periods,0))
		return ALC_FALSE;


	size = _ALC_BUFFER_SIZE;
	if (snd_pcm_hw_params_set_buffer_size_near(src->handle, hw_params, &size))
		return ALC_FALSE;


1) most of the audio are mono except those stereo backgroud music.
2) is there any special reason to use _near() function to set rate, 
period_size and buffer_size in that order ?






-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

  parent reply	other threads:[~2005-08-20  8:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <42EBAE72.9090608@e4a.it>
2005-08-17 12:42 ` Alsa mix in HW Raymond
2005-08-17 16:42   ` Lee Revell
2005-08-17 17:25     ` Takashi Iwai
2005-08-18  6:05       ` Manuel Jander
     [not found]         ` <43054957.1000407@netvigator.com>
2005-08-19 16:30           ` Manuel Jander
2005-08-20  8:30 ` Raymond [this message]
2005-08-22 16:41   ` Takashi Iwai
2005-08-23 15:45     ` Raymond
2005-08-23 17:14       ` Takashi Iwai
2005-08-27  2:02     ` Raymond
2005-09-02 13:07 Raymond
  -- strict thread matches above, loose matches on Subject: below --
2005-09-05  2:32 Raymond
2005-09-06  9:26 Raymond
2005-09-10  0:22 Raymond

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=4306EA27.7060000@netvigator.com \
    --to=rayau@netvigator.com \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=dino@e4a.it \
    /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.