Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 13-05-2018, 05:12   #1
Registered User

Join Date: Jun 2017
Posts: 61
What app does OpenCPN call to play sounds?

Can anyone please tell me what app (aplay? omxplayer? etc) does OpenCPN call to play sounds such as ships bells, AIS CPA alert on the Raspberry PI version?

Thank you
Chris
__________________

baltika_no_9 is offline   Reply With Quote
Old 13-05-2018, 07:35   #2
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,575
Re: What app does OpenCPN call to play sounds?

Quote:
Originally Posted by baltika_no_9 View Post
Can anyone please tell me what app (aplay? omxplayer? etc) does OpenCPN call to play sounds such as ships bells, AIS CPA alert on the Raspberry PI version?

Thank you
Chris
None, it uses either the features provided by the wxWidgets toolkit, or PortAudio, depending on how it is built.
If you use the version from the official PPA repository, it is the latter case.

Pavel
__________________

nohal is offline   Reply With Quote
Old 13-05-2018, 08:12   #3
Registered User

Join Date: Jun 2017
Posts: 61
Re: What app does OpenCPN call to play sounds?

Quote:
Originally Posted by nohal View Post
None, it uses either the features provided by the wxWidgets toolkit, or PortAudio, depending on how it is built.
If you use the version from the official PPA repository, it is the latter case.

Pavel
Ah thank you Pavel. I now see on github that OCPN_Sound.h has an include file of portaudio.h but I don't see that file present. I just cannot get opencpn to make a sound. Maybe I give up, all other sound functions/apps work fine.
baltika_no_9 is offline   Reply With Quote
Old 13-05-2018, 08:17   #4
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,575
Re: What app does OpenCPN call to play sounds?

PortAudio is an external library, not part of the OpenCPN sources. The header you are looking for is provided by portaudio19-dev (Or similar package on other distributions)
nohal is offline   Reply With Quote
Old 13-05-2018, 08:24   #5
Registered User

Join Date: Jun 2017
Posts: 61
Re: What app does OpenCPN call to play sounds?

Quote:
Originally Posted by nohal View Post
PortAudio is an external library, not part of the OpenCPN sources. The header you are looking for is provided by portaudio19-dev (Or similar package on other distributions)
I have already installed the portaudio19-dev package but I guess I would need to recompile OCPN or something similar and that's probably beyond me.

Thanks again, I appreciate your help.
baltika_no_9 is offline   Reply With Quote
Old 13-05-2018, 08:49   #6
Registered User

Join Date: Jun 2017
Posts: 61
Re: What app does OpenCPN call to play sounds?

I downloaded the portaudio code from here PortAudio - an Open-Source Cross-Platform Audio API

It compiled OK but I still can't get a sound out of OCPN.
baltika_no_9 is offline   Reply With Quote
Old 13-05-2018, 11:19   #7
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 11,515
Re: What app does OpenCPN call to play sounds?

Quote:
It compiled OK but I still can't get a sound out of OCPN.
Are you setting the path correctly?

Try WatchDog_pi. Under Configuration in a given alarm, it has a test button and path setting eg: C:\Program Files (x86)\OpenCPN 4.8.4\sounds\2bells.wav

You should not have to install any companion program with opencpn & windows, the standard installation supports sound.
rgleason is online now   Reply With Quote
Old 13-05-2018, 13:22   #8
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,575
Re: What app does OpenCPN call to play sounds?

Quote:
Originally Posted by baltika_no_9 View Post
I downloaded the portaudio code from here PortAudio - an Open-Source Cross-Platform Audio API

It compiled OK but I still can't get a sound out of OCPN.
That it compiled fine means nothing, not even that PortAudio was actually used by OpenCPN. You have to read the stuff cmake outputs when you build OpenCPN to see if PortAudio was actually found and is going to be used in the build, if it is, you should see something like this in the output of the "cmake .." command:
Code:
-- *** Staging to build opencpn  ***
-- Build type: Release
-- *** Will install to /usr  ***
-- Crash reporting enabled
-- Using Linux crash reporting
-- Found Portaudio: /usr/lib/arm-linux-gnueabihf/libportaudio.so
-- Portaudio Found
And first of all, you should never have to download and compile anything manually - Unless you do know what and why you do it tends to cause more problems than it possibly resolves.

Pavel
nohal is offline   Reply With Quote
Old 13-05-2018, 14:26   #9
Registered User

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 4,128
Re: What app does OpenCPN call to play sounds?

Also might be worth checking if the sound file bit rate is 16 or 8 Kbps. ISTR having to use sox to convert the bit rate for some files I wanted to use otherwise they wouldn't get played.
conachair is offline   Reply With Quote
Old 13-05-2018, 23:44   #10
Registered User

Join Date: Jun 2017
Posts: 61
Re: What app does OpenCPN call to play sounds?

Quote:
Originally Posted by conachair View Post
Also might be worth checking if the sound file bit rate is 16 or 8 Kbps. ISTR having to use sox to convert the bit rate for some files I wanted to use otherwise they wouldn't get played.
I've downloaded and tried files at various sample rates and still not a squeak. I will try a few more I think.
baltika_no_9 is offline   Reply With Quote
Old 13-05-2018, 23:50   #11
Registered User

Join Date: Jun 2017
Posts: 61
Re: What app does OpenCPN call to play sounds?

Quote:
Originally Posted by nohal View Post
That it compiled fine means nothing, not even that PortAudio was actually used by OpenCPN. You have to read the stuff cmake outputs when you build OpenCPN to see if PortAudio was actually found and is going to be used in the build, if it is, you should see something like this in the output of the "cmake .." command:
Code:
-- *** Staging to build opencpn  ***
-- Build type: Release
-- *** Will install to /usr  ***
-- Crash reporting enabled
-- Using Linux crash reporting
-- Found Portaudio: /usr/lib/arm-linux-gnueabihf/libportaudio.so
-- Portaudio Found
And first of all, you should never have to download and compile anything manually - Unless you do know what and why you do it tends to cause more problems than it possibly resolves.

Pavel
You're absolutely right Pavel but I have got to the point where I will try anything to get a sound from OCPN. I have to admit defeat which is a shame as I really wanted that feature.

Thanks again
Chris
baltika_no_9 is offline   Reply With Quote
Old 14-05-2018, 00:02   #12
Registered User

Join Date: Jun 2017
Posts: 61
Re: What app does OpenCPN call to play sounds?

Quote:
Originally Posted by rgleason View Post
Are you setting the path correctly?

Try WatchDog_pi. Under Configuration in a given alarm, it has a test button and path setting eg: C:\Program Files (x86)\OpenCPN 4.8.4\sounds\2bells.wav

You should not have to install any companion program with opencpn & windows, the standard installation supports sound.
Thanks, I enabled Watchdog, pointed to the 2bells.wav sound file (on my Raspberry pi) and pressed "Test" and heard nothing.
baltika_no_9 is offline   Reply With Quote
Old 14-05-2018, 01:17   #13
Registered User

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 4,128
Re: What app does OpenCPN call to play sounds?

Quote:
Originally Posted by baltika_no_9 View Post
I've downloaded and tried files at various sample rates and still not a squeak. I will try a few more I think.
Does it work with aplay?

Using openplotter, I get no sound from >
Code:
pi@openplotter:~ $ aplay /usr/share/opencpn/sounds/2bells.wav 
Playing WAVE '/usr/share/opencpn/sounds/2bells.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono
aplay: set_params:1239: Channels count non available
But with SOX installed this works >
Code:
pi@openplotter:~ $ play /usr/share/opencpn/sounds/2bells.wav 

/usr/share/opencpn/sounds/2bells.wav:

 File Size: 112k      Bit Rate: 353k
  Encoding: Signed PCM    
  Channels: 1 @ 16-bit   
Samplerate: 22050Hz      
Replaygain: off         
  Duration: 00:00:02.53  

In:100%  00:00:02.53 [00:00:00.00] Out:55.9k [      |      ] Hd:0.0 Clip:0    
Done.
(SoX - Sound eXchange | HomePage)

With the same file selected inside the ships|AIS targets tab the file will play but "squeeky".
My setup is no doubt different as I have a wifiberry sound amp piggy backed onto the Pi
Code:
pi@openplotter:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

pi@openplotter:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=sndrpihifiberry
    snd_rpi_hifiberry_dacplus, 
    Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus, 
    Direct sample mixing device
dsnoop:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus, 
    Direct sample snooping device
hw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus, 
    Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus, 
    Hardware device with all software conversions
Watchdog is similar, will play the sound but very distorted. Then just now Watchdog seemed to hog the player after testing, set up a test alert then cancelled but afterwards got this >
Code:
pi@openplotter:~ $ aplay .opencpn/OpenCPN_Watchdog-Voice_Warnings-English/Warning_AIS_Dangerous_target_detected.wav 
aplay: main:722: audio open error: Device or resource busy
pi@openplotter:~ $ play .opencpn/OpenCPN_Watchdog-Voice_Warnings-English/Warning_AIS_Dangerous_target_detected.wav 
play FAIL formats: can't open output file `default': snd_pcm_open error: Device or resource busy
Sorry, not much help but I'll persevere and post any findings, single handed I really want it to work as well!

Pi3 running openplotter 0.17.1
conachair is offline   Reply With Quote
Old 14-05-2018, 01:27   #14
Registered User

Join Date: Jun 2017
Posts: 61
Re: What app does OpenCPN call to play sounds?

Conachair

I installed sox as suggested.

"aplay" will not play the sound (I get the "Channels count non available" message too) but "play" works just fine.

However I get nothing at all from the AIS alarm test or from Watchdog. I've now tried loads of files at different sampling frequencies.

Still trying!
baltika_no_9 is offline   Reply With Quote
Old 14-05-2018, 01:39   #15
Registered User

Join Date: Jun 2017
Posts: 61
Re: What app does OpenCPN call to play sounds?

Quote:
Originally Posted by baltika_no_9 View Post
Thanks, I enabled Watchdog, pointed to the 2bells.wav sound file (on my Raspberry pi) and pressed "Test" and heard nothing.
Interestingly I select a WAV file in Watchdog configuration and press OK but when I go back and edit the alarm the drop down box where the sound is selected shows "None". I would have expected my selection to have been kept.
__________________

baltika_no_9 is offline   Reply With Quote
Reply

Tags
cal, enc, opencpn

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
does this boat sounds good? jferline Monohull Sailboats 42 15-04-2017 22:47
Is there a thread for Boating App reviews? AIS app? nzmal Navigation 1 10-09-2016 14:31
Opencpn-no AIS sounds Jd1 OpenCPN 10 01-07-2013 05:58
Foghorn sounds for PC and app monte Marine Electronics 2 28-09-2012 15:50



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 05:08.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.