The game (Heretic for now) is set up so the sound plays via SoundBlaster and the music plays via General MIDI. The result is that you hear only sound but not the music. You think that music just doesn't work or is not configured properly, but...
If you plug in a USB sound device (external speakers, headset, etc.), you hear:
sound --- in --- external audio device
music --- in --- standard laptop speakers
So the sound has the priority to take any audio device. Than the rest devices are for music...
But why? How can I set [I don't know what] to get sound *and* music via *one* device?
I'm warning this may seem a bit long, but if you want a detailed (guessed) explanation then you're welcome to read it 😀. A solution is given later.
What you experience seems to be related to an old user permissions issue. As of Ubuntu 12.04, by default, a TiMidity daemon is up, running under a "timidity" account. This is (almost surely) not the user account you've chosen, thus resulting in some issues.
For the game Duke Nukem 3D, I can't get the setup program within DOSBox to play MIDI. On the other hand, the external "aplaymidi" app does work for me (using 'aplaymidi -p 128:0 path/to/somefile.mid').
Now, though, one can load the "Sound" dialog (from the volume indicator, or by typing 'gnome-control-center sound-nua' in a terminal), and change to the "Applications" tab. Here, you should see the various apps' sound outputs. aplaymidi does not appear. That could be a side-effect of TiMidity running under a different account.
Another relevant test: Try loading 'aplaymidi' while another app is playing digitized sound (e.g a WAV file). You wouldn't hear one of these playing, at least. This is basically a user-accounts related conflict.
------
Alright, here is the solution:
- A little verification: Load some terminal and type:
1aconnect -l -o
You should currently see an appearance of the TiMidity client, associated with "client 128" and four ports. Here is the list shown here (where yours may vary in some way):
1client 14: 'Midi Through' [type=kernel] 2 0 'Midi Through Port-0' 3client 128: 'TiMidity' [type=user] 4 0 'TiMidity port 0 ' 5 1 'TiMidity port 1 ' 6 2 'TiMidity port 2 ' 7 3 'TiMidity port 3 '
- Disable the TiMidity daemon as currently being started on boot. To do this, edit the /etc/default/timidity file. Look for a commented line of "TIM_ALSASEQ=false". As hinted in the file itself, you should uncomment this.
- Reboot.
- Retype "aconnect -l -o" into a terminal. You should not see the TiMidity client this time. The relevant output here is:
1client 14: 'Midi Through' [type=kernel] 2 0 'Midi Through Port-0'
- Start a TiMidity daemon under your own account. You can type this, for instance:
1timidity -Os -iAD
- Retype "aconnect -l -o". Ports 128:0 to 128:3 should be up again. The output I can see is:
1client 14: 'Midi Through' [type=kernel] 2 0 'Midi Through Port-0' 3client 128: 'TiMidity' [type=user] 4 0 'TiMidity port 0 ' 5 1 'TiMidity port 1 ' 6 2 'TiMidity port 2 ' 7 3 'TiMidity port 3 '
- Try it within DOSBox.
- Also notice that, if you attempt use aplaymidi, it is displayed in the list of apps within "Sound".
- To make the change permanent: Load an application named... that's right, "Startup Applications". The command line way is "gnome-session-properties".
- Add a new entry with a name of your choice, and "timidity -Os -iAD" as the command.
10) Now, whenever you login as the current user, a TiMidity daemon should start under the same account.
A WORD OF WARNING: If you logout and then login immediately, the logout itself would not trigger a shut-down of the TiMidity daemon, yet another such daemon would be started. So two instances of TiMidity would be up, the new one taking ports 129:0 to 129:3 by default.
At first, forgive me for a little mistake: I use Ubuntu *11*.04... But no matter.
Thank you! Really! It worked. Honestly I haven't thought that the first comment will be the full detailed explanation and solution...
I'm just sorry that doesn't see any option like karma or reputation adding - to thank you somehow. 😀
Yes, I've done eveything by your instroctions and got a full sound and music combinationvia one audio source. And yes, TiMidity started by default under own user, not mine.