[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: playing midi with timidity

On Sun, 18 Sep 2005 11:50:15 +0100
Joe Mc Cool <joe@benburb.demon.co.uk> wrote:

> Please,
> when I try to play sound with alsa under a 2.6 kernel, the quality is
> awful, the system seems to repetitively play little snatchs of my tune
> over and over, superimposing some of the sound on top of what it has
> already played.

Check the capture level, the iec958 levels, mute any inputs not being
used, and try changing what is selected as the recording device. 

> Essentially my perl script is:
> system("timidity -L /usr/share/timidity -Ou -o$au_file $midi_file > /tmp/timidity 2> /dev/null");
> system("play -v $volume $au_file ");	

What is the reason for sending the output to a file and then playing
back the file instead of letting timidity send the output directly to
the audio device?

My scripting knowledge is close to non existent. If the intention is to
create a file in /tmp/timidity then play back that file and that is
what actually happens then it doesn't seem like there should be any
issues there. If the file is being played back as it is being created
that could lead to some oddities, but would then lead to a question of
why does it work with an older kernel using the OSS driver and not with
the 2.6 kernel using the alsa driver.

> lsmod | grep snd:
> snd_seq_oss            34656  0 
> snd_seq_midi            8576  0 
> snd_seq_midi_event      7680  2 snd_seq_oss,snd_seq_midi
> snd_seq                53872  6 snd_seq_oss,snd_seq_midi,snd_seq_midi_event
> snd_ens1371            24932  0 
> snd_rawmidi            25124  2 snd_seq_midi,snd_ens1371
> snd_seq_device          8200  3 snd_seq_oss,snd_seq_midi,snd_rawmidi
> snd_pcm_oss            55080  0 
> snd_mixer_oss          20096  1 snd_pcm_oss
> snd_pcm                98728  2 snd_ens1371,snd_pcm_oss
> snd_page_alloc         11752  1 snd_pcm
> snd_timer              25732  2 snd_seq,snd_pcm
> snd_ac97_codec         69988  1 snd_ens1371
> snd                    57156  13 snd_seq_oss,snd_seq_midi,snd_seq_midi_event,snd_seq,snd_ens1371,snd_rawmidi,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_ac97_codec
> soundcore              10336  1 snd
> gameport                4704  1 snd_ens1371

This is a pretty standard set of modules. I've used Ensoniq based
hardware in the past and currently have one system with an Ensoniq
chipset for the onboard audio. I have had issues with static in the
audio when the capture level is not set at a low level and the iec958
stuff is not muted, but that doesn't account for bit of the file being
played again.

> If I revert to a 2.2 kernel and use the oss drivers, everything is
> fine.

This leads to the question, if you use the 2.6 kernel with the OSS
driver does it work then?

> But with 2.6 and alsa I can use mplayer and listen to BBC Radio 3, no
> problem.

This just seems odd. What about audio in other applications? If it
only sounds bad with Timidity while using your script that would seem
to indicate the issue is in the Timidity configuration or in the

Later, Seeker 

Reply to: