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

 
 

sr #103088: Hardware Mixing (Multi-thread)

Submitter:  None
Submitted:  Mon 24 May 2004 09:00:15 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  2 - Minor Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code