Hi Gwendal,
Thank you very much for looking into the issue that my MaryTTS voice output to PuseAudio RAOP sinks is still playing back ways to fast although I have OpenHAB 3.2.0 installed. Besides the reported issue that playing back audio files not matching the s16le 2ch 44100Hz specification fail to play at all.
The sounds that did not play at all are songs encoded as 256 kBit/s mp3 files that I purchased from the iTunes store. There is no fast playback, it is not played at all. So for copyright reasons I cannot publish them here. As I tried different songs leading to the same negative result, I hope that this classification is already sufficient to reproduce the issue. When I use the OpenHAB Karaf console to output such an mp3 file to a selected pulseaudio RAOP sink, I receive the following exception in the log file:
2022-04-03 11:25:46.865 [WARN ] [core.audio.internal.AudioManagerImpl] - Error playing 'org.openhab.core.audio.FileAudioStream@645e704c': Cannot send sound to the pulseaudio sink
org.openhab.core.audio.UnsupportedAudioFormatException: Cannot send sound to the pulseaudio sink
at org.openhab.binding.pulseaudio.internal.PulseAudioAudioSink.process(PulseAudioAudioSink.java:164) ~[?:?]
at org.openhab.core.audio.internal.AudioManagerImpl.play(AudioManagerImpl.java:140) [bundleFile:?]
at org.openhab.core.audio.internal.AudioManagerImpl.playFile(AudioManagerImpl.java:180) [bundleFile:?]
at org.openhab.core.audio.internal.AudioConsoleCommandExtension.playOnSink(AudioConsoleCommandExtension.java:171) [bundleFile:?]
at org.openhab.core.audio.internal.AudioConsoleCommandExtension.play(AudioConsoleCommandExtension.java:143) [bundleFile:?]
at org.openhab.core.audio.internal.AudioConsoleCommandExtension.execute(AudioConsoleCommandExtension.java:85) [bundleFile:?]
at org.openhab.core.io.console.ConsoleInterpreter.execute(ConsoleInterpreter.java:55) [bundleFile:?]
at org.openhab.core.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.3.4]
at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) [bundleFile:4.3.4]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) [bundleFile:4.3.4]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) [bundleFile:4.3.4]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) [bundleFile:4.3.4]
at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) [bundleFile:4.3.4]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [bundleFile:4.3.4]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [bundleFile:4.3.4]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.io.IOException: mark/reset not supported above 10000 bytes
at org.openhab.binding.pulseaudio.internal.ConvertedInputStream$ResetableInputStream.reset(ConvertedInputStream.java:252) ~[?:?]
at org.tritonus.share.sampled.file.TAudioFileReader.getAudioFileFormat(TAudioFileReader.java:195) ~[?:?]
at org.openhab.binding.pulseaudio.internal.ConvertedInputStream.getPCMStream(ConvertedInputStream.java:146) ~[?:?]
at org.openhab.binding.pulseaudio.internal.ConvertedInputStream.<init>(ConvertedInputStream.java:65) ~[?:?]
at org.openhab.binding.pulseaudio.internal.PulseAudioAudioSink.process(PulseAudioAudioSink.java:125) ~[?:?]
I have installed the MaryTTS binding. I did not install anything else, simply pressed on “Install” in the PaperUI at the respective binding. When I try to output some words via the OpenHAB Karaf console, I get very fast voice output. Again, the voice is output to a PulseAudio RAOP sink. I do not see any output in the log files when playing back voice output.
Unfortunately, I do not know much about the pulseaudio driver and your binding to provide a valid answer to this question. Therefore, I will provide further details of my setup so that I hope you can extract the answers therefrom:
The server is a VM without assigned sound card. Debian 10 and OpenHAB 3.2.0 are installed via openhabian-config.
Starting from the default settings of the pulseaudio (I talk about the driver, not the binding), I applied the following changes to /etc/pulse/default.pa:
### Automatically load loopback sound driver
.ifexists module-loopback.so
load-module module-loopback
.endif
### Automatically load driver modules for auto discovery
.ifexists module-zeroconf-discover.so
load-module module-zeroconf-discover
.endif
.ifexists module-raop-discover.so
load-module module-raop-discover
.endif
### Allow access to pulseaudio via TCP port 4712
load-module module-esound-protocol-tcp auth-anonymous=1
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16
load-module module-simple-protocol-tcp
load-module module-cli-protocol-tcp
My pulseaudio.things file contains:
Bridge pulseaudio:bridge:local "PulseAudio" [ host="127.0.0.1", port=4712 ] {
Things:
Thing sink trivum1 "Trivum 1" [name="raop_output.arm-7.local", activateSimpleProtocolSink=true, simpleProtocolSinkPort=4721]
Thing sink trivum2 "Trivum 2" [name="raop_output.arm-7.local.2", activateSimpleProtocolSink=true, simpleProtocolSinkPort=4722]
Thing sink trivum3 "Trivum 3" [name="raop_output.arm-7.local.3", activateSimpleProtocolSink=true, simpleProtocolSinkPort=4723]
Thing sink trivum4 "Trivum 4" [name="raop_output.arm-7.local.4", activateSimpleProtocolSink=true, simpleProtocolSinkPort=4724]
Thing sink trivum5 "Trivum 5" [name="raop_output.arm-7.local.5", activateSimpleProtocolSink=true, simpleProtocolSinkPort=4725]
Thing sink trivum6 "Trivum 6" [name="raop_output.arm-7.local.6", activateSimpleProtocolSink=true, simpleProtocolSinkPort=4726]
Thing sink trivum7 "Trivum 7" [name="raop_output.arm-7.local.7", activateSimpleProtocolSink=true, simpleProtocolSinkPort=4727]
Thing sink trivum8 "Trivum 8" [name="raop_output.arm-7.local.8", activateSimpleProtocolSink=true, simpleProtocolSinkPort=4728]
}
With these settings, I created pulseaudio items and so that I can successfully access the pulseaudio sinks in OpenHAB. The pulseaudio things are online and I can adjust the volume. The settings are correctly applied to the sinks when checking the volume via pactl -s localhost list sinks. I can also successfully output WAV files in s16le 2ch 44100Hz via the OpenHAB Karaf console to the respective PulseAudio RAOP sink.
Due to my setup on a VM without sound card installed, I cannot answer this question. As you already resolved this issue, I could imagine that my reported problem is only related to RAOP sinks in pulseaudio.
At present, I could only identify the pattern that high quality mp3 files (encoded at 256 kBit/s) did not play at all and raised an exception, see above. The issue with the fast playback up to now only concerns the voice output from MaryTTS.