Ask / Submit

sound in compiled apps

asked 2018-08-12 11:38:49 +0300

vader gravatar image

updated 2018-08-12 12:47:52 +0300

Edz gravatar image

Hi all, I am a new sailfish user, on a gemini pda. I have installed a dev environment on the gemini and have managed to compile several programs which I couldn't find (ffmpeg, scummvm, dosbox). The only problem is that I get no sound. I searched in this forum and found a few posts about sdl2, but couldn't find what I needed. I know SDL sound should work, mupen64plus uses sdl sound and it works fine. Dosbox uses alsa lib directly (asound). If I create a qml project and add a SoundEffect, it all works, including volume. If I exec from within the qml page, dosbox starts, but it remains silent. Am I missing something?

I understand we use pulseaudio via alsa, but SDL should pick that up. Is there some magic I need to do :)

Cheers, V

edit retag flag offensive close delete


what version of sdl are you using?

tortoisedoc ( 2018-08-12 15:43:35 +0300 )edit

SDL2-2.0.3-1.1.3, and alsa-lib-1.0.26-1.1.1 (from pkcon).

vader ( 2018-08-12 15:53:11 +0300 )edit

Then the next step i'd say check the initializations (dosbox vs sdl I mean)

tortoisedoc ( 2018-08-12 16:33:13 +0300 )edit

Thanks tortoisedoc and coderus, I'll check out the resource allocation and initialisation routines.

vader ( 2018-08-13 23:23:42 +0300 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-08-13 17:49:29 +0300

coderus gravatar image

You need to request audio resource every time you want to play audio and release it. Check libresource or/and libaudioresource.

edit flag offensive delete publish link more


Thanks coderus, that did the trick. I had to add a g_main_context_iteration loop while the resource was being acquired as well. All works now. Cheers.

vader ( 2018-08-15 02:05:47 +0300 )edit
Login/Signup to Answer

Question tools

1 follower


Asked: 2018-08-12 11:38:49 +0300

Seen: 165 times

Last updated: 2 days ago