All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Alsa mix in HW
       [not found] <42EBAE72.9090608@e4a.it>
@ 2005-08-17 12:42 ` Raymond
  2005-08-17 16:42   ` Lee Revell
  2005-08-20  8:30 ` Raymond
  1 sibling, 1 reply; 9+ messages in thread
From: Raymond @ 2005-08-17 12:42 UTC (permalink / raw)
  To: alsa-devel; +Cc: openvortex-dev


snd_pcm_hardware_t of the sound cards will need to support

1) Hardware Mixing ( spatializing mono audio stream into 2, 4, 5.1, .. 
speakers

.channels_min  = 1
.formats =  SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U8

2) Doppler Effect ( Frequency shift by pitch )

.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000 or 
SNDRV_PCM_RATE_8000_44100

3) Recording API ( full duplex )

4) Mono/Stero Hint ( Playing stereo background music )

.channels_max >= 2

Do anyone have a list of the sound cards ( alsa driver ) which support 
the above features ?


Dino Puller wrote:

> 
> Hi all,
>    here http://dino.e4a.it/openal-alsa you can find an implementation of 
> OpenAL library that can mix sources in HW. It's based on C.J.Purnell 
> openal-alsa-emu10k1 but in this one i've replaced all code relative to 
> emu10k1 processor, with a more compatible one, so now it's should works 
> with every sound card that supports multiple sub streams. It's not based 
> on OpenAL official tree because it's play too much with conversions to a 
> canonical format of samples witch slow down any trial to mix in 
> hardware. Don't expect too much it's only a first release but it's seems 
> to works.
> 
> 
> bye,
>    Dino Puller



-------------------------------------------------------
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

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

* Re: Alsa mix in HW
       [not found]         ` <43054957.1000407@netvigator.com>
@ 2005-08-19 16:30           ` Manuel Jander
  0 siblings, 0 replies; 9+ messages in thread
From: Manuel Jander @ 2005-08-19 16:30 UTC (permalink / raw)
  To: alsa-devel

Hi,

> Refer to Section 3.4 Attenuation by Distance.
> 
> Samples usually use the entire dynamic range of the chosen
> format/encoding, independent of their real world intensity.
> ...
> The Application will then have to adjust source gain accordingly to
> account for relative differences.
> 
> Source gain is attenuated by distance.
> 
> 
> Do you know how to provide attenuation when using the hardware mixer of
> au88x0 ?  ( -48dB to +6dB )
> 
> #define MIX_DEFIGAIN 0x08
> #define MIX_DEFOGAIN 0x08       /* 0x8->6dB  (6dB = x4) 16 to 18 bit
> conversion? */
 
As AFAIK, many time ago, while translating the assembler jungle into
C, I found a function that looked like translating gain factors into
dB. The relation was a factor difference of 8 being equivalent to 6
dB. So in theory, on the aureal vortex we can change the gain of each
hardware channel knowing the relative gain in dB. Absolute gain can
never be known for sure.

The 16 hardware HRTF pipes have additional gains as part of the
processing pipelines, but they are used mainly for Interaural Level
Differences. Well, fiddling with the equalizer and Crosstalk canceller
the gain can be changed too, so there are plenty of posibilities to
change final mix gains.
 
> #define VORTEX_MIX_INVOL_B 0x20000      /* Input volume current */
> #define VORTEX_MIX_VOL_B 0x20800        /* Output Volume current */
> #define VORTEX_MIX_INVOL_A 0x21000      /* Input Volume target */
> #define VORTEX_MIX_VOL_A 0x21800        /* Output Volume target */

There are current and target settings for almost all hardware
parameters, which are intended to do automatic sliding / fading of
values. But the original drivers never did made use of this feature. I
guess because its just hard to do that, because OpenAL or whatever lib
would require to describe events of the future. In the end its easier
and less complex to just update the hardware context multiple times.
Looks like a neat idea that was thrown away afterwards.

Best Regards
Manuel


-------------------------------------------------------
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

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

* Re: Alsa mix in HW
       [not found] <42EBAE72.9090608@e4a.it>
  2005-08-17 12:42 ` Raymond
@ 2005-08-20  8:30 ` Raymond
  2005-08-22 16:41   ` Takashi Iwai
  1 sibling, 1 reply; 9+ messages in thread
From: Raymond @ 2005-08-20  8:30 UTC (permalink / raw)
  To: Dino Puller; +Cc: alsa-devel

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

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

* Re: Alsa mix in HW
  2005-08-22 16:41   ` Takashi Iwai
@ 2005-08-23 15:45     ` Raymond
  2005-08-27  2:02     ` Raymond
  1 sibling, 0 replies; 9+ messages in thread
From: Raymond @ 2005-08-23 15:45 UTC (permalink / raw)
  To: alsa-devel

Takashi Iwai wrote:
> At Sat, 20 Aug 2005 16:30:31 +0800,
> Raymond wrote:
> 
>>
>>
>>Do "SNDRV_PCM_RATE_CONTINUOUS" in snd_hardware_t mean that sample rate 
>>can be any integer between .rate_min and .rate_max ?
> 
> 
> Basically, yes.  A driver might add another restriction but in such a
> case it should use RATE_KNOT instead.
> 

Is there any quick way to check the device "hw:x,x" support
"SNDRV_PCM_RATE_CONTINUOUS" without running
snd_pcm_hw_param_test_rate() (rate_max-rate_min+1) times ?

Are the following result normal when using the following fuctions on 
device "plughw:x,x" ?

rate_min=4000 for snd_pcm_hw_params_get_rate_min()
rate_max=-1   for snd_pcm_hw_params_get_rate_max()










-------------------------------------------------------
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

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

* Re: Alsa mix in HW
  2005-08-22 16:41   ` Takashi Iwai
  2005-08-23 15:45     ` Raymond
@ 2005-08-27  2:02     ` Raymond
  1 sibling, 0 replies; 9+ messages in thread
From: Raymond @ 2005-08-27  2:02 UTC (permalink / raw)
  To: Dino Puller; +Cc: alsa-devel

Dino,

Do your sound cards has devices (snd_hardware_t) support the following
features ?

1) Hardware mixing (no. of subdevices > 1 ??? )
2) Panning mono to 2 or more speakers (.channels_min = 1 and pcm 
volume/panning control for each subdevice)
3) Playback 8/16 bits mono/stereo audio (.format )
3) Doppler Effect (.rate = SNDRV_PCM_RATE_CONTINUOUS )
4) Recording API (capture 8/16 bits mono/stereo audio)
5) Background music (.channels_max >= 2 )


Valid Formats are AL_FORMAT_MONO8, AL_FORMAT_MONO16, AL_FORMAT_STEREO8
and AL_FORMAT_STEREO16.

Refer to alsa-lib/include/pcm.h

	/** Signed 8 bit */
	SND_PCM_FORMAT_S8 = 0,
	/** Unsigned 8 bit */
	SND_PCM_FORMAT_U8,
	/** Signed 16 bit Little Endian */
	SND_PCM_FORMAT_S16_LE,
	/** Signed 16 bit Big Endian */
	SND_PCM_FORMAT_S16_BE,
	/** Unsigned 16 bit Little Endian */
	SND_PCM_FORMAT_U16_LE,
	/** Unsigned 16 bit Big Endian */
	SND_PCM_FORMAT_U16_BE,

Is the audio data stored in the alBuffer signed or unsigned ?


Takashi Iwai wrote:
> At Sat, 20 Aug 2005 16:30:31 +0800,
> Raymond wrote:
> 
>>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)
> 
> 
> It's feasible via alsa-lib multi plugin.
> 
> 
>>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 ?
> 
> 
> Basically, yes.  A driver might add another restriction but in such a
> case it should use RATE_KNOT instead.
> 
> 
>>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 ?
> 
> 
> Changing the rate during the DMA is running is not officially
> supported.  This reads: you have to stop the stream once to change the
> parameter.  This isn't what you want, I guess.
> 

Any significant change of frequency shift which can be detected by the 
human ears. ( e.g. listener/source accelerate/decelerate or change 
direction )

Refer to 3.5.2 Velocity dependent Doppler Effect.

The doppler effect will depends on
1) Source velocity
2) Listener velocity
3) AL_SPEED_OF_SOUND (speed of the sound in medium, default value 343.3)
4) AL_DOPPLER_FACTOR (zero = disable doppler effect, default 1.0)


Any sound card (alsa-driver) can produce doppler effect using special
device/synth device other than changing sample rate ?

> 
> 
>>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;
>>

Refer to 5.3.4 Specifying Buffer Content

Buffer contains audio with more than one channels will be played with 3D
spatialization features - these formats are normally used for background
music.

This means alcOpenDevice will base on the channels of the audio to find
the suitable device from the available sound cards.

The structure AL_source should contain format/channels of the audio and
device/subdevice or "device name" to allow sound card use different
devices to handle mono stream for 3D spatialization and the background 
music.

There is no existing ALSA-LIB functions which can set the pcm volume 
control of the subdevice to the speakers for all sound cards.

Each device of different sound cards may have different kcontrols to 
change left/right volume , front/rear volume, reverb, delay, ...

What is the best/fast method to identify the devices of different sound 
cards in order to call the hardware depdendent routine ?

const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);


>>	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 ?
> 
> 
> The requested rate isn't supported always.

These should not be a problem if the device support 
SNDRV_PCM_RATE_CONTINUOUS.

Is there any software SRC ALSA plugin ?

> 
> The order of hw_params calls may influence the resultant parameters.
> Especially, the parameters for period and buffer sizes are very
> sensitive.
> 
> Usually, the order of period_size -> buffer_size is more stable than
> buffer_size -> period_size.
> 

Do any devices of the sound cards in the above list require a special 
period_size/buffer_size to produce special effect ?

>>Are the following result normal when using the following fuctions on
>>device "plughw:x,x" ?
>>
>>rate_min=4000 for snd_pcm_hw_params_get_rate_min()
>>rate_max=-1   for snd_pcm_hw_params_get_rate_max()
>
>
> Judging the plug layer from such values is not recommended at all.
> If you want to skip the software SRC, set 0 to
> snd_pcm_hw_params_set_rate_resample().
>

The OpenAL 1.1 specification do not have restriction on frequency and
format when capturing audio.

Do ALSA support rate_resample/reformat when using "plughw:0,0" to 
capture 8/16 bits mono/stereo audio ?






-------------------------------------------------------
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

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

* Re: Alsa mix in HW
@ 2005-09-02 13:07 Raymond
  0 siblings, 0 replies; 9+ messages in thread
From: Raymond @ 2005-09-02 13:07 UTC (permalink / raw)
  To: alsa-devel; +Cc: Dino Puller, Lee Revell, Takashi Iwai, Manuel Jander

> Dino wrote:
>> Raymond wrote:
>>
>> Dino,
>>
>> Do your sound cards has devices (snd_hardware_t) support the
>> following  features ?
>>
> I've got an Hercules Fortissimo II (cs46xx)

>> 1) Hardware mixing (no. of subdevices > 1 ??? )

> Yes 31 subdevices

>> 2) Panning mono to 2 or more speakers (.channels_min = 1 and pcm
>> volume/panning control for each subdevice)

> Nope i'm working on volume control per voice but i need more help from
> alsa developers. I can access to each volume control but when i change
> the volume the bass are cutting off and i don't know why :(

The patch for the volume control per voice of au88x0 has just been sent
to openvortex for review. For attenutation by distance, what dB range
can be provided by the volume control of cs46xx ?

16-bits audio data need gain when passing through cs46xx to
18-bits/20-bits DAC of AC97

Does anyone know the dB_to_volume conversion forumla of those pcm volume
control of trident, ymfpci, maestro3, emu10k1 ?

>> 3) Playback 8/16 bits mono/stereo audio (.format )

> Yep

>> Valid Formats are AL_FORMAT_MONO8, AL_FORMAT_MONO16,
>> AL_FORMAT_STEREO8  and AL_FORMAT_STEREO16.

Although cs46xx and trident support S8 ,U8, S16 and U16.

ymfpci, au88x0, maestro3 and emu10k1 only support U8 snd S16

It would be better to store audio in U8 and S16.

The structure AL_source should contain format/channels of the audio to
mono stream for 3D spatialization and the background music.

THe au88x0 driver may use different devices to spatialize mono audio
and stereo background music.

>> 3) Doppler Effect (.rate = SNDRV_PCM_RATE_CONTINUOUS )

> Nope but i souldn't spent too much time for this issue. Pitch shifting
> cost us only 1 addiction in floating point for each word.

Do cs46xx have hardware to perform pitch shift ?

>> 4) Recording API (capture 8/16 bits mono/stereo audio)

> Yep but openal-alsa doesn't support it yet

Do the alsa driver (.info = SNDRV_PCM_INFO_PAUSE) 
snd_pcm_hw_params_can_pause() perform the alcCaptureStop() by calling 
snd_pcm_pause(pcm, 1) and restart by calling snd_pcm_pause(pcm, 0) 
without calling snd_pcm_close() ?

Capture audio

If the application doesn't need to capture audio for an amount of time,
they can halt the device without closing it via the alCaptureStop entry
point.

The implementation is encouraged to optimize for this case. The amount
of audio samples available after restarting a stopped capture device is
reset to zero. The application does not need to stop the capture device
to read from it.

>> 5) Background music (.channels_max >= 2 )

> Yes

>>
>>
>> Valid Formats are AL_FORMAT_MONO8, AL_FORMAT_MONO16,
>> AL_FORMAT_STEREO8  and AL_FORMAT_STEREO16.
>>
>> Refer to alsa-lib/include/pcm.h
>>
>> /** Signed 8 bit */
>> SND_PCM_FORMAT_S8 = 0,
>> /** Unsigned 8 bit */
>> SND_PCM_FORMAT_U8,
>> /** Signed 16 bit Little Endian */
>> SND_PCM_FORMAT_S16_LE,
>> /** Signed 16 bit Big Endian */
>> SND_PCM_FORMAT_S16_BE,
>> /** Unsigned 16 bit Little Endian */
>> SND_PCM_FORMAT_U16_LE,
>> /** Unsigned 16 bit Big Endian */
>> SND_PCM_FORMAT_U16_BE,
>>
>> Is the audio data stored in the alBuffer signed or unsigned ?

> Is 16bit(also for 8bit wave) signed.

Do the audio convert to U8 and S16 in alutLoadWav?

> But openal-alsa works for you? Did you noticed a system improvement?
> I've obtained 2fps in ut2004 about 5% not bad :)

NO,  I cannot link any demo using the re-compiled openal-alsa library.

> bye,
> Dino









-------------------------------------------------------
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

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

* Re: Alsa mix in HW
@ 2005-09-05  2:32 Raymond
  0 siblings, 0 replies; 9+ messages in thread
From: Raymond @ 2005-09-05  2:32 UTC (permalink / raw)
  To: alsa-devel; +Cc: Dino Puller

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

How can I link the demo.cpp (a simple openal/opengl program) with the 
openal-alsa ? (It can be executed when link with openal)

The demo.cpp is not yet completed and seem to have a bug in the 
positioning of Camera.

The Radar (The Cone) are rotated at the base instead of the vortex.


> Dino wrote:

>> Raymond wrote:
>
> >> Dino wrote:
> >>
> >
> >> But openal-alsa works for you? Did you noticed a system improvement?
> >> I've obtained 2fps in ut2004 about 5% not bad :)
> >
> >
> > NO,  I cannot link any demo using the re-compiled openal-alsa library.
>
> Why? Can you give me an output? I've tried with americas army e some
> stupids examples without problem, obviuslly it's not a complete library.
>
> >
> >> bye,
> >> Dino
> >
>



[-- Attachment #2: demo.cpp --]
[-- Type: text/x-c++, Size: 13662 bytes --]

/**********************************************************************
	
  DEMO  OpenGL/OpenAL (3D Spatalization)

  Listener (OpenAL) - Camera (OpenGL)
  Source Helicopter - rotating about the origin.
  Source Radar      - rotating along z-axis
  Source Van        - Moving on xy plane 

  FIX ME
  1) The movment of camera seem to be wrong. 
  2) The Radar should rotate at the vertex instead of the base 

  TO DO
  1) Add control to adjust height, path and speed of the Helicopter.
  2) Add control to adjust the cone of inner/outer angle of the Radar.
  3) use joystick to move listener/camera
  4) make it conformed to OpenAL 1.1 specification.

  Function:- 
  1) Attenutation By Distance
  2) Panning Left/Right 
  3) Doppler Effect (Not completed) 
  4) Angle of Cone (Not completed)
  5) Background Music (Not yet implemented)

***********************************************************************/
#include <GL/glut.h>
#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alut.h>
#include <iostream>
#include <math.h>
#include <sys/timeb.h>

#define PI 3.1415265359
#define PIdiv180 3.1415265359/180.0

int LastUpdate=0;

int GetTime()
{
	timeb t;

	ftime(&t);

	return 1000 * t.time + t.millitm;
}

void OnIdle()
{
	static int nLastTime = GetTime();
	static int nFrameCount = 0;

	if (nFrameCount++ == 100)
	{
		float fFPS = 100000.0f/static_cast<float>(GetTime() - nLastTime);
		char Title[256];

		sprintf(Title, "Demo 3D - %.2f FPS", fFPS);
		glutSetWindowTitle(Title);

		nFrameCount = 0;
		nLastTime = GetTime();
	}

	glutPostRedisplay();
}

struct SF3dVector  
{
	GLfloat x,y,z;
};
struct SF2dVector
{
	GLfloat x,y;
};

class CCamera
{
private:
	SF3dVector Position;
	SF3dVector ViewDir;		
	bool ViewDirChanged;
	GLfloat RotatedX, RotatedY, RotatedZ;	
	void GetViewDir ( void );
public:
	CCamera();		
	void Render ( void );	
				
	void Move ( SF3dVector Direction );
	void RotateX ( GLfloat Angle );
	void RotateY ( GLfloat Angle );
	void RotateZ ( GLfloat Angle );
	void RotateXYZ ( SF3dVector Angles );
	void MoveForwards ( GLfloat Distance );
	void StrafeRight ( GLfloat Distance );
};

CCamera Camera;

#define NUM_BUFFERS 5
#define NUM_SOURCES 5
#define NUM_ENVIRONMENTS 1

ALfloat listenerPos[3];
ALfloat listenerVel[3]={0.0,0.0,0.0};
ALfloat	listenerOri[]={0.0,0.0,0.0, 1.0, 0.0,0.0};

struct {
	ALfloat Pos[3];
	ALfloat Vel[3];
	ALfloat rgb[3];
	ALfloat polar_distance,angle;
        ALboolean playing;
} source_3d[NUM_SOURCES];

ALuint	buffer[NUM_BUFFERS];
ALuint	source[NUM_SOURCES];
ALuint  environment[NUM_ENVIRONMENTS];
int 	GLwin;

void set_listener_pos(ALfloat x,ALfloat y,ALfloat z)
{
	listenerPos[0]=x;
	listenerPos[1]=y;
	listenerPos[2]=z;
	alListenerfv(AL_POSITION,listenerPos);
}

void set_source_pos(int idx,ALfloat x,ALfloat y,ALfloat z)
{
	source_3d[idx].Pos[0]=x;
	source_3d[idx].Pos[1]=y;
	source_3d[idx].Pos[2]=z;
}

void set_source_vel(int idx,ALfloat x,ALfloat y,ALfloat z)
{
	source_3d[idx].Vel[0]=x;
	source_3d[idx].Vel[1]=y;
	source_3d[idx].Vel[2]=z;
}

void set_source_rgb(int idx,ALfloat r,ALfloat g,ALfloat b)
{
	source_3d[idx].rgb[0]=r;
	source_3d[idx].rgb[1]=g;
	source_3d[idx].rgb[2]=b;
}

SF3dVector F3dVector ( GLfloat x, GLfloat y, GLfloat z )
{
	SF3dVector tmp;
	tmp.x = x;
	tmp.y = y;
	tmp.z = z;
	return tmp;
}
SF3dVector AddF3dVectors (SF3dVector* u, SF3dVector* v)
{
	SF3dVector result;
	result.x = u->x + v->x;
	result.y = u->y + v->y;
	result.z = u->z + v->z;
	return result;
}
void AddF3dVectorToVector ( SF3dVector * Dst, SF3dVector * V2)
{
	Dst->x += V2->x;
	Dst->y += V2->y;
	Dst->z += V2->z;
}

/***************************************************************************************/

CCamera::CCamera()
{
	//Init with standard OGL values:
	Position = F3dVector (	0.0, 2.0, 0.0);
	set_listener_pos(Position.x,Position.y,Position.z);
	ViewDir = F3dVector( 0.0, -1.0, 0.0);
	ViewDirChanged = true;
	//Only to be sure:
	RotatedX = RotatedY = RotatedZ = 0.0;
}

void CCamera::GetViewDir( void )
{
	SF3dVector Step1, Step2;
	//Rotate around Y-axis:
	Step1.x = cos( (RotatedY + 90.0) * PIdiv180);
	Step1.z = -sin( (RotatedY + 90.0) * PIdiv180);
	//Rotate around X-axis:
	double cosX = cos (RotatedX * PIdiv180);
	Step2.x = Step1.x * cosX;
	Step2.z = Step1.z * cosX;
	Step2.y = sin(RotatedX * PIdiv180);
	//Rotation around Z-axis not yet implemented, so:
	ViewDir = Step2;
}

void CCamera::Move (SF3dVector Direction)
{
	AddF3dVectorToVector(&Position, &Direction );
}


void CCamera::RotateZ (GLfloat Angle)
{
	RotatedZ += Angle;
	ViewDirChanged = true;
}

void CCamera::RotateY (GLfloat Angle)
{
	RotatedY += Angle;
	ViewDirChanged = true;
}

void CCamera::RotateX (GLfloat Angle)
{
	RotatedX += Angle;
	ViewDirChanged = true;
}

void CCamera::Render( void )
{
	glRotatef(-RotatedX , 1.0, 0.0, 0.0);
	glRotatef(-RotatedY , 0.0, 1.0, 0.0);
	glRotatef(-RotatedZ , 0.0, 0.0, 1.0);
	glTranslatef( -Position.x, -Position.y, -Position.z );
}

void CCamera::MoveForwards( GLfloat Distance )
{
	if (ViewDirChanged) GetViewDir();
	SF3dVector MoveVector;
	MoveVector.x = ViewDir.x * -Distance;
	MoveVector.y = ViewDir.y * -Distance;
	MoveVector.z = ViewDir.z * -Distance;
	AddF3dVectorToVector(&Position, &MoveVector );
	set_listener_pos(Position.x,Position.y,Position.z);
}

void CCamera::StrafeRight ( GLfloat Distance )
{
	if (ViewDirChanged) GetViewDir();
	SF3dVector MoveVector;
	MoveVector.y = -ViewDir.x * -Distance;
	MoveVector.x =  ViewDir.y * -Distance;
	MoveVector.z = 0.0;
	AddF3dVectorToVector(&Position, &MoveVector );
}

void reshape(int x, int y)
{
	if (y == 0 || x == 0) return;  
	
	//Set a new projection matrix
	glMatrixMode(GL_PROJECTION);  
	glLoadIdentity();
	//Angle of view:40 degrees
	//Near clipping plane distance: 0.5
	//Far clipping plane distance: 20.0
	gluPerspective(40.0,(GLdouble)x/(GLdouble)y,0.1, 100.0);

	glMatrixMode(GL_MODELVIEW);
	glViewport(0,0,x,y);  
}

void Display(void)
{
	int i;
	ALfloat direction[3];
	GLfloat polar_distance,polar_angle;
	glClear(GL_COLOR_BUFFER_BIT);
	glLoadIdentity();
	Camera.Render();
	glRotatef(-90.0, 1.0, 0.0, 0.0);

	glTranslatef(0.0, 8.0 , 1.0);
	glScalef(1.0,1.0,1.0);

/*
	Draw reference plane
*/	
	
	glColor3f(1.0,1.0,1.0);
	glPushMatrix();
	glTranslatef(0.0, 0.0 ,0.0);
	glBegin(GL_LINES);
	for (int xc = 0; xc <= 100; xc++) {
	    	glVertex3f( -50.0 + xc ,  50.0, 0.0);
	    	glVertex3f( -50.0 + xc , -50.0, 0.0);
        }
	for (int yc = 0; yc <= 100; yc++) {
		glVertex3f(  50.0, -50.0 + yc, 0.0 );
		glVertex3f( -50.0, -50.0 + yc, 0.0 );
	}
	glEnd();
	glPopMatrix();

	if ( LastUpdate != 0 ) {
		float fSecs = static_cast<float>(GetTime() - LastUpdate)/1000.0;
/*
        Calculation of 3D position of the sound source 
	Helicopter - circular path around the origin
        Radar      - rotate around the origin
        Van        - moving headon to listener 
                   - moving left/right in front of listener
                   - path around the origin

*/
	        source_3d[0].angle+= fSecs;
                if ( source_3d[0].angle > 360.0 )
			source_3d[0].angle -= 360.0;
		
		source_3d[1].angle -= fSecs*100.0;
		if ( source_3d[1].angle < -360.0 )
			source_3d[1].angle += 360.0;
	
                source_3d[2].Pos[1] += source_3d[2].Vel[1] * fSecs;	
		if ( source_3d[2].Pos[1] < -99.0 ) {
		     source_3d[2].Pos[1] =  99.0;
		};

		source_3d[3].Pos[0]+= source_3d[3].Vel[0] * fSecs;
		if ( fabs(source_3d[3].Pos[0]) > 101.0 ) {
		    if ( source_3d[3].Pos[0] > 0.0 )
                         source_3d[3].Vel[0] = -fabs(source_3d[3].Vel[0]);
		    else
		         source_3d[3].Vel[0] = fabs(source_3d[3].Vel[0]);
	        };

	        source_3d[4].angle -= fSecs * 0.01;
                if ( source_3d[4].angle < -360.0 )
			source_3d[4].angle += 360.0;

	};
	LastUpdate = GetTime();

	for (i=0; i<NUM_SOURCES; i++) {
		switch(i){
		case 0:
		    polar_distance=source_3d[i].polar_distance;
		    source_3d[i].Pos[0]=polar_distance*sin(source_3d[i].angle);
		    source_3d[i].Pos[1]=polar_distance*cos(source_3d[i].angle);
		    alSourcefv(source[i],AL_POSITION,source_3d[i].Pos);
		    break;
		case 1:
		    direction[0]=sin(source_3d[i].angle);
		    direction[1]=cos(source_3d[i].angle);
		    direction[2]=0.0;
		    alSourcefv(source[i],AL_DIRECTION,direction);
		    break;
		case 2:
		case 3:
		    alSourcefv(source[i],AL_POSITION,source_3d[i].Pos);
		    alSourcefv(source[i],AL_VELOCITY,source_3d[i].Vel);
		    break;
		case 4:
		    polar_angle=source_3d[i].angle;
		    source_3d[i].Pos[0]= 200.0*sin(polar_angle)*sin(polar_angle*2)*sin(polar_angle*4)*sin(polar_angle*8)*sin(polar_angle*16);
		    source_3d[i].Pos[1]= 200.0*cos(polar_angle)*cos(polar_angle*2)*cos(polar_angle*4)*cos(polar_angle*8)*cos(polar_angle*16);
		    alSourcefv(source[i],AL_POSITION,source_3d[i].Pos);
		    break;
		};
/*
	Draw sound sources
*/
		glPushMatrix() ;
		glTranslatef(source_3d[i].Pos[0],source_3d[i].Pos[1],source_3d[i].Pos[2]) ;
		glColor3f(source_3d[i].rgb[0],source_3d[i].rgb[1],source_3d[i].rgb[2]) ;
		switch(i){
/*
	Helicopter
*/
		case 0:
			if ( source_3d[i].playing )
				glutSolidSphere(0.5,3,3) ;
			else
				glutWireSphere(0.5,3,3) ;
			glTranslatef(0.0,0.0,0.5) ;
			glutWireCone(1.0,0.01, 16 ,0);
			break;
/*
	Radar
*/
		case 1:
			polar_angle=source_3d[i].angle;
			polar_distance=source_3d[i].polar_distance;
			glRotatef(90.0, 1.0, 0.0, 0.0) ;
			glRotatef(polar_angle,0.0, 1.0, 0.0) ;
//			if ( source_3d[i].playing )
//				glutSolidCone(polar_distance,1.0,6,0);
//			else				
				glutWireCone(polar_distance,1.0,6,0);
			break;
/*
	Van
*/
		case 2:
		case 3:
		case 4:
			if ( source_3d[i].playing )
				glutSolidCube(0.5) ;
			else
				glutWireCube(0.5) ;
			break;
		};
		glPopMatrix() ;
	};
 	

	glFlush();  
	glutSwapBuffers();

}
/*

ESC	: exit
1,2,3,4 : toggle on/off sound sources

*/
void cbKeyPressed(unsigned char key, int x, int y)
{
	int i;
	switch (key) {
	case '1':
	case '2':
	case '3':
	case '4':
		i=key-'1';
		if ( source_3d[i].playing ) {
			alSourceStop(source[i]);
			source_3d[i].playing=false;
		}
		else {
			alSourcePlay(source[i]);
			source_3d[i].playing=true;
		};
		break;
	case 27:		//ESC
		glutDestroyWindow(GLwin);
		exit(0);
		break;
	}
}

void cbSpecialKeyPressed(int key, int x, int y)
{
	switch(key) {
	case GLUT_KEY_F1:
		Camera.Move(F3dVector(0.0,-0.3,0));
		Display();
		break;
	case GLUT_KEY_F2:
		Camera.Move(F3dVector(0.0,0.3,0.0));
		Display();
		break;
        case GLUT_KEY_RIGHT:	
		Camera.RotateY(-5.0);
		Display();
                break;
        case GLUT_KEY_LEFT: 	
		Camera.RotateY(5.0);
		Display();
                break;
        case GLUT_KEY_UP: 	
		Camera.MoveForwards( -0.1 ) ;
		Display();
                break;
        case GLUT_KEY_DOWN: 	
		Camera.MoveForwards( 0.1 ) ;
		Display();
                break;
    	}
}

void init_al(void)
{
	ALsizei size,freq;
	ALenum 	format;
	ALvoid 	*data;
    	ALboolean loop;
	int 	ch;
    	int 	i;
    	
	alutInit(0, NULL);

	alListenerfv(AL_POSITION,listenerPos);
	alListenerfv(AL_VELOCITY,listenerVel);
	alListenerfv(AL_ORIENTATION,listenerOri);

	source_3d[0].polar_distance= 10.0;
	set_source_pos(0, source_3d[0].polar_distance, 0.0, 2.0);
	set_source_vel(0, 0.0, 0.1, 0.0);
	set_source_rgb(0, 0.0, 1.0, 1.0);

	source_3d[1].polar_distance=0.4;
	set_source_pos(1, 0.0, 0.0, 2.0);
	set_source_vel(1, 0.0, 0.0, 0.0);
	set_source_rgb(1, 1.0, 1.0, 0.0);

	set_source_pos(2, 0.0,  50.0,  0.0);
	set_source_vel(2, 0.0,  -5.0,  0.0);
	set_source_rgb(2, 1.0,   0.0,  0.0);

	set_source_pos(3,-20.0, 0.0, 0.0);
	set_source_vel(3, 7.0, 0.0, 0.0);
	set_source_rgb(3, 0.0,  1.0, 0.0);

	source_3d[4].polar_distance= 40.0;
	set_source_pos(4, 0.0, 0.0, 0.0);
	set_source_vel(4, 0.0, 0.0, 0.0);
	set_source_rgb(4, 0.0, 0.0, 1.0);

    	alGetError(); // clear any error messages
    
	if(alGetError() != AL_NO_ERROR) {
	        printf("- Error creating buffers !!\n");
	};
    
     	alGenBuffers(NUM_BUFFERS, buffer);

	loop=AL_TRUE;
    
	for (i=0; i<NUM_SOURCES; i++) {
		switch(i) {
		case 0:
			alutLoadWAVFile((ALbyte*)"heli.wav",&format,&data,&size,&freq,&loop);
			break;
		case 1:
			alutLoadWAVFile((ALbyte*)"radar.wav",&format,&data,&size,&freq,&loop);
			break;	
		case 2:
			alutLoadWAVFile((ALbyte*)"van.wav",&format,&data,&size,&freq,&loop);
			break;
		case 3:
			alutLoadWAVFile((ALbyte*)"van.wav",&format,&data,&size,&freq,&loop);
			break;
		case 4:
			alutLoadWAVFile((ALbyte*)"van.wav",&format,&data,&size,&freq,&loop);
			break;
		};
    		alBufferData(buffer[i],format,data,size,freq);
    		alutUnloadWAV(format,data,size,freq);
	};

	alGetError(); /* clear error */
    	alGenSources(NUM_SOURCES, source);

    	if(alGetError() != AL_NO_ERROR) {
		printf("- Error creating sources !!\n");
	};
	for (i=0; i<NUM_SOURCES; i++) {
	    alSourcef(source[i],AL_PITCH,1.0f);
	    alSourcef(source[i],AL_GAIN,1.0f);
	    alSourcefv(source[i],AL_POSITION,source_3d[i].Pos);
	    alSourcefv(source[i],AL_VELOCITY,source_3d[i].Vel);
	    alSourcei(source[i],AL_BUFFER,buffer[i]);
	    alSourcei(source[i],AL_LOOPING,AL_TRUE);
	    source_3d[i].playing=true;
	    alSourcePlay(source[i]);
	};

	alSourcef(source[1],AL_CONE_INNER_ANGLE, 90.0);
	alSourcef(source[1],AL_CONE_OUTER_ANGLE, 180.0);


}

int main(int argc, char **argv)
{
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
	glutInitWindowSize(640,400);

	init_al() ;

	GLwin=glutCreateWindow("Demo 3D Sound");

//	Camera.Move( F3dVector(0.0, 1.0, 0.0 ));
//	Camera.MoveForwards( -2.0 );
	glutDisplayFunc(Display);
	glutReshapeFunc(reshape);
	glutKeyboardFunc(&cbKeyPressed);
        glutSpecialFunc(&cbSpecialKeyPressed);
	glutIdleFunc(OnIdle);
	glutMainLoop();
	return 0;             
}

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

* Re: Alsa mix in HW
@ 2005-09-06  9:26 Raymond
  0 siblings, 0 replies; 9+ messages in thread
From: Raymond @ 2005-09-06  9:26 UTC (permalink / raw)
  To: Dino Puller; +Cc: alsa-devel

Dino wrote:

 > Raymond wrote:
 >
 > > How can I link the demo.cpp (a simple openal/opengl program) with the
 > > openal-alsa ? (It can be executed when link with openal)
 >
 > No problem here for compile/linking, i've attached a simple tested
 > Makefile, i used dynamic library with the name: libopenal.so.0   . If
 > you have problem tell me.
 >
 > CC = g++
 >
 > TARGET = lesson3
 >
 > COMPILEFLAGS =  -g
 > LIBS = -lopenal -lglut
 > INC = -I../../include
 >
 > $(TARGET): demo.o
 > $(CC) -o $(TARGET) demo.o  $(COMPILEFLAGS) $(LIBS) $(INC)
 >
 > demo.o: demo.cpp
 > $(CC) -c demo.cpp -Wno-deprecated
 >
 > clean:
 > rm -f $(TARGET) demo.o

It seem to me that your Makefile is wrong.

$(COMPILEFLAGS) and $(INC) should be in $(CC) -c demo.cpp


# demo]# make
Makefile:10: *** missing separator.  Stop.


Have you run the demo when linked with openal-alsa ?

Is there any gain in FPS when using openal-alsa ?








-------------------------------------------------------
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

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

* Re: Alsa mix in HW
@ 2005-09-10  0:22 Raymond
  0 siblings, 0 replies; 9+ messages in thread
From: Raymond @ 2005-09-10  0:22 UTC (permalink / raw)
  To: Dino Puller; +Cc: alsa-devel


Dino wrote:

> Raymond wrote:
>
> > Dino wrote:
> >
> > > Raymond wrote:
> > >
> > > > How can I link the demo.cpp (a simple openal/opengl program) 
with the
> > > > openal-alsa ? (It can be executed when link with openal)
> > >
> > > No problem here for compile/linking, i've attached a simple tested
> > > Makefile, i used dynamic library with the name: libopenal.so.0 . If
> > > you have problem tell me.
> > >
> > > CC = g++
> > >
> > > TARGET = lesson3
> > >
> > > COMPILEFLAGS = -g
> > > LIBS = -lopenal -lglut
> > > INC = -I../../include
> > >
> > > $(TARGET): demo.o
> > > $(CC) -o $(TARGET) demo.o $(COMPILEFLAGS) $(LIBS) $(INC)
> > >
> > > demo.o: demo.cpp
> > > $(CC) -c demo.cpp -Wno-deprecated
> > >
> > > clean:
> > > rm -f $(TARGET) demo.o
> >
> > It seem to me that your Makefile is wrong.
> >
> > $(COMPILEFLAGS) and $(INC) should be in $(CC) -c demo.cpp
> >
> >
> > # demo]# make
> > Makefile:10: *** missing separator. Stop.
>
> Yes, but now it compile for you?
>

NO. :(

I don't know how to fix your Makefile

Just change my Makefile

-I/openal-alsa/include
-L/openal-alsa/src

cp libopenal.a /usr/local/lib
cp libopenal.so.0.1.3 /usr/local/lib
ln libopenal.so.0.1.3 /usr/local/lib/libopenal.so.0

demo]#  ./demo
demo: mask_inline.h:160: snd_mask_leave: Assertion `val <= 64' failed.
Aborted


I have no idea the bug is caused by linking wrong library, it is rather 
diffcult to find out the problem when using strace ?

demo]# strace ./demo

...

open("/dev/js0", O_RDONLY)              = 4
ioctl(4, JSIOCGAXES, 0x8c0d1c4)         = 0
ioctl(4, JSIOCGBUTTONS, 0x8c0d1c8)      = 0
fcntl64(4, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=7467, 
...}) = 0
open("/usr/share/alsa/alsa.conf", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=7467, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xbf58d000
read(5, "#\n#  ALSA library configuration "..., 4096) = 4096
read(5, "if cards.pcm.iec958\npcm.modem ca"..., 4096) = 3371
read(5, "", 4096)                       = 0
read(5, "", 4096)                       = 0
close(5)                                = 0
munmap(0xbf58d000, 4096)                = 0
futex(0x852f70, FUTEX_WAKE, 2147483647) = 0
access("/etc/asound.conf", R_OK)        = -1 ENOENT (No such file or 
directory)
access("/xxxx/.asoundrc", R_OK)         = -1 ENOENT (No such file or 
directory)
open("/dev/snd/controlC0", O_RDONLY)    = 5
close(5)                                = 0
open("/dev/snd/controlC0", O_RDWR)      = 5
ioctl(5, USBDEVFS_CONTROL, 0xbffa48a4)  = 0
stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=7467, 
...}) = 0
open("/dev/snd/controlC0", O_RDONLY)    = 6
close(6)                                = 0
open("/dev/snd/controlC0", O_RDWR)      = 6
ioctl(6, USBDEVFS_CONTROL, 0xbffa46d8)  = 0
ioctl(6, 0x40045532, 0xbffa4700)        = 0
open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = 7
close(6)                                = 0
ioctl(7, AGPIOC_ACQUIRE or APM_IOC_STANDBY, 0xbffa45cc) = 0
fcntl64(7, F_GETFL)                     = 0x802 (flags O_RDWR|O_NONBLOCK)
ioctl(7, AGPIOC_INFO, 0xbffa45c8)       = 0
ioctl(7, AGPIOC_RELEASE or APM_IOC_SUSPEND, 0xbffa45c4) = 0
mmap2(NULL, 4096, PROT_READ, MAP_SHARED, 7, 0x80000) = 0xbf58d000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 7, 0x81000) = 0xbf58c000
ioctl(7, 0xc25c4110, 0xbffa47b0)        = 0
ioctl(7, 0xc25c4110, 0xbffa47b0)        = 0
write(2, "demo: mask_inline.h:160: snd_mas"..., 71demo: 
mask_inline.h:160: snd_mask_leave: Assertion `val <= 64' failed.
) = 71
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(4738, 4738, SIGABRT)             = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++


> >
> >
> > Have you run the demo when linked with openal-alsa ?
>
> Of course, can you send me your wav?
>

According to the specification, you can use any MONO (8bits/16bits) wav.

The sample rate of audio of those moving objects need to be half of 
44100Hz/48000Hz, this allow the soundcard playback the audio at
higher/lower rate to perform pitch shifting











-------------------------------------------------------
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

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

end of thread, other threads:[~2005-09-10  0:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-06  9:26 Alsa mix in HW Raymond
  -- strict thread matches above, loose matches on Subject: below --
2005-09-10  0:22 Raymond
2005-09-05  2:32 Raymond
2005-09-02 13:07 Raymond
     [not found] <42EBAE72.9090608@e4a.it>
2005-08-17 12:42 ` 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
2005-08-22 16:41   ` Takashi Iwai
2005-08-23 15:45     ` Raymond
2005-08-27  2:02     ` Raymond

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.