Topic: Audio output in Pianoteq8 on Ubuntu

For testing purposes I wanted to try P8 on Ubuntu using the provided version for Linux x64. Everything works so far, and the audio is output via the internal speakers of my notebook. As the sound is very bad using the internal speakers I tried to improve it a little bit using my Bluetooth speakers. I connected the Bluetooth speakers to my Linux system and the system audio (i.e. operating system sounds, Youtube audio, etc.) is properly output via those speakers and the sound quality was much improved. However, I was not able to persuade Pianoteq8 to use this output as well. The best I can achieve is to output using the internal speakers.

I can choose between the following audio output devices:

https://ibb.co/93Cxfp6
https://ibb.co/LhFb9Sw

I get internal speaker output using the "HDA Intel PCH, ALC283 Analog, Direct hardware device..." without problems
The HDMI outputs are out of scope, as I don´t have HDMI connected.

"Playback recording through the PulseAudio sound server" gave me "Connection refused"  when I first try it, but worked when I started the service using "pulseaudio --start" from another shell. However, again only internal speaker output. alsamixer shows me the outputs but also there, there is no Bluetooth device I can use for output. "Open Sound System" gives me "The device oss is not available"

As said, the Bluetooth speaker is connected as a standard sound output in Ubuntu:

https://ibb.co/QN60W1w

How can I select THIS output in Pianoteq. I know the audio quality won´t be very good, but at least it's louder and a little bit better than the cheesy internal speakers of the notebook.

Re: Audio output in Pianoteq8 on Ubuntu

daubsi wrote:

For testing purposes I wanted to try P8 on Ubuntu using the provided version for Linux x64. Everything works so far, and the audio is output via the internal speakers of my notebook. As the sound is very bad using the internal speakers I tried to improve it a little bit using my Bluetooth speakers. I connected the Bluetooth speakers to my Linux system and the system audio (i.e. operating system sounds, Youtube audio, etc.) is properly output via those speakers and the sound quality was much improved. However, I was not able to persuade Pianoteq8 to use this output as well. The best I can achieve is to output using the internal speakers.

I can choose between the following audio output devices:

https://ibb.co/93Cxfp6
https://ibb.co/LhFb9Sw

I get internal speaker output using the "HDA Intel PCH, ALC283 Analog, Direct hardware device..." without problems
The HDMI outputs are out of scope, as I don´t have HDMI connected.

"Playback recording through the PulseAudio sound server" gave me "Connection refused"  when I first try it, but worked when I started the service using "pulseaudio --start" from another shell. However, again only internal speaker output. alsamixer shows me the outputs but also there, there is no Bluetooth device I can use for output. "Open Sound System" gives me "The device oss is not available"

As said, the Bluetooth speaker is connected as a standard sound output in Ubuntu:

https://ibb.co/QN60W1w

How can I select THIS output in Pianoteq. I know the audio quality won´t be very good, but at least it's louder and a little bit better than the cheesy internal speakers of the notebook.

I am answering my own question after some further research, so it might be beneficial for others:

The way to go is "Pulseaudio". It apparently sits on top of ALSA and allows the usage of Bluetooth devices using bluez.

I had some trouble setting all the stuff up, but just managed to get output on the Bluetooth speaker.

a) Make sure all relevant packages are installed. For me the pulseaudio package was installed but I had/was able to install "pulsemixer" and "bluez-alsa-utils". (Not sure if that was necessary)

I still need to read up about how the pulseaudio integration with systemd works, but it seems you need to start the pulseaudio server explicitly. Not sure if that is done by default.. Try "pulseaudio --check" or "pulseaudio --start". You won´t get any output - try adding "-v -v" to get some loglines. Potentially pulseaudio is already running. it can be killed using "pulseaudio --kill", but this didn´t really work for me. Also it's important that the pulseaudio server is accessed in the user context and not as root. This seems to be the issue when running PT8 with sudo, that the connection has been denied. Starting PT8 in normal user mode and then connecting to the PulseAudio server works.

My current audio output is "Audio device type: ALSA", "Audio output: Playback/reording through PulseAudio sound server" - no further settings necessary.

When you then run "pulsemixer" you should see PT8 connected to the Bluetooth device:

https://ibb.co/fXn2cz1

I played around with pulsemixer and also set the Bluetooth speaker as the default. Maybe that did the trick.

Re: Audio output in Pianoteq8 on Ubuntu

daubsi wrote:
daubsi wrote:

For testing purposes I wanted to try P8 on Ubuntu using the provided version for Linux x64. Everything works so far, and the audio is output via the internal speakers of my notebook. As the sound is very bad using the internal speakers I tried to improve it a little bit using my Bluetooth speakers. I connected the Bluetooth speakers to my Linux system and the system audio (i.e. operating system sounds, Youtube audio, etc.) is properly output via those speakers and the sound quality was much improved. However, I was not able to persuade Pianoteq8 to use this output as well. The best I can achieve is to output using the internal speakers.

I can choose between the following audio output devices:

https://ibb.co/93Cxfp6
https://ibb.co/LhFb9Sw

I get internal speaker output using the "HDA Intel PCH, ALC283 Analog, Direct hardware device..." without problems
The HDMI outputs are out of scope, as I don´t have HDMI connected.

"Playback recording through the PulseAudio sound server" gave me "Connection refused"  when I first try it, but worked when I started the service using "pulseaudio --start" from another shell. However, again only internal speaker output. alsamixer shows me the outputs but also there, there is no Bluetooth device I can use for output. "Open Sound System" gives me "The device oss is not available"

As said, the Bluetooth speaker is connected as a standard sound output in Ubuntu:

https://ibb.co/QN60W1w

How can I select THIS output in Pianoteq. I know the audio quality won´t be very good, but at least it's louder and a little bit better than the cheesy internal speakers of the notebook.

I am answering my own question after some further research, so it might be beneficial for others:

The way to go is "Pulseaudio". It apparently sits on top of ALSA and allows the usage of Bluetooth devices using bluez.

I had some trouble setting all the stuff up, but just managed to get output on the Bluetooth speaker.

a) Make sure all relevant packages are installed. For me the pulseaudio package was installed but I had/was able to install "pulsemixer" and "bluez-alsa-utils". (Not sure if that was necessary)

I still need to read up about how the pulseaudio integration with systemd works, but it seems you need to start the pulseaudio server explicitly. Not sure if that is done by default.. Try "pulseaudio --check" or "pulseaudio --start". You won´t get any output - try adding "-v -v" to get some loglines. Potentially pulseaudio is already running. it can be killed using "pulseaudio --kill", but this didn´t really work for me. Also it's important that the pulseaudio server is accessed in the user context and not as root. This seems to be the issue when running PT8 with sudo, that the connection has been denied. Starting PT8 in normal user mode and then connecting to the PulseAudio server works.

My current audio output is "Audio device type: ALSA", "Audio output: Playback/reording through PulseAudio sound server" - no further settings necessary.

When you then run "pulsemixer" you should see PT8 connected to the Bluetooth device:

https://ibb.co/fXn2cz1

I played around with pulsemixer and also set the Bluetooth speaker as the default. Maybe that did the trick.


Update: Playing around with the setup I found that there seems to be in issue (maybe only with this particular Bluetooth speaker), that eventually it was only recognized as a "Handsfree profile device" and no longer as a "High-Fideity audio sink". I tried restarting pulseaudio, bluetooth, rebooting the system, but nothing really helped. In the sound settings, I was able to select the High-Fidelity audio sink as the output but it didn´t really seem to be used and was reset to hands-free profile again.

What eventually solved the issue was:

https://wiki.archlinux.org/title/blueto...PulseAudio

Manually switching to Bluetooth's AudioSink service which would make the A2DP profile and its A2DP PulseAudio sink available. This can be done with blueman-manager which included in blueman or by registering the UUID of the AudioSink service with bluetoothctl.
$ bluetoothctl
[bluetooth]# menu gatt
[bluetooth]# register-service 0000110b-0000-1000-8000-00805f9b34fb
[bluetooth]# quit
Disable the headset profile
/etc/bluetooth/main.conf
[General]
Disable=Headset
Enable MultiProfile support. This may help with headsets that support A2DP as well as Headset audio.
/etc/bluetooth/main.conf
[General]
MultiProfile=multiple

When I changed the config like that A2DP became available again. Not sure why this helped, as it already worked before once.

Re: Audio output in Pianoteq8 on Ubuntu

Nice Project and explanations. Are you using it for MIDI-Playback oder Live-Playing? Maybe Ubuntu "Studio" with preconfigured JACK and the JACK-Tools would suit your needs.

Regards
Tom

Re: Audio output in Pianoteq8 on Ubuntu

tom_moremusic wrote:

Nice Project and explanations. Are you using it for MIDI-Playback oder Live-Playing? Maybe Ubuntu "Studio" with preconfigured JACK and the JACK-Tools would suit your needs.

Regards
Tom

Thank you. I am just doing Live-Playing with my Master Keyboard. Unfortunately, it turned out that the latency when playing the sound over Bluetooth speakers is unbearable. No idea how big it is actually, but it feels like 20+ ms, so the notes play considerably behind my key presses :-(

I can't judge where the latency is coming from: be it the Bluetooth stack on the notebook or the Bluetooth stack in the speaker. I checked the documentation for some configuration parameters to potentially influence this, but couldn't find anything that had an effect. I hadn't expect it to be that disturbing, but actually it was. I am now playing with some plain old headphones and the latency is nearly real time I'd say.

Also, the detecting of the speakers with their A2DP profile doesn't work reliably neither. The changes I did do not seem to be sufficient to get a stable setup. Usually after a reboot it's fine, but as soon as something changes in the setup, the speakers are no longer detected correctly and are configured to be in "Handsfree mode".

Well.. it was worth a try but for now I am sticking to the headphone solution.

Re: Audio output in Pianoteq8 on Ubuntu

For latency, Bluetooth ist the worst case. Even active-Speakers with wired connection are sometimes really bad in latency.
For travelling im using the "DOSS SoundBox XL" with direct connection. Sound is "OK" for size, portability and price.

Regards
Thomas

Re: Audio output in Pianoteq8 on Ubuntu

I use a Focusrite Scarlett 6i6 (connected via USB) that has various speaker and headphone outputs and is compatible with Linux.
But it should also work with the regular system audio outputs.
On Pop OS 22.04 I am using the default sound system (Pipwire?) but Alsa or PulseAudio also work.

Re: Audio output in Pianoteq8 on Ubuntu

I just bought Pianoteq 8 for my daughter, I installed it on i5 4gen with Ubuntu Studio, currently with HDMI output to a soundbar for testing, and a raspberry as the final machine.
My daughter's PC is a Raspberry Pi 4 with Behringher UMC202HD sound card, without desktop and read-only filesystem so it is indestructible.
On the first it runs very well with 48Khz sampling and 256 voice polyphony, on the RasPi with 29Khz sampling and 128 voices.
The rapberry was overclocked to 2200Mhz and Pianoteq was installed with the tuning file found here on the forum.
Pianoteq starts automatically and avoiding using the desktop environment has improved performance a lot.
In the first days of testing it worked very well, unfortunately the new keyboard sent to me by the shop was defective.
Now I'm waiting for a VPC1 purchased from another store.
To avoid latency problems I would not use bluetooth, even a low-cost sound card is enough.

Regards
Giovanni