# \[SOLVED\] No sound with enhancedjavasound (System speaker)

**URL:** <https://community.openhab.org/t/solved-no-sound-with-enhancedjavasound-system-speaker/95636>\
**Category:** Beginners\
**Created:** [March 31, 2020, 5:13pm UTC](https://community.openhab.org/t/solved-no-sound-with-enhancedjavasound-system-speaker/95636 "2020-03-31T17:13:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rutorai](https://community.openhab.org/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@Rutorai](https://community.openhab.org/u/Rutorai)\
**Post date:** [March 31, 2020, 5:13pm UTC](https://community.openhab.org/t/solved-no-sound-with-enhancedjavasound-system-speaker/95636/1 "2020-03-31T17:13:17Z")

</div>

Hello,

This is my first topic, so excuse me if it’s not perfect ☹ but be sure I’ll do everything to improve myself 🙂

- Platform information:
  - Hardware: Ryzen 3700X/64Go RAM/SSD 500Go
  - OS: Linux Manjaro
  - Java Runtime Environment: OpenJDK 64-Bit 1.8.0\_242
  - openHAB version: 2.5.3

- Issue of the topic:

Initially I created a simple rule, as soon as a contact is open, a sound should be played. But I can’t hear any sound. So I added some log, and logs are written in log file. So, after chaging log level, I tried in console : **smarthome:audio play alert.wav**  
Same problem : no sound, but a warning in log (see below).

If I select “Web audio” everything works perfectly

- Please post configurations (if applicable):
  - Items configuration related to the issue NA
  - Sitemap configuration related to the issue NA
  - Rules code related to the issue NA (I think)
  - Services configuration related to the issue NA

- If logs where generated please post these here using code fences:

```csv
2020-03-31 19:09:46.896 [DEBUG] [core.audio.internal.AudioManagerImpl] - An exception occurred while getting the volume of sink 'enhancedjavasound' : Cannot determine master volume level
java.io.IOException: Cannot determine master volume level
	at org.openhab.io.javasound.internal.JavaSoundAudioSink.getVolume(JavaSoundAudioSink.java:179) ~[?:?]
	at org.eclipse.smarthome.core.audio.internal.AudioManagerImpl.getVolume(AudioManagerImpl.java:203) ~[bundleFile:?]
	at org.eclipse.smarthome.core.audio.internal.AudioManagerImpl.play(AudioManagerImpl.java:128) [bundleFile:?]
	at org.eclipse.smarthome.core.audio.internal.AudioManagerImpl.playFile(AudioManagerImpl.java:184) [bundleFile:?]
	at org.eclipse.smarthome.core.audio.internal.AudioConsoleCommandExtension.playOnSink(AudioConsoleCommandExtension.java:172) [bundleFile:?]
	at org.eclipse.smarthome.core.audio.internal.AudioConsoleCommandExtension.play(AudioConsoleCommandExtension.java:144) [bundleFile:?]
	at org.eclipse.smarthome.core.audio.internal.AudioConsoleCommandExtension.execute(AudioConsoleCommandExtension.java:86) [bundleFile:?]
	at org.eclipse.smarthome.io.console.ConsoleInterpreter.execute(ConsoleInterpreter.java:55) [bundleFile:?]
	at org.eclipse.smarthome.io.console.karaf.internal.CommandWrapper.execute(CommandWrapper.java:78) [bundleFile:?]
	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) [bundleFile:4.2.7]
	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) [bundleFile:4.2.7]
	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) [bundleFile:4.2.7]
	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) [bundleFile:4.2.7]
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) [bundleFile:4.2.7]
	at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) [bundleFile:4.2.7]
	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [bundleFile:4.2.7]
	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [bundleFile:4.2.7]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]

```

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![MDAR](https://community.openhab.org/user_avatar/community.openhab.org/mdar/32/57900_2.png) [@MDAR](https://community.openhab.org/u/MDAR)\
**Post date:** [April 13, 2020, 8:49am UTC](https://community.openhab.org/t/solved-no-sound-with-enhancedjavasound-system-speaker/95636/2 "2020-04-13T08:49:41Z")

</div>

Hi

Have you solved this now?

Would you be kind enough to post how?

I’m thinking of trying the JavaSound as a sink on an ODroid C2, but I’ve no idea how to setup the headless Linux audio (I really struggled with the Pulse audio settings in the Ubuntu Mate UX of my big machine, which is a little embarrassing for a sound engineer, but in my defense, I was aiming for a 7.1 output)

---

<div class="post-metadata">

**Author:** ![Rutorai](https://community.openhab.org/letter_avatar_proxy/v4/letter/r/a88e4f/32.png) [@Rutorai](https://community.openhab.org/u/Rutorai)\
**Post date:** [April 13, 2020, 9:48am UTC](https://community.openhab.org/t/solved-no-sound-with-enhancedjavasound-system-speaker/95636/3 "2020-04-13T09:48:04Z")

</div>

Hi,

Yes of course, I hope it will help (of course all commands are specific to archlinux and may have to be adapt a little bit to ubuntu).  
My main problem was that by default pulseaudio is user-specific. So I had to switch to system-mode configuration (even if it’s not recommended).  
First I created a pulse user, and set specific groups required :

> `useradd --no-create-home --user-group -system pulse`  
> `usermod -aG audio pulse`  
> ` `  
> `groupadd pulse-access`  
> `usermod -aG pulse-access pulse`  
> `usermod -aG pulse-access root`  
> `usermod -aG pulse-access openhab`

Then I disabled and stopped user specific service and socket

> `systemctl --global disable pulseaudio.service pulseaudio.socket`  
> `systemctl --user stop pulseaudio.service pulseaudio.socket`

Finally, after having created the system service I enabled and start it :

> `[Unit]`  
> `Description=Pulseaudio sound server`  
> `After=avahi-daemon.service network.target`  
> ` `  
> `[Service]`  
> `ExecStart=/usr/bin/pulseaudio --system --daemonize=no --disallow-exit --disallow-module-loading`  
> `ExecReload=/bin/pkill pulseaudio`  
> `Restart=always`  
> `RestartSec=30`  
> ` `  
> `[Install]`  
> `WantedBy=multi-user.target`

> `systemctl enable pulseaudio.service`  
> `systemctl start pulseaudio.service`

I still have the exception stacktrace, it’s more a warning but because of that it’s not possible to set volume from openhab. To me it’s a bug in addon, the volume configuration is based on SPEAKER PORT, it’s hardcoded, but I only have Line-out and Headphone.

That’s it (I had to restart)

---

<div class="post-metadata">

**Author:** ![MDAR](https://community.openhab.org/user_avatar/community.openhab.org/mdar/32/57900_2.png) [@MDAR](https://community.openhab.org/u/MDAR)\
**Post date:** [April 13, 2020, 12:09pm UTC](https://community.openhab.org/t/solved-no-sound-with-enhancedjavasound-system-speaker/95636/4 "2020-04-13T12:09:22Z")

</div>

Thanks.

That’s excellent.

It certainly gives me something to work from, but I suspect it’s perfect as it is.

Best wishes
