LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   SDL_CDPlaytracks problem (https://www.linuxquestions.org/questions/programming-9/sdl_cdplaytracks-problem-718764/)

thilaga 04-13-2009 07:16 AM

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

mliberi 06-05-2010 01:50 PM

exactly the same
 
Quote:

Originally Posted by thilaga (Post 3507239)
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...

thilaga 06-06-2010 11:44 PM

I stopped that work. Please let me know if you get any solution.

mliberi 06-08-2010 02:10 AM

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

MTK358 06-08-2010 07:11 AM

Quote:

Originally Posted by mliberi (Post 3996264)
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.

mliberi 06-09-2010 03:33 AM

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.

MTK358 06-09-2010 07:52 AM

I didn't know such a thing even existed!


All times are GMT -5. The time now is 07:41 PM.