Author Topic: Sound on unsupported systems  (Read 7570 times)

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Sound on unsupported systems
« on: March 22, 2018, 12:56:08 AM »
I thought I'd start a thread to see what we could figure out about getting sound to function properly on unsupported systems.

What I have found is sound devices with the sound-objects in the device tree seem to work, however the Mini doesn't have the sound-objects, and at least the line-out works.

On the Powerbook6,8 and the 12" iBook( powerbook6,7 ) they have external codecs on the i2c bus, and sound doesn't work on these systems at all.

Offline MacTron

  • Global Moderator
  • Platinum Member
  • *****
  • Posts: 2116
  • keep it simple
Re: Sound on unsupported systems
« Reply #1 on: March 22, 2018, 08:48:15 AM »
eMac sound properties:
(from the unsupported [email protected])
« Last Edit: March 22, 2018, 11:07:19 AM by MacTron »
Please don't PM about things that are not private.

Offline MacTron

  • Global Moderator
  • Platinum Member
  • *****
  • Posts: 2116
  • keep it simple
Re: Sound on unsupported systems
« Reply #2 on: March 27, 2018, 10:32:22 AM »
Somewhere in the forum there is a list of G4 machines and it's audio chips ...
But Can't find it. May be I have a local copy of this data ...
Please don't PM about things that are not private.

Offline nanopico

  • Platinum Member
  • *****
  • Posts: 767
Re: Sound on unsupported systems
« Reply #3 on: March 27, 2018, 11:14:22 AM »
I posted this elsewhere.  Not sure where.  I believe MacTron made it easier to view here. I had initially attached an excel file.
This is not complete and not very detailed ( a few things may be wrong at the moment).  It is all I have at this time.  (One of the files that survived one of my stupid purges).
There are details in the Apple doc's that outline some of the actual chips (not just the apple name for them).
Model FamilyIdModelArchitecture Release DateArchitectureNorth Bridge (Bus and Memory Controller)IO ControllerPMUAudio Firewire ControllerUSB ControllerCPU Version
iMac G3 (Original)"iMac,1"M4984May-98GracklePaddingtonCUDABurgundyNoneExternal750
PowerBook G3 (Lombard)"PowerBook3,1"M5343May-99GracklePaddingtonCUDAScreamerNoneUSB0763750
"PowerMac G3 (Beige Desktops, Minitower and All-in-one)"NA"M3979, M4405, M4787"Aug-98GrackleHeathrowCUDA"Screamer, Burgundy"NoneNone750
PowerMac G3 Blue and White"PowerMac1,1"M5183Jun-99Grackle (MPC 106)PaddingtonCUDABurgundyExternalExternal750
eMac (2005)"PowerMac6,4"A1002May-05q86jIntrepidIntrepidPMU99IntrepidPCI USB Controller7447a
eMac(USB 2.0)"PowerMac6,4"A1002Apr-04q86IntrepidIntrepidPMU99IntrepidPCI USB Controller7447a
iBook G4 Early 2004 OP"PowerBook6,5"A1054Apr-04Q72 73IntrepidIntrepidPMU99IntrepidIntrepid7447a
iBook G4 Late 2004 OP"PowerBook6,5"A1054Oct-04Q72 73AIntrepidIntrepidPMU99IntrepidIntrepid7447a
iBook G4 Original OP"PowerBook6,3"A1054Oct-03P72DIntrepidIntrepidPMU99IntrepidIntrepid7457
iBookG4 Mid 2005 OP"PowerBook6,7"A1133Jul-05Q72 73BIntrepidIntrepidPMU99IntrepidIntrepid7447a
iMac G4 "PowerMac4,5"M6498May-03kumIntrepidIntrepidPMU99IntrepidIntrepid7445
iMac G4 "PowerMac6,1"N/ASep-03q26bcIntrepidIntrepidPMU99IntrepidIntrepid7445
iMac G4 "PowerMac6,3"N/ANov-03q59IntrepidIntrepidPMU99IntrepidIntrepid7445
MacMini"PowerMac10,1"A1103Jan-05q88IntrepidIntrepiduPMUIntrepidPCI USB Controller7447a
"PowerBook G4 12"" AI""PowerBook6,4"A1010Apr-04q54AIntrepidIntrepidPMU99IntrepidIntrepid7447a
"PowerBook G4 12"" AI""Powerbook6,8"A1104Jan-05q54BIntrepidIntrepidPMU99IntrepidIntrepid7447a
"PowerBook G4 12"" DVI-AI""PowerBook6,2"A1010Sep-03q54IntrepidIntrepidPMU99IntrepidIntrepid7447a
"PowerBook G4 15"" AI""PoewrBook5,4"A1095Apr-04Q16aIntrepidIntrepidPMU99IntrepidIntrepid7447a
"PowerBook G4 15"" AI, SMS/BT2 - AI""PowerBook5,6"A1106Feb-05Q16bIntrepidIntrepidPMU99IntrepidIntrepid7447a
"PowerBook G4 15"" FW800 AI""PowerBook5,2"A1046Sep-03Q16IntrepidIntrepidPMU99IntrepidIntrepid7447
"PowerBook G4 17"" AI""PowerBook5,3"A1052Sep-03Q41IntrepidIntrepidPMU99IntrepidIntrepid7447
"PowerBook G4 17"" AI""PowerBook5,5"A1085Apr-04Q41aIntrepidIntrepidPMU99IntrepidIntrepid7447a
"PowerBook G4 17"" AI""PowerBook5,7"A1107Feb-05Q41bIntrepidIntrepidPMU99IntrepidIntrepid7447a
"PowerBook G4 15"" DLSD/HR - AI""PowerBook5,8"A1138Oct-05Q16cIntrepid 2Intrepid 2PMU05Intrepid 2Intrepid 27447a
"PowerBook G4 17"" DLSD/HR - AI""PowerBook5,9"A1139Oct-05Q41cIntrepid 2Intrepid 2PMU05Intrepid 2Intrepid 27447a
iBook G3 (32 VRAM)"PowerBook4,3"A1007Nov-02BubPangeaPangeaPMU99TumblerPangeaPangea750fx
iBook G3 (Dual USB)"PowerBook4,1"M6497May-01PangeaPangeaPMU99TumblerPangeaPangea750fx
iBook G3 (Early 2003)"PowerBook4,3""A1005, A1007"Apr-03P72CPangeaPangeaPMU99TumblerPangeaPangea750fx
iBook G3 (Late 2001)"PowerBook4,1"M6497Oct-01PangeaPangeaPMU99TumblerPangeaPangea750fx
iBookG3  (16 VRAM)"PowerBook4,3"A1005May-02PangeaPangeaPMU99TumblerPangeaPangea750fx
iMac G3Oct-01PangeaPangeaPMU99ScreamerPangeaPangea750cx
iMac G3 (Early 2001)"PowerMac4,1"M5521May-01PangeaPangeaPMU99ScreamerPangeaPangea750cx
iMac G3 (Summer 2001)"PowerMac4,1"M5521Jul-01PangeaPangeaPMU99ScreamerPangeaPangea750cx
iMac G4 "PowerMac4,2"M6498Jan-02PangeaPangeaPMU99TumblerPangeaPangea7441
iMac G4 "PowerMac4,2"M6498May-03kumPangeaPangeaPMU99PangeaPangea7445
PoewrMac G4 DP (MDD)"PowerMac3,6"M8570Sep-02MojaveU2KeyLargoPMU99SnapperU2Keylargo7455
PowerMac G4 (FW800)"PowerMac3,6"M8570Jan-03JosU2KeyLargoPMU99SnapperU2Keylargo7455
eMac"PoewrMac4,4"A1002Jun-02UniNorthKeyLargoPMU99ScreamerUniNorthKeylargo7441
eMac"PoewrMac4,4"A1002Oct-02NorthUniNorthKeyLargoPMU99ScreamerUniNorthKeylargo7441
eMac (ATI)"PowerMac4,4"A1002Oct-03p86bUniNorthKeyLargoPMU99UniNorthKeylargo7445
eMac (ATI)"PowerMac4,4"A1002Jun-03p86UniNorthKeyLargoPMU99UniNorthKeylargo7445
iBook G3 (Firewire Clamshell)"PowerBook2,2"M6411Sep-00UniNorthKeylargoPMU99Micronas CodecUniNorthKeylargo750cx
iBook G3 (Original)"PowerBook2,1"M2453Jul-99UniNorthKeyLargoPMU99Micronas CodecNoneKeylargo750
iBook G3 SE (Original/Clamshell)"PowerBook2,1"M2453Feb-00UniNorthKeyLargoPMU99Micronas CodecNoneKeylargo750
iMac G3 (Slot Loading)"PowerMac2,1"M5521Oct-99UniNorthKeyLargoPMU99ScreamerUniNorthKeylargo750
iMac G3 (Summer 2000)"PowerMac2,2"M5521Aug-00UniNorthKeyLargoPMU99ScreamerUniNorthKeylargo750
PowerBook G3 (Pismo)"PowerBook3,1"M7572Feb-00UniNorthKeyLargoPMU99ScreamerUniNorthKeylargo750
PowerMac Cube"PowerMac5,1"M7886Jul-00UniNorthKeyLargoPMU99ExternalKeylargo7400
PowerMac G4 (AGP)"PowerMac1,2"M5183Aug-99UniNorthKeyLargoPMU99ScreamerExternalKeylargo7400
PowerMac G4 (Digital Audio)"PoewrMac3,4"M5183Jan-01UniNorthKeyLargoPMU99TumblerUniNorthKeylargo"7410, 7450"
PowerMac G4 (Gigabit)"PowerMac3,3"M5183Aug-00UniNorthKeyLargoPMU99ScreamerExternalKeylargo7400
PowerMac G4 (Quicksilver)"PowerMac3,5"M8493Jul-01UniNorthKeyLargoPMU99TumblerUniNorthKeylargo7450
PowerMac G4Feb-00UniNorthKeyLargoPMU99ScreamerExternalKeylargo7400
If it ain't broke, don't fix it, or break it so you can fix it!

macStuff

  • Guest
Re: Sound on unsupported systems
« Reply #4 on: March 28, 2018, 02:09:49 AM »
teamwork! makes the dream work!
 ;D

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Sound on unsupported systems
« Reply #5 on: March 28, 2018, 03:02:40 AM »
If we can decode the "sound-objects" and add them for the Mini, we can likely get sound working correct on the internal speaker with volume control.

I don't think we'll be able to do any such for the PowerBooks/iBooks that have the audio codec on the i2c bus. That would likely require an entire new sound driver.

I wasn't able to enable sound under Linux with these models with the i2c audio codec, people were not really running Linux on these Mac's and they have quit even making any distribution for lack of testers.

 

Offline Jubadub

  • Gold Member
  • *****
  • Posts: 326
  • New Member
Re: Sound on unsupported systems
« Reply #6 on: April 06, 2018, 01:58:11 PM »
I wasn't able to enable sound under Linux with these models with the i2c audio codec, people were not really running Linux on these Mac's and they have quit even making any distribution for lack of testers.

Hmm, what about MorphOS? Not sure if they eventually got the sound to work properly with their most current release, but:
http://www.morphos.de
https://en.wikipedia.org/wiki/MorphOS

The OS works on the Mini, and although paid and proprietary, it's free to try out, at least.

Some components are said to be open-source. Not sure if audio is among them, but even if it isn't, maybe their team could be contacted, and see if they'd be willing to lend a hand to the cause? Not that I expect them to help, but I guess it couldn't hurt to try...

Offline Jubadub

  • Gold Member
  • *****
  • Posts: 326
  • New Member
Re: Sound on unsupported systems
« Reply #7 on: April 08, 2018, 08:22:54 PM »
Just a little update, I checked and saw MorphOS did get audio to work on the Mac mini G4 (On-board audio on Mac mini (Apple I2S)) as seen here: http://www.morphos.de/hardware

The main download page contains the parts of the source code that are open, further below: http://www.morphos.de/downloads

But I still haven't searched it all to see if the audio portion of the mini is within those. I intend to find that out soon, but for now, if anyone was curious, one can look ahead.

Edit: Oh, and I forgot to mention, they also got things to work on a few more hardware (i.e.: early G5s), so perhaps it might not be that bad an idea to peek at things...

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Sound on unsupported systems
« Reply #8 on: April 09, 2018, 07:39:17 AM »
good point. maybe a place to ask?
insert arbitrary signature here

Offline MacTron

  • Global Moderator
  • Platinum Member
  • *****
  • Posts: 2116
  • keep it simple
Re: Sound on unsupported systems
« Reply #9 on: April 09, 2018, 08:58:23 AM »
Yellow dog Linux 6.2 and probably Debian PPC 6.0 have Mac Mini support, and probably audio works well.
Please don't PM about things that are not private.

Offline Jubadub

  • Gold Member
  • *****
  • Posts: 326
  • New Member
Re: Sound on unsupported systems
« Reply #10 on: April 09, 2018, 10:58:49 AM »
Yeah, as usual, Linux would be the first place to look. I'm trying to at least get some of these alternate OSes (BSD too) installed on separate partitions to confirm built-in sound does work with the mini with those. Whenever I get some time off work...

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Sound on unsupported systems
« Reply #11 on: April 09, 2018, 02:41:02 PM »
linux might be able to use the audio device because it knows it from x86...
insert arbitrary signature here

Offline ssp3

  • Platinum Member
  • *****
  • Posts: 710
Re: Sound on unsupported systems
« Reply #12 on: May 08, 2023, 07:29:20 AM »
Question to Open Firmware gurus.

Where these lines of code originate from and how could I change the "default-monitor" and generally poke around there?

Code: [Select]
name                    sound
device_type             soundchip
compatible              snapper
vendor-id               0000106b
#-detects               00000003
#-inputs                00000002
#-features              00000003
#-outputs               00000004
default-monitor         6e6f6e65 00
device-id               00000016

Excerpt taken from this MacOS Plus Telnet session. (Where are you, mate?)
http://macos9lives.com/smforum/index.php/topic,2408.msg29722.html#msg29722

On my PB G4 the so called "Snapper" sound chip sits on a separate PCB, and, in case you didn't know it, is a standart Texas Instruments TAS 3004 codec. Datasheet attached. Also there are these snapper.c and tas3004.c that I found somewhere on the net.
I'd like to see whether I can do something about the missing sound issue. In sound control panel it always defaults to headphone output.
« Last Edit: May 08, 2023, 08:43:16 AM by ssp3 »
If you're not part of the solution, you're part of the problem.

Offline ssp3

  • Platinum Member
  • *****
  • Posts: 710
Re: Sound on unsupported systems
« Reply #13 on: May 08, 2023, 08:41:35 AM »
The logic behind the idea I have right now is as follows.
There is a mechanical switch inside the headphone socket that is either open or closed depending on whether the headphones are plugged in or not. This switch does not switch the two "analog" lines (L+R) to either phones or speakers otherwise the machine(s) would behave identically in OS9 and OSX.
It is, most probably, sensed by TAS3004 or some glue logic and, depending on the initial state, simply switches to the "other" state when phones are plugged in. I suspect, if one manages to change the initial state of TAS3004 to the "other state" when it is initialized upon startup, it will behave as expected. It might be as simple as a matter of "0" or "1" somewhere. One byte.
If you're not part of the solution, you're part of the problem.

Offline robespierre

  • Veteran Member
  • ****
  • Posts: 123
  • malfrat des logiciels
Re: Sound on unsupported systems
« Reply #14 on: May 08, 2023, 09:16:45 AM »
Those are properties of the "sound" device.
From the OF> prompt you could type
Code: [Select]
dev /pci@f2000000/mac-io/i2s/i2s-a/sound
.properties
and that is what it would print.
If you wanted to change the first four bytes of the "default-monitor" property to 0xfeedface, you could then type
Code: [Select]
" "(fe ed fa ce)" " default-monitor" get-active-property 2drop swap move
and check .properties if it changed as intended.

P.S. the wires that detect whether there is anything plugged into the audio ports are typically wired as GPIOs to the mac-io chip, not the codec. Maybe the polarity of the GPIOs can be set somehow from OF.

Offline ssp3

  • Platinum Member
  • *****
  • Posts: 710
Re: Sound on unsupported systems
« Reply #15 on: May 08, 2023, 04:03:58 PM »
Thanks! Just tried it. Seems that nothing has changed when it comes to PB A1013 behaviour with that feedface thingy.
(Isn't that a magic string often seen in Mach-O files?)
And, btw, when there's something plugged into headphone socket, there is no startup chime, so this audio switching happens pretty early on.
What I've also missed in the first place is that hex string in 'default-monitor' - 6e6f6e65 , when pasted into hex editor, gives 'none' is ASCII.
If you're not part of the solution, you're part of the problem.

Offline robespierre

  • Veteran Member
  • ****
  • Posts: 123
  • malfrat des logiciels
Re: Sound on unsupported systems
« Reply #16 on: May 08, 2023, 07:27:15 PM »
feedface is just an example to show the syntax, I don't think it is the correct value for this parameter
Quote
What I've also missed in the first place is that hex string in 'default-monitor' - 6e6f6e65 , when pasted into hex editor, gives 'none' is ASCII.
oooh I missed that, too. Is default-monitor related to which output is in use? I know "monitoring" means echoing the input through to the output, but there is no documentation for what these properties are for.

What about the "sound-objects" property? If the wire that detects the headphone plug is "extint-gpio15", then that line seems to be saying, that bit-mask is the bit to use, and bit-match is the bit value when active. What if bit-match was 0 instead?

Offline ssp3

  • Platinum Member
  • *****
  • Posts: 710
Re: Sound on unsupported systems
« Reply #17 on: May 08, 2023, 07:36:20 PM »
Ha ha ha.. Good joke! I have no idea what the correct value should be..
« Last Edit: May 10, 2023, 12:13:32 AM by ssp3 »
If you're not part of the solution, you're part of the problem.

Offline ssp3

  • Platinum Member
  • *****
  • Posts: 710
Re: Sound on unsupported systems
« Reply #18 on: May 10, 2023, 12:38:54 AM »
Ok, I'm on to something.. Apple Audio Extension. Word "snapper" appears in data fork and in two resources - cfrg and INIT. cfrg points to offset in data fork where, as it looks to me, the pef segment is located (Joy!peff...)

If you disable this extension, volume controls either in Sound CP or on keyboard doesn't work anymore, Systems sounds and alerts are gone and tab where you select speakers or phones is greyed out. In input tab there's alert that "..the device is in use by another application".

This must be it. What do you think? I'll try to break something and see what happens.  ;)
If you're not part of the solution, you're part of the problem.

Offline ssp3

  • Platinum Member
  • *****
  • Posts: 710
Re: Sound on unsupported systems
« Reply #19 on: May 12, 2023, 11:20:38 AM »
Continuing digging...

I've found AudioDeviceTreeUpdater.kext in 10.2.x - 10.3.x OSX installers. Most interesting is the .plist from it. Apparently the kext patches device tree in Open Firmware and changes some values from default ones for some Mac models. The names from it look very familiar.
Code: [Select]
#-detects               0000000x
#-inputs                0000000x
#-features              0000000x
#-outputs               0000000x
.....

Maybe this is the way to go to get sound working (correctly) on unsupported G4s? Maybe this is what modified Apple Audio Extension could do?

This stuff can be found in Apple Audio Extension's nift resources too. I've extracted nift-20493, converted it to data and loaded it in disassembler. What I see there doesn't really make sense to me. I was expecting the strings to have x-references to some code, but they have none. Or at least this is how disassembler interprets it. (PPC stuff is not my cup of tea at all..)

.plist file and text file with strings attached fyi.
nift is from Apple Audio Extension version 2.4
« Last Edit: May 12, 2023, 12:25:08 PM by ssp3 »
If you're not part of the solution, you're part of the problem.