ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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().
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...
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.