Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#5887 closed defect (fixed)

PSP: No music in TeenAgent

Reported by: (none) Owned by: digitall
Priority: normal Component: Engine: TeenAgent
Version: Keywords:
Cc: Game: TeenAgent


I am trying to play Teen Agent on PSP using scummvm 1.3.1. The game starts and there are sounds, but there is no music. I have tried copying the teenagent.dat file to game directory too but it did not help. Teenagent is downloaded from Under Windows with Scummvm 1.3.1 it works fine.

Am I missing something here? Or is this simply not supported under PSP?

Note that other games, work fine:they have both sounds and music.

Ticket imported from: #3428161. Ticket imported from: bugs/5887.

Attachments (1)

Teenagent.md5 (690 bytes ) - added by SF/*anonymous 12 years ago.
Teenagent md5

Download all attachments as: .zip

Change History (28)

comment:1 by SF/megath, 13 years ago

Grepping the sources indicates that teenagent is one of two engines, who use paula emulation code for music. Could you try operation stealth or future wars on psp?

comment:2 by (none), 13 years ago

I've tried Operation Stealth and there was music.

comment:3 by SF/megath, 13 years ago

Maybe someone stole another file descriptor :( Did you experience freezes while saving/loading?

comment:4 by SF/megath, 13 years ago

Just tested on my psp (slim), and music works fine. Please check you've copied mmm.res file along with other game files.

comment:5 by SF/megath, 13 years ago

After more intense testing I found out that music randomly stops playing one of four or maybe five restarts.

comment:6 by SF/megath, 13 years ago

I found that music loading code lacks proper locking, but unfortunately I don't have setup for psp building right now, so cant check by myself. Please check next dev build (commit 5b89ef436628f8e1c82d4067abad6fed6f393d1b) by chance.

comment:7 by (none), 13 years ago

Saving/Loading - no freezez, but I only use the scummvm save/load feature. Don't know how to bring up the in-game one under PSP.

I checked and all the files are there. Can You share what setup do You have? Mine is: PSP Slim 3004 with original firmware 6.60. Scummvm 1.3.1 running through Half Byte Loader R118

comment:8 by (none), 13 years ago

I have just tried the latest stable scummvm: 1.4.0pre27-g29dd6df with the newest teenagent.dat file and it is still the same - no music.

Can you tell me how can I enable some logs to help resolve this problem?

comment:9 by (none), 13 years ago

Can You help please?

comment:10 by SF/koima57, 13 years ago

Same on PSP and Wii port, no music only some sound effects.

comment:11 by (none), 12 years ago

Any chance fixing this up?

comment:12 by (none), 12 years ago

Resolution: wontfix

comment:13 by (none), 12 years ago

What is the status of this item?

comment:14 by wjp, 12 years ago

Resolution: wontfix

comment:15 by wjp, 12 years ago

Please don't play with the settings of tracker entries.

comment:16 by digitall, 12 years ago

Summary: No music in TeenAgent under PSPPSP: No music in TeenAgent

comment:17 by digitall, 12 years ago

Jota: Sorry about the wait, but our PSP porters are very busy and tracking these down can take a fair amount of time.

To help us, please can you do the following: 1. Attach a file listing of your Teenagent datafiles with file MD5sums to this bug as a text file? This is to eliminate missing or corrupted datafiles and ensure we know the exact version you are using. The output of a tool such as would be optimal.

2. Please can you test with v1.3.1, v1.4.0, v1.4.1 and the latest git development snapshot from: and report the behaviour with each as a comment here. This is so we can ensure the bug is stil occuring and has not been fixed since you initially reported this bug.

3. If all these versions exhibit no music, then can you test previous versions: v1.3.0, v1.2.1 etc. until you find one where the music worked and report the behaviour with each as a comment here. This is so we can locate if this is a regression from a previous version and thus locate the point at which the regression occurred.

comment:18 by digitall, 12 years ago

4. If you can setup a PC emulator for PSP and try this within it, the emulator debug output log may give some inication of what is going wrong with the music output.

5. If you (or a friend who you can bribe with Money, Beer or Pizza) are capable of C/C++ development and you really want this fixed, then our source code is freely available at: and we provide a PSP compilation guide at, so please feel free to look at why this is happening, fix it and file this as a Github Pull Request!

P.S. Please note, that I am not a PSP porter or Teenagent engine developer and only trying to provide some bug triage assistance and general help.

comment:19 by eriktorbjorn, 12 years ago

I tried this a couple of times, and if I run ScummVM in Valgrind (which, in addition to providing often useful error messages, also slows down things nicely) I never get any music during the intro. Running normally, there was only once that I didn't get any music.

I think what may be happening is that ScummVM starts playing the music before actually loading the first music into memory. I'm thinking of these two lines in TeenAgentEngine::run() specifically:

_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, music, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, false); setMusic(1);

The mixer runs in a separate thread, and usually it gets past setMusic(1) before it tries to generate any sound from the channel. But if things happen just right, or you're running on a slower system (or deliberately slow it down with Valgrind or by adding a deliberate call to delayMillis() between the lines), the mixer will try to generate sound from the channel (see MixerImpl::mixCallback() in audio/mixer.cpp), decide that it has reached the end of the stream (_channels[i]->isFinished() returns true) and delete the channel.

At least, I would guess that this is what happens. Changing the order of the two lines seems to fix things for me. I don't know for sure that this doesn't have any bad side effects, but it seems like a reasonable fix to me.

comment:20 by digitall, 12 years ago

eriktorbjorn: Thanks. I concur.

Have committed a fix for this to master as 52a1a6e60b418f9f0bcca9b12ef631f6f8176786.

Jota / koima57: Please check with the next nightly builds for PSP/Wii from buildbot: and confirm here if this fixes this for you.

comment:21 by digitall, 12 years ago

Owner: set to digitall
Resolution: fixed
Status: newpending

by SF/*anonymous, 12 years ago

Attachment: Teenagent.md5 added

Teenagent md5

comment:22 by (none), 12 years ago

Status: pendingnew

comment:23 by (none), 12 years ago


Sorry for the late response.

I tried running latest fix, from 20th of August and whenever I started Teenagent with this build it crashed/switched off my psp. All other games work fine with this build (like for example Indiana Jones and the fate of Atlantis).

Maybe I have failed to mention that I am running scummvm through Half Byte Loader Version : rev 118 for 6.60 original PSP firmware? Should I be doing this any other way?

To answer the questions/suggestions

1. Attached is the MD5 sum of the Teenagent version I use.

2. I can only find 1.4.1 version for PSP on the download page. Please help to find other stable releases for psp including the latest one.

3. same as point no 2

4. I will set it up and let you know

5. I will see what I can do and let you know.

comment:24 by SF/nitrus, 11 years ago

On a PSP 2000, firmware version 5.00 M33-6, using ScummVM 1.41:

There indeed is no music (sound runs good), or at least it seems so. I tried overriding global audio settings, and then change the music device to something like the AdLib emulator, or FM-Towns, and the music worked too.

Though when I restarted the game (Return to launcher -> Start Game), the music was gone again. Tried changing the device again to something else, and the music was back.

Perhaps this might provide some insight.

comment:25 by SF/nitrus, 11 years ago

I have just compiled ScummVM 1.7.0git459-g539c631-dirty (May 22 2013 21:25:32), with zlib 1.2.8 and libpng 1.2.50 and I'm on a PSP2003, under 5.00 M33-6.

Tried it multiple times, and I can confirm that the game works fine, music is always present, no matter if I restart it.

comment:26 by digitall, 11 years ago

nitrus: Thank you for confirming this. Closing as fixed.

comment:27 by digitall, 11 years ago

Status: newclosed
Note: See TracTickets for help on using tickets.