LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-13-2009, 07:16 AM   #1
thilaga
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Rep: Reputation: 0
SDL_CDPlaytracks problem


Hi,

I have written a code to play audio from CD ROM using SDL guide.
It is giving track info of the CD, ejecting the CD through the code, but it is not playing the audio.

When the function SDL_CDPlaytracks is called, it returns the status as success, but I am not able to hear the audio whereas audio is heard when I try to play through the default player. For eg. Totem movie player.

Can anyone let me know why I am not able to hear the sound through SDL_CDPlaytracks().

Thanks for your help.

Best Regards,
Thilaga
 
Old 06-05-2010, 01:50 PM   #2
mliberi
LQ Newbie
 
Registered: Jun 2010
Location: italy
Distribution: slackware
Posts: 3

Rep: Reputation: 0
exactly the same

Quote:
Originally Posted by thilaga View Post
Hi,

I have written a code to play audio from CD ROM using SDL guide.
It is giving track info of the CD, ejecting the CD through the code, but it is not playing the audio.

When the function SDL_CDPlaytracks is called, it returns the status as success, but I am not able to hear the audio whereas audio is heard when I try to play through the default player. For eg. Totem movie player.

Can anyone let me know why I am not able to hear the sound through SDL_CDPlaytracks().

Thanks for your help.

Best Regards,
Thilaga
Did you understand why all works fine, but no audible sound comes? I had exactly the same problem...
 
Old 06-06-2010, 11:44 PM   #3
thilaga
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
I stopped that work. Please let me know if you get any solution.
 
Old 06-08-2010, 02:10 AM   #4
mliberi
LQ Newbie
 
Registered: Jun 2010
Location: italy
Distribution: slackware
Posts: 3

Rep: Reputation: 0
yes, I understand why it "works" but no audible sound is heard...

SDL_PlayTracks uses CD analog play, it works only if a cable connecting the CD player to the "CD" input of sound card is present.

Some soundcards (that's my case) don't have such an input, so the cable isn't obviously connected.

You can check if the soundcard has CD input with a mixer (e.g. aumix). In order to hear something it shouldn't be muted and volume greater than zero. That's all.

happy programming...
 
Old 06-08-2010, 07:11 AM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by mliberi View Post
yes, I understand why it "works" but no audible sound is heard...

SDL_PlayTracks uses CD analog play, it works only if a cable connecting the CD player to the "CD" input of sound card is present.

Some soundcards (that's my case) don't have such an input, so the cable isn't obviously connected.
I didn't know that!

Inside you computer, there may or may not be a 4-pin cable going from your CD drive to the sound card.

I found that everything works without it and didn't understand WTF it's good for, so I left it out here.
 
Old 06-09-2010, 03:33 AM   #6
mliberi
LQ Newbie
 
Registered: Jun 2010
Location: italy
Distribution: slackware
Posts: 3

Rep: Reputation: 0
Hi MTK538,

the current thread is an obvious demonstration of the fact that "everything works" is false.

I know there are programs able to play audio CD, e.g. mplayer, because they read audio frames using digital interface.

On the other hand all the programs aiming to play audio CD tracks using ioctl(cdromfd, CDROMPLAY*, ...) fail to obtain the goal to produce audible sound. I tried XMMS, cdc, cdtool and finally I wrote a very simple C program using SDL library.

Analog CD play has been developed in order to unload the CPU and the bus, it's not a bad thing. Once the CPU performed the CDPLAY command all works asynchronously without CPU load and without digital data transfer.

I know that modern computers have a lot of computational resources, but not to implement such a feature produces retrocompatibility problems. In other words many programs using analog CD play simply don't work.
 
Old 06-09-2010, 07:52 AM   #7
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
I didn't know such a thing even existed!
 
  


Reply



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
Sound Card problem(every time i install linux i have diffirent hardware problem) jacka1l Linux - Newbie 7 08-11-2005 06:10 AM
Lan configuration problem - NFS boot problem - RX&TX packets errors 242VDM242 Linux - Networking 4 11-25-2004 01:35 PM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:10 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration