Got sound but no music under linux, ubuntu

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
Tuffy
Engineer
Engineer
Posts: 1
Joined: 18 Feb 2007 15:02

Got sound but no music under linux, ubuntu

Post by Tuffy »

I can only hear the sounds while in game, not the music. Ive copied all the .gm files from the original game to the necessary folders, and while in game, when I press the jukebox button, it speeds through all the songs. Like when you have the song files, but they are empty. However, I already checked this and the files have (I think) the correct sizes.

Im running Ubuntu Edgy Eft, with a USB headset.

thanks for any help,
brazso
Engineer
Engineer
Posts: 2
Joined: 18 Feb 2007 21:24
Location: Budapest, Hungary

Post by brazso »

Hi Tuffy,

I have experienced the same problem, but I know that my sound card does not play midi files in linux/alsa. At least so far I could not set it up with my SB Audigy LS. Can you play other midi files?

brazso
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Do you have timidity or some other midi player on your system? You either need to specify it yourself, or compile it into openttd.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
phil88
Transport Coordinator
Transport Coordinator
Posts: 267
Joined: 25 Jan 2007 23:26

Post by phil88 »

You might find this useful. You need to set ubuntu up to be able to play midi.
- Phil
brazso
Engineer
Engineer
Posts: 2
Joined: 18 Feb 2007 21:24
Location: Budapest, Hungary

Post by brazso »

Thanks Darkvater and phil88. Based on your instructions, I have installed timidity and the midi files are being played well in the game.
apdt
Engineer
Engineer
Posts: 2
Joined: 06 May 2007 17:45
Location: London

Post by apdt »

brazso wrote:Hi Tuffy,

I have experienced the same problem, but I know that my sound card does not play midi files in linux/alsa. At least so far I could not set it up with my SB Audigy LS. Can you play other midi files?

brazso
I have managed to get openTTD to play music using my SB Live's wavetable. This way it's not using timidity and caning my CPU.

I'm running Ubuntu Feisty (7.04), so adjust as necessary for your distro.

First install the awesfx package.
Then find the files 8mbgmsfx.sf2 4gmgsmt.sf2 and 2gmgsmt.sf2 from the SB Live installation CD (or somewhere on your windows partition) and put them into /usr/share/sounds/sf2

Run

Code: Select all

asfxload 8mbgmsfx
to load the soundfont into the sound card.

Next run

Code: Select all

aplaymidi -l
You should see output something like this:

Code: Select all

 Port    Client name                      Port name
 14:0    Midi Through                     Midi Through Port-0
 16:0    SBLive 5.1 [SB0060]              EMU10K1 MPU-401 (UART)
 17:0    Emu10k1 WaveTable                Emu10k1 Port 0
 17:1    Emu10k1 WaveTable                Emu10k1 Port 1
 17:2    Emu10k1 WaveTable                Emu10k1 Port 2
 17:3    Emu10k1 WaveTable                Emu10k1 Port 3
Note the port for Emu10k1 Port 0 (17:0 in this case)

run the following substituting for the port above.

Code: Select all

export ALSA_OUTPUT_PORTS="17:0"
you should now be able to use aplaymidi to play one of the gm files from the gm directory.

Assuming That worked correctly, the last step is to edit ~/.openttd/openttd.cfg

In the [music] section set the extmidi line to:

Code: Select all

extmidi = /usr/bin/aplaymidi
You should now have midi sound woring in openttd without it eating up all your CPU time.

good luck,
Alex
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

Would you mind adding this in the wiki? (at the right place of course). Would be very useful! Tnx :)
The only thing necessary for the triumph of evil is for good men to do nothing.
Sacro
Tycoon
Tycoon
Posts: 1145
Joined: 18 Jun 2005 21:08
Location: Here
Contact:

Post by Sacro »

Indeed, I shall be trying it later (I only just realised my soundcard supports it!)
We Am De Best

Host of ThroughTheTube site
apdt
Engineer
Engineer
Posts: 2
Joined: 06 May 2007 17:45
Location: London

Post by apdt »

TrueLight wrote:Would you mind adding this in the wiki? (at the right place of course). Would be very useful! Tnx :)
No problem. See here.

I've put it in the Installation Category, but I haven't linked to it from anywhere yet. I'm still finding my way round the wiki. Suggestions/improvements welcome.

thanks,
Alex
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: Amazon [Bot] and 4 guests