Seriously no sound on linux ?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Seriously no sound on linux ?

Post by bogs » Wed Jan 17, 2018 4:29 pm

félix wrote:
Wed Jan 17, 2018 1:35 pm
Thank you for the testing and sorry for the typo. I've indeed installed 16.04 LTS 32 bits.
No problems :D

You can do sound on linux, although I am unsure exactly why it varies from distro to distro. My guess would be it is due to the various distro's using different things for sound, just like different drivers for your vid card will allow you to see custom window shapes.

For instance, I've had better luck with sound on linux distros using pulse audio and mPlayer, as opposed to ones using alsa audio and mPlayer. I haven't found definitive information why that might be, and it looks like it may be broken again in 8 for completely different reasons.

Like I said up there, I really agree with this sentiment -
richmond62 wrote:
Sat Oct 01, 2016 6:13 pm
I thought the whole point about shedding the dependency on Quicktime was NOT to
introduce platform-dependent dependencies on other external media players, but
to introduce an internal media player.

The problem has always been that one can have no way of knowing what if any
media players an end-user has installed in her/his machine.
As long as your code is relying on something that may not be there, your dev's are going to have to keep jumping through hoops no matter what OS they are using, not just linux. The only way to reliably resolve this is to have sound generated internally, as far as I know.

This isn't easy, btw, certainly not as easy as having all the workarounds doing it (there were a few in that thread as well), but I think it is worth while. It does shift the requirement from us to the company of course, but the end result is they have a much sounder product to deliver.
Image

félix
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

Re: Seriously no sound on linux ?

Post by félix » Fri Jan 19, 2018 2:45 am

félix wrote:
Tue Jan 16, 2018 2:30 pm
As for installing LiveCode 7.1.4 on Linux, it failed on Ubuntu 16 with an error: "Installer slave quit unexpectedly.".
I'm replying to myself to share the solution. I've installed Ubuntu 16 64 bits and got the error "Installer slave quit unexpectedly" again with :

Code: Select all

sudo ./LiveCodeCommunityInstaller-7_1_4-Linux.x64 
The cause was that the LiveCodeCommunityInstaller-7_1_4-Linux.x64 file was still in my Download folder (Téléchargements folder as I'm french). I moved it to my Home folder, and it worked.

Bonne nuit
Félix

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Seriously no sound on linux ?

Post by bogs » Fri Jan 19, 2018 3:57 am

Now that is interesting, I've never tried running an installer from the download folder, usually I set my browsers to download to a location I choose (my system of directories eases the pain of backups :D ).

Was there any error listed in the terminal window when the slave installer quit? Just curiosity here.
Image

félix
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

Re: Seriously no sound on linux ?

Post by félix » Tue Jan 30, 2018 11:42 am

I managed to workaround the sound limitation on Linux using informations I've gathered here and there. It's not ideal but it will suffice for my purpose.

There are two parts: Livecode and Linux

1. On Linux, I have installed vlc and I have a bash file installed in the stack folder. The sound files are also in the stack folder

Content of the bash file vlcsound.sh:

Code: Select all

#!/bin/sh
vlc -I dummy --play-and-exit $1 &

2. In Livecode, I have a stack script that stores the stack folder in a global variable

Code: Select all

on openStack
   global gStackFolder
   put the specialFolderPath of resources & "/" into gStackFolder
end openStack
and a handler that play the sound passed as a parameter

Code: Select all

on joueAudioclip pClipName
   global gStackFolder
   if the platform is "Linux" then
      put  gStackFolder & "vlcsound.sh" && gStackFolder & pClipName into application
      open process application for neither   
   else
      play audioclip gStackFolder & pClipName     
   end if
end joueAudioclip
and finally the code of a button that plays the sound file

Code: Select all

on mouseUp
   joueAudioClip( "007.wav" )
end mouseUp
Hope it will be useful to someone.

--
Félix

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Seriously no sound on linux ?

Post by MaxV » Tue Jan 30, 2018 1:34 pm

Livecode 7.1.4 works great on Linux with sounds.
Install mplayer
Use the player object
I attached an example stack.
Attachments
AudioTest.livecode.zip
(529 Bytes) Downloaded 188 times
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Seriously no sound on linux ?

Post by richmond62 » Tue Jan 30, 2018 7:03 pm

Install mplayer
So, presupposes that our client knows how to and can install mplayer on their machine. :cry:

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Seriously no sound on linux ?

Post by bogs » Tue Jan 30, 2018 8:21 pm

Linux, the red headed stepchild, where every user is a BOfH :twisted:

On a more serious note, there has to be a better way. You might be able to assume library xyz is on Windows, or Mac, but it just can't be assumed on LInux because, well, um, because Linux.

Alternately, everyone that devs for Linux can just test to see if special snowflake program library is there, and if not, pop the message box saying "too bad, so sad, no sound for YOU".
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Seriously no sound on linux ?

Post by richmond62 » Tue Jan 30, 2018 9:10 pm

Linux, the red headed stepchild
Watch it mate: I may have (rapidly greying) red hair, but I'm nobody's
stepchild. :D

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Seriously no sound on linux ?

Post by bogs » Wed Jan 31, 2018 1:41 pm

:mrgreen: :mrgreen:
Image

félix
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

Re: Seriously no sound on linux ?

Post by félix » Wed Jan 31, 2018 9:41 pm

MaxV wrote:
Tue Jan 30, 2018 1:34 pm
I attached an example stack.
Thank you MaxV, your stack is working. However there are few problems :

1. MPlayer can't play very well. It get's stuck. Same thing on the terminal: "audio device got stuck" errors while playing. This issue can be addressed (see here http://alsa.opensrc.org/Mplayer.)

2. The play button is not active until the sound is finished.

3. The player is quite ugly, not at all like what one can experience on Windows or Mac: just an empty rectangle. It doesn't bother me that much because I would have make it invisible anyway.

For me, using VLC is more convenient. It plays well and the button remains active while it's playing. Installing VLC is simple and there is no config file to setup.

Let's hope a decent player for Linux will come.

In passing, I'm enjoying using Livecode more and more. I've discovered HyperCard last year when I was given an old Apple G4 (powerpc), I have read a lot about it, seen Bill Atkinson on Youtube and many other things. I think simplicity, clarity, elegance are important when coding. Livecode brings that back to me.

And the community is great !

--
Félix

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Seriously no sound on linux ?

Post by MaxV » Thu Feb 01, 2018 12:08 am

Use livecode 7
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

félix
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

Re: Seriously no sound on linux ?

Post by félix » Thu Feb 01, 2018 3:56 pm

I'm using LiveCode 7.1.4 as suggested on Ubuntu 16, and Mint Cinnamon 18.2

Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”