helpThe OpenVortex Project - Support: sr #103088, Hardware Mixing (Multi-thread)

 
 

sr #103088: Hardware Mixing (Multi-thread)

Submitted by:  None
Submitted on:  Mon 24 May 2004 09:00:15 AM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 2 - MinorStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 24 May 2004 09:00:15 AM UTC, original submission:

Is there any multi-thread sample code for playing multiple sound streams using thread ?

void play_loop()
{
while () {
... read buffer from file
snd_pcm_write()
sleep(1000);
}
pthread_exit(NULL);
}

void stop_play()
{
...
pthread_join(thread);
snd_pcm_close();
}

void play_sound()
{
snd_pcm_open();
... setup access,rate,channel,period size,buffer size
snd_pcm_hw_params();
... setup threshold,...
snd_pcm_sw_params();
snd_pcm_prepare();
pthread_create(thread, NULL, play_loop,NULL);
}

EOF can be detected inside play loop, but snd_pcm_close() is never call until I press a play button to invoke stop_play.

This means that I can only play multiple sound using threads until 16 SRC are used up (snd_pcm_open return EBUSY) since snd_pcm_close is never called. I don't want to click the stop botton everytime after the sound is finished but I want to able to pause/resume/stop the sound at anytime during play.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup