#3 kmetronome only ever plays one note

closed-fixed
KMetronome (2)
5
2009-12-30
2009-12-30
Dave
No

On my gentoo system (kernel 2.6.31 qt 4.[56] kde4.3) kmetronome compiles fine.
When started the program plays exactly one note and stops at measure 1:01. This can't be an output problem since the problem persists after selecting 'no connection' as output. This applies to all versions from 0.7 to 0.9.2 (and earlier qt/kde versions)

Discussion

  • Hi,

    I've changed the tracker category from Bugs to Support Requests, because your problem can't be solved in kmetronome patching the program's code itself. It is probably a configuration, kernel, ALSA or hardware problem. I will do my best trying to help you to solve the issue, though.

    The behavior you are describing is consistent with a typical ALSA timer configuration problem. To test if this is the case, please use the program aplaymidi (from alsa-utils) in a terminal session playing any MIDI file, and report the results. It may happen that aplaymidi plays only the first note, too.

    I also need that you post the results of the following commands, executed while kmetronome and aplaymidi are running:
    # cat /proc/asound/timers
    # cat /proc/asound/seq/timer

    Regards,
    Pedro

     
    • labels: 1165727 --> KMetronome
     
  • Dave
    Dave
    2009-12-30

    This does seem to be an alsa timing problem: aplaymidi also only plays the first note.

    $ cat /proc/asound/timers
    G0: system timer : 1000.000us (10000000 ticks)
    G1: RTC timer : 976.562us (100000000 ticks)
    Client sequencer queue 0 : stopped
    C0-0: EMU10K1 timer : 20.833us (1024 ticks)
    P0-0-0: PCM playback 0-0-0 : SLAVE
    P0-0-1: PCM capture 0-0-1 : SLAVE
    P0-0-2: PCM playback 0-0-2 : SLAVE
    P0-0-4: PCM playback 0-0-4 : SLAVE
    P0-0-6: PCM playback 0-0-6 : SLAVE
    P0-0-8: PCM playback 0-0-8 : SLAVE
    P0-0-10: PCM playback 0-0-10 : SLAVE
    P0-0-12: PCM playback 0-0-12 : SLAVE
    P0-0-14: PCM playback 0-0-14 : SLAVE
    P0-0-16: PCM playback 0-0-16 : SLAVE
    P0-0-18: PCM playback 0-0-18 : SLAVE
    P0-0-20: PCM playback 0-0-20 : SLAVE
    P0-0-22: PCM playback 0-0-22 : SLAVE
    P0-0-24: PCM playback 0-0-24 : SLAVE
    P0-0-26: PCM playback 0-0-26 : SLAVE
    P0-0-28: PCM playback 0-0-28 : SLAVE
    P0-0-30: PCM playback 0-0-30 : SLAVE
    P0-0-32: PCM playback 0-0-32 : SLAVE
    P0-0-34: PCM playback 0-0-34 : SLAVE
    P0-0-36: PCM playback 0-0-36 : SLAVE
    P0-0-38: PCM playback 0-0-38 : SLAVE
    P0-0-40: PCM playback 0-0-40 : SLAVE
    P0-0-42: PCM playback 0-0-42 : SLAVE
    P0-0-44: PCM playback 0-0-44 : SLAVE
    P0-0-46: PCM playback 0-0-46 : SLAVE
    P0-0-48: PCM playback 0-0-48 : SLAVE
    P0-0-50: PCM playback 0-0-50 : SLAVE
    P0-0-52: PCM playback 0-0-52 : SLAVE
    P0-0-54: PCM playback 0-0-54 : SLAVE
    P0-0-56: PCM playback 0-0-56 : SLAVE
    P0-0-58: PCM playback 0-0-58 : SLAVE
    P0-0-60: PCM playback 0-0-60 : SLAVE
    P0-0-62: PCM playback 0-0-62 : SLAVE
    P0-1-1: PCM capture 0-1-1 : SLAVE
    P0-2-0: PCM playback 0-2-0 : SLAVE
    P0-2-1: PCM capture 0-2-1 : SLAVE
    P0-2-2: PCM playback 0-2-2 : SLAVE
    P0-2-4: PCM playback 0-2-4 : SLAVE
    P0-2-6: PCM playback 0-2-6 : SLAVE
    P0-2-8: PCM playback 0-2-8 : SLAVE
    P0-2-10: PCM playback 0-2-10 : SLAVE
    P0-2-12: PCM playback 0-2-12 : SLAVE
    P0-2-14: PCM playback 0-2-14 : SLAVE
    P0-3-0: PCM playback 0-3-0 : SLAVE
    P1-0-0: PCM playback 1-0-0 : SLAVE
    P1-0-1: PCM capture 1-0-1 : SLAVE
    P1-1-0: PCM playback 1-1-0 : SLAVE
    P1-1-1: PCM capture 1-1-1 : SLAVE
    P1-2-1: PCM capture 1-2-1 : SLAVE

    $ cat /proc/asound/seq/timer
    Timer for queue 0 : RTC timer
    Period time : 0.000976562
    Skew : 65536 / 65536
    Timer for queue 1 : RTC timer
    Period time : 0.000000000
    Skew : 65536 / 65536

     
  • Yes, the default timer for your system is the RTC timer, which is usually a good choice, but in your case it is not working, I don't know why. Anyway, the other timer (G0: system timer) has a good frequency (1000 Hz) so I would try to use it as the default timer for ALSA sequencer applications.

    You can use kernel module options to do it. I set that options in a file named "/etc/modprobe.d/sound" , or maybe in "/etc/modprobe.conf.local" but I don't know the exact file names in Gentoo. Anyway, the settings for using the system timer by default are:

    options snd-seq seq_default_timer_class=0 seq_default_timer_sclass=0 seq_default_timer_card=0 seq_default_timer_device=0

    (it needs to be a single text line)

    The RTC timer would be seq_default_timer_device=1

    After changing the modprobe configuration, you need to restart your system or reload ALSA:
    # /etc/init.d/alsasound restart

    Regards,
    Pedro

     
  • Sorry, my mistake. The first parameter named seq_default_timer_class must be 1 instead of 0. System global timers have a class=1.

    Regards,
    Pedro

     
  • Dave
    Dave
    2009-12-30

    The problem is now fixed: the RTC in the kernel was wrongly configured

     
  • Dave
    Dave
    2009-12-30

    • status: open --> closed-fixed