Macintosh Portable: "pop" noise every 10s from Speaker & Headphones

SuperSVGA

Tinkerer
Mar 26, 2022
64
34
18
I think I see what's doing it in the Portable Control Panel 1.3. Included are two ROM patches, one replacing the BatWatch VBL task and one for the SndWatch VBL task I posted earlier.
I believe the BatWatch patch is to add dimming of the backlight when the battery is low and a new message for backlights.

This is the SndWatch patch:
Code:
    movea.l     PowerMgrVars,A2
    lea         (SwVBLTask,A2),A0
    move.w      #600,(vblCount,A0)
    subq.w      #4,SP
    movea.l     SP,A0
    move.w      #soundRead,D0
    movea.l     #PMGRrecv,A3
    jsr         (A3)
    move.b      (A0),D2
    btst.l      #1,D2
    beq.b       .L1
    bsr.w       PMGRsend
    _IdleUpdate
.L1:
    move.b      #3,(A0)
    moveq       #1,D1
    move.w      #soundSet,D0
    movea.l     #PMGRsend,A3
    jsr         (A3)
    addq.w      #4,SP
    rts

If you compare it with the SndWatch code I posted earlier, you'll notice they completely removed both the code to turn off sound power, as well as the code to only turn sound power on if it's currently off. The command to turn sound on and clear the sound latch is always sent every 10 seconds.

There's also a note included to "leave sound power on for backlit units due to noise problems" though I'm not sure whether the noise is referring to the sound or the backlight.

Since the M5126 has the ability to even turn sound off removed, turning the sound off doesn't do anything. However the command has two bits, bit 0 turns the sound off and bit 1 clears the latch on VIA bit 7. Clearing the latch on bit 7 likely makes the other piece of code think that sound was turned on and plays the "pop".

The only place where this code would really do anything is on the M5120 Portable with a backlight upgrade, since power to the sound can still be turned off there. At least they implemented the backlight properly on that card, unlike the shortcut they took with the M5126 ruining a bunch of undocumented functionality (such as 9MB of RAM).
 
  • Like
Reactions: JDW and nottomhanks

nottomhanks

Tinkerer
Oct 31, 2021
123
57
28
So that command line I tested last night is disabling only U14A, while leaving U15B & U15C enabled, correct?

View attachment 15985

I can only assume so because as I said last night, the background noise all went away when I tested your suggested command line, but the pop sound every 10 seconds remained audible (only when I have the v1.3 "Portable" Control Panel active at boot time, of course).

I purchased other capacitor types because someone on FaceBook said he thought the use of polymer Tantalum caps on C9/10/11 to be a problem, but I've not swapped out those caps yet because the pop every 10 seconds is totally gone when I boot System 6.0.7 or 6.0.8 without the v1.3 "Portable" control panel. If the caps caused the pop, then it's only logical to conclude the pop would never go away. It does go away when the v1.3 control panel is not used, so the caps cannot be related to the pop at all. As to whether the cap type has an impact on the other background noise, that's something I've not experimented with yet.

Anyway...

@SuperSVGA , please let me know your thoughts in light of this. And please know I really do appreciate all your kind help to date!
Hi James. I did some testing today, and was able to verify some of your findings. I’ve posted a YouTube video here:

Please have a look at it, although it’s not nearly as technical as everything listed here. It seems to me that the posting about the audio circuitry going to sleep does have something to do with this.

Let me know your thoughts.

Craig Learmont
 
  • Love
Reactions: JDW

JDW

Administrator
Staff member
Founder
Sep 2, 2021
1,655
1,415
113
53
Japan
youtube.com
@nottomhanks
Craig, THANK YOU! You sir, have the honor of being the first person who has made time to test in a similar manner to me and who has confirmed what I have confirmed! I am overjoyed at this testing because it is critically important to establish the baseline noise and what is considered "normal" for Portables, especially the 5126 Backlit model, which is what you and I both have.

NOTES from your video and my own past testing in this thread:
  1. Popping happens in System 7, most likely due to the Brightness Control Panel, although I've not tested System 7 without that control panel yet.

  2. Popping happens in System 6 only when you have the "Portable" control panel version 1.3 installed. In your video at about 9:50, I could not see that you had any version of the "Portable" control panel installed, which is why you did not hear a pop while running System 6. Please visit this page on Macintosh Garden and grab Download #4. That is the v1.3 Portable control panel. Drop that into your System 6 System Folder, restart, then you will hear the pop every 10 seconds. (And you can now change the brightness!)

  3. When Volume is set to 0, you cannot hear the pop. That is because the pop volume intensity varies by the Volume setting in MacOS. Turning volume to max (7) makes the pop louder.

  4. Listening with HEADPHONES via the headphone jack will allow you to hear the pop more clearly, but as you can see, even with airplanes overhead and your son jumping upstairs, you could still hear the pop via the speaker, even when the volume wasn't set to max. I would recommend you listen by headphones because you will hear background noise too, most likely, just as I do, which is inaudible through the main speaker. That background noise is separate from the pop sound. And in my case, the background noise is mostly in the RIGHT EAR, not the left.

  5. Yes, there is a single, non-repeating pop that occurs sometimes a few seconds after a sound is played, just as you showed. But because it is not repeating, it is not annoying, so I have not been so concerned about that. But yes, that does occur.

  6. The backlight being on does make a slight whine typical of EL backlights. But that sound has never annoyed me because (1) I expect to hear that when an EL backlight is on, (2) it doesn't vary with volume, (3) it is consistent while the backlight is on, and (4) it is not too loud. That EL backlight sound is not the same as the whine I hear in the right ear while listening via the headphone jack. The sound I head with headphones is present regardless of volume setting, and regardless of whether the backlight is ON or OFF. It becomes hard to hear sometimes when the other background noise in the right EAR becomes very loud due to the number of windows you have open at any given time. You confirmed that your own noise changes with the number of windows open. Thank you for confirming that!

  7. You seem to be using a battery (both lead acid main battery and the 9V PRAM battery) with AC Adapter ("power supply") attached, whereas I am using the Battery Eliminator by @Androda in conjunction with a fully recapped Portable AC Adapter. I appreciate your test because it crushes all the theories that suggested I am hearing the pop only because I am using something other than the normal Lead Acid main battery! Ha! Regardless of the power source, that pop every 10 seconds exists! I know it also exists if I yank the AC Adapter cord, because the super capacitors in the Battery Eliminator keep the Portable alive for about 12 seconds before they die — I still hear the pop in that case too.

  8. I too am using a BlueSCSIv2. However, the pop every 10 seconds occurs even without using any SCSI drive and when only booting from a real floppy disk or from a disk image on a FloppyEMU. It is absolutely not SCSI-related.

  9. My motherboard is fully recapped, like yours. However, I have not replaced the 2 caps inside the LCD yet, which are on the backlight inverter PCB. I had completely forgotten about those!

  10. I too have a MacEffects 7MB RAM Card. I can confirm that all the noises I've reported still exist even without that Card installed.

Two other observations from your video:
  1. I see you have a slight darkening in the upper left and lower left corners of your LCD. I have the same thing in only the lower left corner. I've not left my Portable on for more than 30 minutes at a time, so I cannot say if the darkening gets much worse as you leave the machine on. But I have notices that there is no darkening at all for the first few minutes, and then I can slowly start to see it darkening a bit.

  2. I did benchmark testing last night to confirm that your processor slows down by 26% when you use the full 7MB of your MacEffects RAM card. There is no slowdown at all when you use your Portable without the card installed, or when you use only 4MB from the card (5MB total RAM). Details give in my post here.


I think I see what's doing it in the Portable Control Panel 1.3. Included are two ROM patches, one replacing the BatWatch VBL task and one for the SndWatch VBL task I posted earlier.
Can the v1.3 "Portable" control panel be hacked to eliminate the offending code such that (1) we can continue to control the backlight but (2) the pop sound every 10 seconds goes away?

That would resolve the issue entirely when using System 6 because that v1.3 Portable control panel is absolutely needed on 5126 models, otherwise the backlight won't light. And yet, that v.1.3 control panel causes the pop every 10 seconds.
 

SuperSVGA

Tinkerer
Mar 26, 2022
64
34
18
Can the v1.3 "Portable" control panel be hacked to eliminate the offending code such that (1) we can continue to control the backlight but (2) the pop sound every 10 seconds goes away?

That would resolve the issue entirely when using System 6 because that v1.3 Portable control panel is absolutely needed on 5126 models, otherwise the backlight won't light. And yet, that v.1.3 control panel causes the pop every 10 seconds.
There's a few different ways you could do it, simplest would be changing the command from "sound on, clear latch" to just "sound on".

In ResEdit for example change 2B from 03 to 01:
Screen 0.png

Screen 1.png
 

JDW

Administrator
Staff member
Founder
Sep 2, 2021
1,655
1,415
113
53
Japan
youtube.com
@SuperSVGA
Thanks!

I just changed that "03"...

1712364578715.png


...to "01"...

1712364608374.png


Interestingly, when I then checked the "vers" resource, it shows 1.0.3...

1712364716702.png

I changed that to be 1.3.1, in light of the "hack" I just made...

1712364986490.png 1712364944768.png

Attached below you will find a ZIP file containing the disk image holding the new v1.3.1 "Portable" control panel. I cannot test that until Monday because it is Saturday here in Japan and my Portable parts are at the office. But if @nottomhanks wants to give it a try, please feel free!
 

Attachments

  • Portable Update.image.zip
    44.6 KB · Views: 61

ScutBoy

Administrator
Staff member
Founder
Sep 2, 2021
339
318
63
Northfield, MN USA
@JDW - I will pull the machine out this week and check. Feel free to remind me if I'm tardy in replying.

Sorry for being so long - had to make the time to pull out the machine, charge up the battery, etc.

I don't get the same sound that you do, neither over the headphone jack, nor from the speaker. I do still get a lot of static/interference on the headphone jack, but not the speaker.

This is on a 5126 running a SCSI2SD and the MacEffects RAM card, backlight on. System 7-something; I forgot to look.

I hope that helps!
 
  • Like
Reactions: JDW

JDW

Administrator
Staff member
Founder
Sep 2, 2021
1,655
1,415
113
53
Japan
youtube.com
Sorry for being so long - had to make the time to pull out the machine, charge up the battery, etc.

I don't get the same sound that you do, neither over the headphone jack, nor from the speaker. I do still get a lot of static/interference on the headphone jack, but not the speaker.

This is on a 5126 running a SCSI2SD and the MacEffects RAM card, backlight on. System 7-something; I forgot to look.

I hope that helps!
Thank you very much for testing.

Did you try maximizing the volume to level 7 and then listening carefully for at least 20 or 30 seconds through the headphone jack to see if you could hear a soft tick sound every 10 seconds?

The reason I ask is because if your volume setting is set completely to zero or very low, you may not be able to hear the repetitive tick sound at all. But it should be audible under volume level 7, especially if you have the brightness control panel loaded at start up.
 

JDW

Administrator
Staff member
Founder
Sep 2, 2021
1,655
1,415
113
53
Japan
youtube.com
I've just tested the v1.3.1 "Portable" control panel (see attached file in my earlier post.) while booted into System 6.0.8 and am pleased to report complete success in eliminating that bothersome tick sound every 10 seconds! Kudos to @SuperSVGA for providing that solution!

Now for the bad news. Even if I remove the Brightness & PowerBook control panels in System 7.1, the tick still occurs every 10 seconds. Meaning, there is no "Portable" control panel in System 7. That has been replaced by Brightness & PowerBook. Even so, some other file (the System file?) must be using the same code to generate that tick sound every 10 seconds. If it was inaudible from the speaker, I wouldn't care so much, but I can hear it clearly even at the default sound volume of 3, which is what set me on this journey to investigate the source of all these strange noises.

Although @ScutBoy said he can't hear the tick at all, it is not clear what his Volume setting he used. You cannot hear the tick sound at all when Volume is set to 0.

But the earlier video kindly made by @nottomhanks shows that he and the rest of us can clearly hear the tick sound on his 5126, even with airplanes flying overhead, and even when the Volume isn't set to max.

So if indeed, @ScutBoy cannot hear the tick every 10 seconds even at Volume 7, then we need to establish why I hear it and @nottomhands hears it too. Then again, we don't know the OS version used during @ScutBoy's testing.

I highly recommend that people test with either 6.0.7 or 6.0.8, if you can, because I know for a fact that if you remove the v1.3 "Portable" control panel from the System Folder and restart, the tick sound is gone. And if you put it back, you can hear the tick sound. But if you use the v1.3.1 I created using the detailed guidance of @SuperSVGA, the tick sound is gone. And if you use System 7.1, the tick sound is present even without Brightness or PowerBook control panels loaded.

I would love to hear your thoughts in light of this. Thanks!
 

JDW

Administrator
Staff member
Founder
Sep 2, 2021
1,655
1,415
113
53
Japan
youtube.com
I should add that even though my 5126 motherboard had been professionally recapped, the person who did the recapping asked if I minded if he used radial caps for C16 and C8, and I gave him the OK on that. Typically, radials have better specs than most axials anyway, so I didn't mind. However, when dealing with unknown sources of noise, it's always a good idea to implement the best anti-noise practices in electronics. The long leads from the two radial caps triggered a red flag in my mind, so I purchased great quality caps from Mouser, removed the Radials and installed the Axials. I am talking about the following two caps circled in Bruce's photo below:

1712710964450.png


Sadly, swapping those two caps did absolutely nothing to reduce the noise I am hearing, despite the fact the Axials are actually better (lower ESR, higher Q, etc.) than the radials that were used.

Anyway, just FYI.

Would love to hear more feedback from everybody. Thanks for all the help to date!
 

JDW

Administrator
Staff member
Founder
Sep 2, 2021
1,655
1,415
113
53
Japan
youtube.com
I think I'm ready to throw in the towel on this Audio Noise problem. Not enough feedback from others to know what should be done next (if anything).

I wish to once again humbly thank @SuperSVGA for providing the solution. Anyone can download that. It's an attachment in my earlier post here.

So long as I don't use the headphone jack for anything, and so long as I use System 6 with that v1.3.1 Portable extension, all is well. However, all flavors of System 7 still produce that infuriatingly bothersome tick sound every 10 seconds, which is audible even at the default volume of 3. So if anyone ever comes across this thread in the future and has a brilliant idea on how to hack the System file or whatever it is that triggers the tick in System 7.x, please chime in. There are times I need to run System 7.x, and eliminating that tick sound will bring genuine peace to my mind and ears. THANKS!
 

JDW

Administrator
Staff member
Founder
Sep 2, 2021
1,655
1,415
113
53
Japan
youtube.com
@SuperSVGA
I uploaded the v1.3.1 "Portable" Control Panel to Macintosh Garden, where it is found as DL#6. Without you, this wouldn't have been possible. So thank you again.

I do wish to ask if you have ever used Ghidra or otherwise decompiled 68K Mac software? I can get it to launch on my Intel Mac. I just don't know how to use it. I am trying to replicate your magic on the "Brightness" control panel in System 7, with the aim of eliminating that pop sound every 10 seconds. You found the fix in the "Portable" CP so brilliantly. If you have any advice on how to achieve the same in the "Brightness" CP, I would truly be grateful. Thanks!
 

SuperSVGA

Tinkerer
Mar 26, 2022
64
34
18
@SuperSVGA
I uploaded the v1.3.1 "Portable" Control Panel to Macintosh Garden, where it is found as DL#6. Without you, this wouldn't have been possible. So thank you again.

I do wish to ask if you have ever used Ghidra or otherwise decompiled 68K Mac software? I can get it to launch on my Intel Mac. I just don't know how to use it. I am trying to replicate your magic on the "Brightness" control panel in System 7, with the aim of eliminating that pop sound every 10 seconds. You found the fix in the "Portable" CP so brilliantly. If you have any advice on how to achieve the same in the "Brightness" CP, I would truly be grateful. Thanks!

That's probably a topic that requires a much more detailed tutorial of some sort, but here's a quick one:
  1. Go to File -> Import File and select the binary.
    1. While you can import the file itself, it's usually easier to export the individual resources and just get the one containing the code you want. If you have it in a floppy disk image, you can open it in Applesauce, double click the file, then use the save menu to extract individual resources. There is also a tool called rsrcdump that can do it similarly with the file itself.
    2. Some files use compressed resources in their resource forks. If you open the file with ResEdit and try to edit one of the resources, you will usually get a warning that the resource is compressed and it will save uncompressed. You will have to edit the resource and save it to get it out uncompressed. The Applesauce exporter and rsrcdump do not appear to decompress resources so exporting a compressed resource will not give you a usable result.
  2. Click the three dots next to language and select a 68000 option. I usually go with the "default" variant.
  3. Click Options and change the base address to somewhere where there isn't likely to be other memory or hardware that the code may access. "100000" is a good place since it is out of the base memory region. If you know where the code should be located (a Macintosh ROM for example) then you should put it there.
  4. Click OK to accept everything and then double click on the file you just created in the browser.
  5. You will likely be asked to Analyze the file. I typically do not since sometimes it is a little off when it comes to strings, but there is likely no harm either way.
  6. Next you will want to find the start of some code and press "D" (or right click and select Disassemble). Ghidra will disassemble through the code as far as it can, following branches and jumps. It will stop once it can't figure out where to go next, leaving the rest undefined. If you see undefined data that you think is code, press D again to continue disassembly.
    1. This again depends on what binary you have put in. A 68000 ROM will have vectors at the beginning, one of them being the address of the initial Program Counter at +0x4, which is a pointer to where execution should start. A driver file on the other hand usually has several headers and things at the beginning, so code may start further down. Opening a driver in ResEdit will show the headers and the start of the code so you can match it up.
    2. When Ghidra cannot disassemble something it will place a red X to the left. This means it is either not code, or the instruction flow reached something that is not code but Ghidra expected it to be, meaning the prior data may not have been code either.
    3. The 68000 requires 2-byte word alignment, so instructions cannot start on odd addresses. If your file is off by one byte then you will need to adjust the base address by one byte to get it to disassemble.
    4. If you are lost, look for common instructions such as RTS (4E 75) or LINK.W A6 (4E 56).
    5. Ghidra does not support the A-Line trap instructions (such as A0 52) that the Macintosh uses natively, so you will likely have decompilation stop when it encounters one. You can either right click the A-Line instruction and go to Data -> Word and the continue disassembly after it, or there are also various different patches around online which you can add to Ghidra to have it handle these automatically.
  7. Once you have the disassembly done, you can start making things readable.
    1. Click on labels or function names and press "L" to rename them.
    2. Values shown in green can be converted to other values or have equates set. They will be hex by default, but if you see something that should be a string or decimal, you can right click on it and select the value you want in the Convert menu. You can also press "E" and enter a name if you want that value to have a specific name.
    3. You can press semicolon ";" to add comments to lines.
    4. You can click on a value and press "R" to open the references screen to add or remove references. This is useful for readability as you can add links to other locations, for example destinations of items in a jump table or offsets for computed addresses.
    5. For strings you can highlight the string, right click, and go to Data -> String. You can also use the byte, word, and long options there to define data that is not code.
    6. The first 4KB or so of RAM will have system variables and globals, which may be helpful to label when understanding the code. A good list of these and their locations is from "Mac Almanac II".
 

JDW

Administrator
Staff member
Founder
Sep 2, 2021
1,655
1,415
113
53
Japan
youtube.com
That's probably a topic that requires a much more detailed tutorial of some sort, but here's a quick one...
Wow! Thank you very much. I sincerely appreciate your time on putting that together for me. Truly!

Since I am completely inexperienced with this, I see it will take me some time to sift through. And it's also clear I would have been utterly lost without your guidance. That's not to say I am confident in my ability to hack the Brightness Control Panel in System 7 in the same way you hacked the Portable 1.3 control panel in System 6 (you changed the command from "sound on, clear latch" to just "sound on" using PTCH ID3) to kill that pop sound every 10 seconds, but at least I can make an attempt. The sound is annoying, and it would be nice to be able to use System 7 now and then on the 5126 Portable without the pop.

Thanks!
 

SuperSVGA

Tinkerer
Mar 26, 2022
64
34
18
That's not to say I am confident in my ability to hack the Brightness Control Panel in System 7 in the same way you hacked the Portable 1.3 control panel in System 6 (you changed the command from "sound on, clear latch" to just "sound on" using PTCH ID3) to kill that pop sound every 10 seconds, but at least I can make an attempt.
Well if removing the Brightness control panel does not change it, then I'm guessing it's not in there. It's more likely a patch in the System file since they could just bake it in at this point.
 
  • Like
Reactions: JDW

JDW

Administrator
Staff member
Founder
Sep 2, 2021
1,655
1,415
113
53
Japan
youtube.com
Well if removing the Brightness control panel does not change it, then I'm guessing it's not in there. It's more likely a patch in the System file since they could just bake it in at this point.
Sorry for my delayed reply. It was a 3-day holiday weekend here in Japan, and my Portable was left at the office.

I moved the Brightness CP outside the System Folder (System 7.1) to make sure it would not load, and then I rebooted. Interestingly, the backlight came on very quickly during the boot sequence even without Brightness loading, and the pop every 10s is still heard. So you're right. That audio pop issue has nothing to do with the Brightness Control Panel. It's clear that the code used in the "Portable" v1.3.x CP was moved into the System file.