Topic: Pianoteq on Linux netbook

Hello forum,

I want to tell you (in weak english), that I have success running 3.0.3-demo on my Asus eee-pc 901 with Debian/squeeze. I play it in realtime with an external keyboard. Some tunings were necessary to make it possible.

First I installed a realtime-kernel. Debian has no RT-kernel, so I used a 3rd-party-package:

http://www.bandshed.net/AVLinux2/linux-...m_i386.deb

To give high priority to the group audio, appended these entries in limits.conf:
@audio - memlock 500000
@audio - rtprio 99
@audio - nice -10
# End of file

The Intel Atom N270 has to be nailed to 1,6 GHz, else speedstepping to 800 Mhz occurs, which ist too slow. For both (virtual) cpu's it is done by:
# cpufreq-set -c 0 -g performance
# cpufreq-set -c 1 -g performance

Jackd is slower than direct output to alsa, so I chose Alsa in pianoteq options and disabled jackd. The internal soundcard is an Intel HDA, which is noiseless to my surprise. My eee-pc has no harddisk, just 4 GB flash ssd, which could be the reason.

For Midi-In I use a MIDI-to-USB adapter (Edirol UM-1SX). All E-Pianos (Rhodes and Wurly) need less performance than the Acoustic Pianos. I can run the E-Pianos down to buffer 64 with 44 khz (latency 1,5 ms) and have no xruns or something! The load monitor on Pianoteq doesn't go over 50%.

The Acoustic Pianos are more demanding. To be on the safe site, it is better to use 128 samples. With full chords, reverb and much sustain work I can drive the load up to 95%. With reverb-off I have more reserve and can't drive the load to the edge.

I like the option to adjust the incoming velocity in PT, something I was always unhappy with on the Nord Electro 2. I used it as masterkeyboard in this test and it is very useful, that transposition can be done inside Pianoteq.

I now have the strong urge to buy this fantastic software for Linux. Because I know, the eeepc is powerful enough for the e-pianos, I would like to see a light version just with these. Else I have to spent 250€ on Pianoteq and 50€ for the e-piano = 300€. Not a small amount of money for me and with the risk, that the performance of the eee-pc is limited to take full advantage of the superb acoustic pianos.

Maybe I can optimize the eee further, that I can use the A-Pianos with 64 samples, reverb and without fear, that the load reaches 100%. Somewhere I read, two cores can be counter-productive for realtime use. Does anyone know, if one sibling of the Intel Atom N270 can be "switched-off"? - I guess not, because "Multicore rendering" in Pianoteq is greyed and the N270 just does multithreading and is not a real multicore-cpu, but who knows ...

Any further ideas, how I can harden the netbook for the A-Pianos further?

Anyway, pianoteq is personally my Linux-software of the year. Just 11 MB (the demo) and superb functions and interface. Great!

- groovy

Re: Pianoteq on Linux netbook

wow, certainly amazing.  I'm really looking forward to what sort of intermediate, portable sound solutions netbooks will bring.

Re: Pianoteq on Linux netbook

Seems as though the netbooks need to have just a slightly faster cpu for audio. Maybe the next generation will move up to 2 ghz processors?

Re: Pianoteq on Linux netbook

Very interesting post indeed, I thought the atom cpus would not be powerful enough, even for the electric pianos. What you can try for the acoustic pianos is to reduce the internal frequency of pianoteq to 22050 or 24000Hz. That should divide the cpu load by 2. I would also be curious to know what value is printed as "performance index" for your eeepc.

However the multicore rendering checkbox should not be grayed since the N270 supports hyper-threading. What is the content of your /proc/cpuinfo ?

Re: Pianoteq on Linux netbook

julien wrote:

Very interesting post indeed, I thought the atom cpus would not be powerful enough, even for the electric pianos. What you can try for the acoustic pianos is to reduce the internal frequency of pianoteq to 22050 or 24000Hz. That should divide the cpu load by 2.

Hey, that works great! I overlooked that, because under options>Devices I only have the Sample rates 44100, 48000, 96000 and 192000 Hz. But under options>Perf I can choose an internal sample rate of 11025, 14700, 22050 and 44100 Hz (as you wrote). With 22050 I can play all Acoustic-Pianos without any glitch, even the performance-hungry preset Grand C3 Solo Recording! I'm a happy camper now. Bought! It is a little pricy (for me), but I want to honour Modartt's engagement in Linux thereby.

I would also be curious to know what value is printed as "performance index" for your eeepc.

After playing a while it shows Performance index 8. But I don't understand, what's the meaning of this index - can you shed a little light on this?

However the multicore rendering checkbox should not be grayed since the N270 supports hyper-threading. What is the content of your /proc/cpuinfo ?

Aha. For comparison I started the eee-pc with a stock kernel (linux-image-2.6.26-1-686) and multicore rendering is greyed/uncheckable there also.
Here the answer to your question with the realtime-kernel:

~# cat /proc/cpuinfo                                                                             
processor       : 0                                                                                   
vendor_id       : GenuineIntel                                                                         
cpu family      : 6                                                                                   
model           : 28                                                                                   
model name      : Intel(R) Atom(TM) CPU N270   @ 1.60GHz                                               
stepping        : 2                                                                                   
cpu MHz         : 1600.000                                                                             
cache size      : 512 KB                                                                               
physical id     : 0                                                                                   
siblings        : 2                                                                                   
core id         : 0                                                                                   
cpu cores       : 1                                                                                   
apicid          : 0                                                                                   
initial apicid  : 0                                                                                   
fdiv_bug        : no                                                                                   
hlt_bug         : no                                                                                   
f00f_bug        : no                                                                                   
coma_bug        : no                                                                                   
fpu             : yes                                                                                 
fpu_exception   : yes                                                                                 
cpuid level     : 10                                                                                   
wp              : yes                                                                                 
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm                                                                                 
bogomips        : 3199.91                                                                             
clflush size    : 64                                                                                   
power management:                                                                                     

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6           
model           : 28         
model name      : Intel(R) Atom(TM) CPU N270   @ 1.60GHz
stepping        : 2                                     
cpu MHz         : 1600.000                             
cache size      : 512 KB                               
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
apicid          : 1
initial apicid  : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm
bogomips        : 3199.89
clflush size    : 64
power management:

- groovy

Re: Pianoteq on Linux netbook

How much does the sound degrade with the sample rate set lower?

I have to admit that I've never fully understood the sample rate setting in PianoTeq. In sample players, I understand it, but in PianoTeq, are the many. many sine waves sampled, somehow, at a given rate before they are played?

Re: Pianoteq on Linux netbook

groovy: thanks, we made a stupid mistake that prevents the linux version from considering your configuration as eligible for multicore rendering. We will update version 3.0.4 very soon on our site. It will be interesting to see if there is a performance improvement or not !

jake: the difference is generally barely noticeable when the rate is set above 22kHz (except for the harpsichords). This is the rate at which the internal engine is generating sound, which is either the soundcard frequency, and half its freq, etc.

Re: Pianoteq on Linux netbook

how come cpuinfo says "cpu cores 1" when there are obviously two of them ?

Re: Pianoteq on Linux netbook

They are virtual cores instead of real physical ones, so they are not counted by the "cpu cores" line. Apparently, one should instead take into account the line "siblings" which is the product of the number of cores per cpu with the number of hardware thread per core.

Re: Pianoteq on Linux netbook

julien wrote:

groovy: thanks, we made a stupid mistake that prevents the linux version from considering your configuration as eligible for multicore rendering. We will update version 3.0.4 very soon on our site. It will be interesting to see if there is a performance improvement or not !

Ah, thanks for that information! The performance on my eee is already very good, but I will let you know, if deactivating multicore has an effect on an Atom N270.

- groovy

Re: Pianoteq on Linux netbook

I connected my eee-pc with USB-interfaces now and something happend, I didn't expect (?!)

First I changend audio-out from Intel HDA to the external USB-Soundcard Edirol UA-1X. The response is not as fast as before. Does the USB-SC add latency???

The same happens, when I connect my Kawai ES3 with its USB-Midi-Out to the eee. I am sure I hear more latency by doing this, than by using the Kawai's standard DIN-Midi-Out with my midi-to-usb-adapter Edirol UM-1SX. Has the USB-Out more latency than the standard DIN-Out? Or can it be, that the Edirol Midi-Interface converts the incoming midi faster to USB, than the Kawai's internal USB-interface?

The whole time I had set Pianoteq to 44kHz,64 samples so this latency remains unchanged.

The Kawai and the Edirol UA-1X are a few years old - do they have too slow chips? Or is USB in general a bottleneck for latency?

The result is, that I only have a good latency using the onboard SC and an external USB-to-MIDI-Konverter. Now I'm curious, if there are even faster converters, than the UM-1SX ... every millisecond less counts!

- groovy

Last edited by groovy (16-06-2009 21:10)

Re: Pianoteq on Linux netbook

Some things to check:

1. Are you using the latest drivers for the Edirol?

2. Does the Edirol support USB version 2.0, and are you sure that you're using that version? (You said that the Edirol was older.) You might also do some research on the usual latency of the Edirol.)

3. Are you using the fastest USB hub on your machine?

4. Do you have other USB devices attached (such as a printer, flash drive, etc) and\or are you using a hub? Unplug them, if so.

5. You might try turning off all of the USB hubs other than those that you are using. My impression is that just having a hub active, even if nothing is plugged into it, can take up some juice.

Re: Pianoteq on Linux netbook

Jake Johnson wrote:

Some things to check:
1. Are you using the latest drivers for the Edirol?

The generic snd_usb_audio from kernel 2.6.29 (or is it from alsa?).

2. Does the Edirol support USB version 2.0, and are you sure that you're using that version? (You said that the Edirol was older.) You might also do some research on the usual latency of the Edirol.)

The usb-audio Edirol UA-1X is USB 1.1. It ist connected with the USB-host (UHCI, USB 1.1) of the eee-pc. As I understand, the transfer is isochronous with 12 Mbit/s from the USB-host to the USB-client and I expect no latency between those peers. I guess a latency is located between the eee-pc and its USB-Interface or between the USB-interface of the UA-1X and its DAC-conversion. Alas I could not find any specs about the latency of this USB-soundcard (or those types in general).

3. Are you using the fastest USB hub on your machine?

I examined USB and found the eee has a second USB-2.0-controller (EHCI), which is only connected with the internal webcam (480 MBit/s) and not with the 3 USB-connectors.

4. Do you have other USB devices attached (such as a printer, flash drive, etc) and\or are you using a hub? Unplug them, if so.

No other USB devices than maximal the both mentioned: UA-1X (audio) and UM-1SX (midi).

5. You might try turning off all of the USB hubs other than those that you are using. My impression is that just having a hub active, even if nothing is plugged into it, can take up some juice.

This is an interesting idea! First I unloaded the module ehci_hcd for the USB-2.0-controller. But it had not much effect (if any).  Then I disabled the (USB-)webcam in the bios and that speeds up the responsivness significantly! (but keep all this with care, it's not impossible that autosuggestion   plays a role, though I guess not).

Btw, just for interest I disabled hyperthreading in the bios, which results in that the OS just founds 1 CPU (and not cpu0 and cpu1 as before). No acceleration effect and I could drive my system to freeze playing the full-blown Grand C3.

Thanks for your answer, Jake!

Last edited by groovy (18-06-2009 11:05)

Re: Pianoteq on Linux netbook

I guess it looks as though the major problem is just that your Edirol sound device is a usb 1.1 device. According to this Roland site -- http://www.roland.com/products/en/_supp...&dsp=1 -- the device will only act as a 1.1 device. From what I've read, the slower usb ports do cause considerably more midi latency.

But am I right in understanding that you are using a generic usb driver? I don't know if Roland\Edirol has a usb driver for this soundcard. However, I did run across this page, on which people discuss their use of various linux drivers with your soundcard: http://www.qbik.ch/usb/devices/showdev.php?id=2327

In addition, might you find someone who has a sound card that uses usb 2.0 to see if it would make a difference?

Last edited by Jake Johnson (18-06-2009 01:30)

Re: Pianoteq on Linux netbook

Hi,

Jake Johnson wrote:

I guess it looks as though the major problem is just that your Edirol sound device is a usb 1.1 device.

why should USB1.1 not be able to provide low latency? Is this documented somewhere?

But am I right in understanding that you are using a generic usb driver? I don't know if Roland\Edirol has a usb driver for this soundcard. However, I did run across this page, on which people discuss their use of various linux drivers with your soundcard: http://www.qbik.ch/usb/devices/showdev.php?id=2327

Thanks, but it seems that link is outdated (2004/2005). I'm not aware of any other drivers/kernelmodules for USB audio-devices than snd_usb_audio under Linux. Every USB1.1 audio device should work. USB2.0 is AFAIK more problematic, because this standard is more open and sometimes firmwares have to be loaded. I never heard about latencies of snd_usb_audio, but maybe I haven't googled enough ;-)   

Troughput of USB1.1 should not be the problem, if the following is approximately right: 44,1 kHz * 16 bit = 0,7 Mbit/s. But USB1.1 provides 12 Mbit/s, which is more than enough.

Re: Pianoteq on Linux netbook

we made a stupid mistake that prevents the linux version from considering your configuration as eligible for multicore rendering. We will update version 3.0.4 very soon on our site

The v3.0.4 is now updated, and hopefully that bug is fixed.

Re: Pianoteq on Linux netbook

Why should USB1.1 not be able to provide low latency? Is this documented somewhere?

My impression is that usb 1.1 is just slower for any data through-put, whether one is moving files over a usb cable or sending out midi data. That's the reason that the standard was upgraded to 2.0.  And I suspect that PianoTeq, particularly, with its high polyphony abilities, might increase the latency.

But I hope I'm wrong. I want you to be able to get this up and running. (So we can all copy your settings and have a portable PianoTeq system without having to build a rack system.)

Have you tried, by the way, using other music programs with the soundcard in the loop? Do monophonic instruments fare better in terms of latency?

Last edited by Jake Johnson (18-06-2009 18:42)

Re: Pianoteq on Linux netbook

julien wrote:

The v3.0.4 is now updated, and hopefully that bug is fixed.

Yes, it is!
A few things I noticed: CPU identification under Pianoteq now shows
Intel(R) Atom(TM) CPU N270 @ 1.60GHz, M12/S2/F6, x2
Before the fix there was  "x1" at the end of the line.

Now I can activate Multicore rendering, and when I do it, I see
"Multi-core: got real-time scheduling with priority 65" at the command line.

The performance is better with Multicore rendering ON. I guess that is the expected behavior. One step more in the right direction! Thanks for your great customer support!

Last edited by groovy (18-06-2009 21:13)

Re: Pianoteq on Linux netbook

Jake Johnson wrote:

Have you tried, by the way, using other music programs with the soundcard in the loop? Do monophonic instruments fare better in terms of latency?

I have very low latency with usb-audio now! The kernel-module("driver") snd-usb-audio has an option to process USB in shorter chunks. The default number of packs is 8 which I now set to 1:
options snd-usb-audio nrpacks=1
(in /etc/modprobe.d/alsa-base.conf to make it bootfix)

The smaller this number is, the better the latency. - Now I feel "connected" with my instrument, which is only possible with low latencies IMHO.

The only other audio-app I tested a few weeks ago was the organ-sim beatrix. Though I only had a standard debian-kernel at that time, it had good performance (and an amazing good sound). With my new RT-environment it will be pleasure, I guess.

cheers

Re: Pianoteq on Linux netbook

... by the way, how would you interprete the following text block in 3.0.4's  README-LINUX.txt?

- with Jack or Alsa, pick-up buffer sizes that are multiple of 64, as
   Pianoteq prefers those sizes. With the Alsa driver, the latency is
   2 times the buffer size (a buffer of 64 samples at 44100Hz gives a
   latency of 2.9 ms).

Is the latency now 2.9ms or 1.5ms when I choose 44100Hz and 64 samples with device type ALSA?

Re: Pianoteq on Linux netbook

Since we are talking netbooks/mini-pc's.... has anyone got Pianoteq to work on one using their standard config with Windows XP ?

"Downing a fifth results in diminished capacity."

Re: Pianoteq on Linux netbook

Is the latency now 2.9ms or 1.5ms when I choose 44100Hz and 64 samples with device type ALSA?

It is 2.9ms. With jack, it depends on the number of periods/buffer you choose. With 2 periods/buffer and a block size set to 64 samples/period you get 1.5ms, with 3 periods/buffer you get 2.9ms, etc. with n periods you get (n-1)*1.5 ms

Re: Pianoteq on Linux netbook

julien wrote:

Is the latency now 2.9ms or 1.5ms when I choose 44100Hz and 64 samples with device type ALSA?

It is 2.9ms. With jack, it depends on the number of periods/buffer you choose. With 2 periods/buffer and a block size set to 64 samples/period you get 1.5ms, with 3 periods/buffer you get 2.9ms, etc. with n periods you get (n-1)*1.5 ms

Hmh, I'm using Alsa directly without jackd, so I can't choose the number of periods. I guess, 2 periods is ALSA's default then, when 2,9ms is the right value. Thanks for clearification, the GUI is a little confusing, but the README-LINUX.txt nails it.

Re: Pianoteq on Linux netbook

There was one more option for acceleration: the script rtirq.sh by  Rui Nuno Capela.
It has to be started once and gives a higher priority to the IRQs of the sound-hardware (clock, sound-driver, usb).

Afterwards I have these RealTime-priorities

# ./rtirq.sh start
Setting IRQ priorities: start [rtc] irq=8 pid=371 prio=90: OK.
Setting IRQ priorities: start [snd] irq=16 pid=867 prio=85: OK.
Setting IRQ priorities: start [uhci_hcd] irq=18 pid=862 prio=79: OK.
Setting IRQ priorities: start [uhci_hcd] irq=19 pid=858 prio=78: OK.
Setting IRQ priorities: start [uhci_hcd] irq=23 pid=851 prio=77: OK.
Setting IRQ priorities: start [i8042] irq=1 pid=364 prio=75: OK.
Setting IRQ priorities: start [i8042] irq=12 pid=363 prio=74: OK.

Before all IRQs had the same priority:

# ./rtirq.sh status
  PID CLS RTPRIO  NI PRI %CPU STAT COMMAND
   91 FF      50   -  90  0.0 S<   IRQ-9
  363 FF      50   -  90  0.0 S<   IRQ-12
  364 FF      50   -  90  0.0 S<   IRQ-1
  371 FF      50   -  90  0.0 S<   IRQ-8
  851 FF      50   -  90  0.0 S<   IRQ-23
  858 FF      50   -  90  0.0 S<   IRQ-19
  862 FF      50   -  90  0.0 S<   IRQ-18
  867 FF      50   -  90  0.0 S<   IRQ-16
  917 FF      50   -  90  0.0 S<   IRQ-14
  918 FF      50   -  90  0.1 S<   IRQ-15
2559 FF      50   -  90  0.0 S<   IRQ-28

Ready to play now ...

Re: Pianoteq on Linux netbook

Ready to play?? No, no, no. Forget all of this playing business. Show us how to set this up.

Re: Pianoteq on Linux netbook

Groovy--On a more serious note, have you read the new thread about using one of the micro boards from Gumstix, which also uses linux?

Re: Pianoteq on Linux netbook

hello all of you... wow... i am very impressed and very interested in what is going on here...
i have been looking for a solution to travel with a netbook and a midi controller... just to practice a bit, do some writing, and possibly even use for some less important gigs...
so, i have a few questions... i am a TOTAL BEGINNER here... happy mac user for about 1 year only, and very frustrated PC user for the 15 years prior! never used LINUX before.

1. what is the hardware that you are using - eeepc? which model? does it matter, or does it matter more which Linux kernel? have you tried this configuration on other hardware - i.e. I AM CURIOUS TO KNOW WHICH NETBOOK I SHOULD BUY ...

2. Linux Build - which kernal are you using...? and HOW ON EARTH can i set it up so that it works as well as it does for you? i am a total beginner with this, so please be gentle!

3. what other software is required, and how can i install? i read about JACK and other patches to linux...

4. is it possible that you can compile a boot file to obtain the same settings? in the same machine? on a different machine?

you have really done alot of work here, and something that i'm sure ALL pianists would LOVE to get their hands on... you should be rewarded for your hard work!

please post a reply.
johnroney

Re: Pianoteq on Linux netbook

follow up to question....

maybe some of you can suggest...
i'd be looking for a scenario where i had a NETBOOK of some sort (skype/internet/calendar) that i could plug a midi controller into (m-audio usb controller, usb midi cable, or other) and playback a variety of softsynths from the internal soundcard at LOW LATENCY. it would be cool to have a basic writing program too...

right now, i'm on macbook pro, with logic 9 and mainstage, and have an external audio device and blah blah blah... too heavy, too expensive, too precious to throw into a backpack on a greyhound bus. i need something that i can replace easily (i.e. a $300 netbook) and that i can REBOOT if replaced... (reinstall simply and effortlessly).

ok. thanks... sorry to be the 'new guy' here... but you should all really start a website! there are tons of people wanting what you're working on!

Re: Pianoteq on Linux netbook

johnroney wrote:

follow up to question....

maybe some of you can suggest...
i'd be looking for a scenario where i had a NETBOOK of some sort (skype/internet/calendar) that i could plug a midi controller into (m-audio usb controller, usb midi cable, or other) and playback a variety of softsynths from the internal soundcard at LOW LATENCY. it would be cool to have a basic writing program too...

I'm assuming that you're considering also a Windows netbook. My system works pretty well and is pretty painless :

Asus 1005HAB netbook
2GB RAM
internal soundcard using Asio4All (as driver for low latency)
Cantabile VST host (to run multiple applications at once)

As mentioned in various posts, you need to lower the internal Pianoteq sample rate to 24K or below in order to get good performance. For live, this is just fine AFA sound quality. You might want to search the keyword 'netbook' to check out various tweaks and settings.