LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-04-2009, 08:06 AM   #1
ganeshpetkar
LQ Newbie
 
Registered: May 2009
Posts: 1

Rep: Reputation: 0
Playing of MP3 file on freescale imx31-pdk board..


Hi all,
i m trying to play MP3 file on freescale im31-pdk board. If i use function call, Mp3 file is playing prorerly and if try to play by creating thread, i m getting the error like pool failed and write falied after the execution of snd_pcm_wait( ); and snd_pcm_writei() function.
please find sudo code below


This is for Thread...
main()
{
pthread_create(thread_ID , NULL, PlayMp3, 0 );
while(1);
}

This is for function call

main()
{
PlayMp3 (0);
while(1);
}



PlayMp3(int i);
{
alsainitlization();
while(1)
{
snd_pcm_wait (AMInst[InstID].playback_handle, -1)) < 0) {

fprintf (stderr, "poll failed (%s)\n", strerror (errno));

break;

}

MP3Decoder(OutBuf);

if ((err = snd_pcm_writei (handle,OutBuf, 4096)) < 0) {

fprintf (stderr, "write failed (%s)\n", snd_strerror (err));
}

}

}


What i m suspecting is that decoded data is not comming at right time for DMA while using thread. If use function call MP3 file is playing perfectly. Can anybody tel why this error is comming if i use thread and please give the solution for this.


Regards,
Ganesh

Last edited by ganeshpetkar; 06-08-2009 at 02:58 AM. Reason: mailto removed
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hello,, having trouble playing mp3 file in redhat 9 dneshsegar Linux - Newbie 5 07-25-2008 07:01 AM
UART driver porting from 2.4.20 to 2.6.10 for freescale imx21ADS21 board. AshishVyas Linux - Newbie 1 05-15-2008 07:30 AM
Xfree86 for IMX31/ARM11 m.harshavardhan Linux - Software 1 08-22-2006 06:09 AM
synchronized lyrics for current playing mp3 file? rlee923 General 1 04-20-2006 01:07 PM
6-channel C-Media 9739 on-board audio chip: only 2 channels playing zidour Linux - Hardware 9 05-23-2004 09:14 PM


All times are GMT -5. The time now is 08:25 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration