No audio Sound

  • Platform information:

    • Hardware: Raspberry Pi 4 Model B Rev 1.1 (4GB)
    • OS: Openhabian
    • Java Runtime Environment: openjdk version “11.0.8” 2020-07-14 / OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10) / OpenJDK Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
    • openHAB version: 2.5.7-1
  • Issue of the topic: no sound, no log, no reaction on Mac or Openhab APP

Terminal information about sources:

openhab> smarthome:audio sources

  • System Microphone (javasound)
    openhab> smarthome:audio sinks
  • System Speaker (enhancedjavasound)
    Web Audio (webaudio)

After Put the command ‘openhab> smarthome:audio play doorbell.mp3’ in terminal nothing happens…

  • Please post configurations (if applicable):

    • Items configuration related to the issue
Contact Contact_E  "Sensor Eingangstür"      <frontdoor>     (Flur)                 {channel="boschshc:window-contact:1:Contact_E:contact"}
Switch Alarm                "Alarmanlage"   <alarm>
  • Sitemap configuration related to the issue
        Switch item=Alarm icon="alarm"
        Text item=Contact_E label="Eingangstür ist [MAP(en.map):%s]" icon="frontdoor"
  • Rules code related to the issue
rule "Flur Alarm = ON"
when
    Item Contact_E changed to OPEN
then
    if (Alarm.state == ON) {
        playSound("doorbell.mp3") //don't work
        playSound("webaudio","doorbell.mp3") // don't work
        say("Alarm") // don't work
        sendBroadcastNotification("Eingangstür wurde geöffnet") //ok
    }
end
  • Services configuration related to the issue
  • rules.cfg
org.eclipse.smarthome.audio:defaultSource=javasound
org.eclipse.smarthome.audio:defaultSink=enhancedjavasound
  • If logs where generated please post these here using code fences:
    no logs regarding sound

do you have any ideas what might be the cause?

Please use code fences. Spaces are important in configuration and code fences make things easier to read.

How to use code fences - Tutorials & Examples - openHAB Community

The entries you posted to be in rules.cfg (where do you have this file?) should be in runtime.cfg or youcould as well set those on PaperUI.
Checking on PaperUI migth reveal them not set!, hence openHAB does not know where to play any sound.
enhencedjavasound as I read the documentation is played only at the openHAB server, do you have aspeaker connected?
Webaudio would be played on a remote device if either PaperUI or HABPanel are displayed (if this device has a speaker of course).
The say command would need an installed TTS service.
You are using Java 11, although 8 is requested, I can’t say if Java 11 raises problems for the audio parts.

Hi @opus

the fine name is runtime.cfg (mistake by tipping)
I changed the settings of runtime.cfg from enhencedjavasound to webaudio
now i receive the log entry
2020-08-13 20:46:05.838 [arthome.event.PlayURLEvent] - Play URL ‘/audio/8e2189bb-a1fc-41fd-8f74-122178ea4f61’.

I use a macbook pro and this device have a speaker :slight_smile: but no sound come out :frowning:

thanks for this hint @Bruce_Osborne :+1:

1 Like

What kind of UI is the macbook showing when the comandtopic is performed?
The log tells you it did work. I tested it via the karaf console ( command smarthome:audio play doorbell.mp3) my system set to use web audio as default, my smartphone had habpanel showing and the bell was ringing!

Paper UI or Basic UI… Parallel is openhab App on IOS device open

no sound come out on both devices :cold_sweat:

As said before the documentation states that so far only HABPanel and PaperUI are supported. IMHO one of them has to be active.
What is your default audio sink?

IMHO - what is this and where i can activate it??? :roll_eyes:

The default audio sink?
PaperUI-Configuration-System-Audio

As of your first post, I think the System Speaker is selected (hence the dot in front of the line).

oh, yes I already changed it… Paper UI & OpenHab APP are open / active, command in terminal
openhab> smarthome:audio play doorbell.mp3 was putted, no sound come out :frowning:

Log: 2020-08-15 23:20:13.238 [arthome.event.PlayURLEvent] - Play URL '/audio/4948eaa7-81ca-4901-8e43-d6ba3b4cc45b'.

All I can say is that this setup works for me if HABPanel (which is not the same as the openHAB App, but can be started via it!) or PaperUI are shown in a browser.

i tried to change the sinc settings back to the ‘system speaker’, connected a speaker to my Raspberry and the sound come out. Then i changed the settings back to ‘web audio’, no sound come out from my MAC or iPhone device with activated HABPanel or PaperUI & OpenHab APP, but sound come out from Raspberry system speaker. :unamused:

now i am confused :grimacing:
Its looks like the settings in PaperUI or runtime.cfg don’t grab…

runtime.cfg:

    ################### AUDIO #######################
    # This parameter defines the default audio source to use (if not set, the first available one will be used.
    #
    org.eclipse.smarthome.audio:defaultSource=javasound
    # This parameter defines the default audio sink to use (if not set, the first available one will be used.
    #
    org.eclipse.smarthome.audio:defaultSink=webaudio

PaperUI

If you set webaudio in runtime.cfg and after starting PaperUI shows Web Audio it should have ben recognised by the system.
Changing it via PaperUI while openHAB is running is also possible. DO NOT forget to hit the SAVE button!
You can use the karaf console to check the default audio sink like you showed in Post #1, the audio sink marked with a * is the default.

I do assume that you checked your devices to have set the audio volume to something other then 0 :roll_eyes:

1 Like