Any idea how to enable audio output through SDL for DvdPlayer
#1
Hi there,

As you probably know the built-in movie player DvdPlayer will output audio through it's dedicated direct alsa interface which will ignore any SDL_AUDIODRIVER string defined by the user. My question is could any shed a light on how to force DvdPlayer to use SDL instead of alsa?

Many thanks
Reply
#2
There is no SDL Audio code at all in XBMC and since you're posting this to the "Developer's Only" forum my answer is: Write a CSDLAudioDirectSound class and submit a patch Smile
Reply
#3
CapnBry Wrote:There is no SDL Audio code at all in XBMC and since you're posting this to the "Developer's Only" forum my answer is: Write a CSDLAudioDirectSound class and submit a patch Smile

Don't have any experience in writing C++code. Have no idea how hard it would be. Any suggestions?
Reply
#4
CapnBry Wrote:There is no SDL Audio code at all in XBMC and since you're posting this to the "Developer's Only" forum my answer is: Write a CSDLAudioDirectSound class and submit a patch Smile

By the way, how does the menu sound working? It seems it can use SDL, but could not found much in the code.
Reply
#5
Oh yes the GUI uses SDL audio, but it uses very simple fire-and-forget Mix_LoadWAV, Mix_PlayChannel which are just for playing a sound effect and not streaming audio to. To stream audio to the SDL device you basically:
SDL_OpenAudio()
// set your sample rate / channels / bits per sample
SDL_PauseAudio(0)

Then SDL will start calling you back and you have to provide samples. This is slightly different than the ALSA/DirectSound devices work (they write directly) so you'll need to implement a buffer system to hold the data until SDL calls you back for it. If you're not a C++ programmer this may be difficult to construct depending on your expertise level in other languages.
Reply
#6
CapnBry Wrote:Oh yes the GUI uses SDL audio, but it uses very simple fire-and-forget Mix_LoadWAV, Mix_PlayChannel which are just for playing a sound effect and not streaming audio to. To stream audio to the SDL device you basically:
SDL_OpenAudio()
// set your sample rate / channels / bits per sample
SDL_PauseAudio(0)

Then SDL will start calling you back and you have to provide samples. This is slightly different than the ALSA/DirectSound devices work (they write directly) so you'll need to implement a buffer system to hold the data until SDL calls you back for it. If you're not a C++ programmer this may be difficult to construct depending on your expertise level in other languages.

Thanks for your reply. Due to the very limited C++ knowledge, to write the code I have to borrow most of them from the net.

There is a very interesting article regarding the SDL_RWops which can set up the buffer for you. I will have a look and probably post some questions here.
http://gpwiki.org/index.php/SDL_mixer:Tu..._SDL_RWops


Many thanks indeed.
Reply
#7
The article you linked again isn't for streaming data to the sound card. The SDL audio stack has two access methonds. One is for playing a sample, used for a sound effect which is loaded in its entirety before playing. The other is for continuous playback. All the Mix_* functions are for the first access method, but the dvdplayer needs the second. (Actually the Mix_* functions are probably wrappers to the second method so maybe looking at the SDL source for them is a good first step)
Reply

Logout Mark Read Team Forum Stats Members Help
Any idea how to enable audio output through SDL for DvdPlayer0