We have moved to a new Sailfish OS Forum. Please start new discussions there.
4

sound in compiled apps

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

vader gravatar image

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

Spam Hunter 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

Comments

what version of sdl are you using?

tortoisedoc ( 2018-08-12 15:43:35 +0200 )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 +0200 )edit

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

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

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

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

1 Answer

Sort by » oldest newest most voted
1

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

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

Comments

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 +0200 )edit

Any chance you could post your fix/workaround?

szopin ( 2020-05-08 18:12:56 +0200 )edit
Login/Signup to Answer

Question tools

Follow
1 follower

Stats

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

Seen: 280 times

Last updated: Aug 13 '18