Jump to content

Kx audio driver mod [Sound blaster live!, audigy 1/2/4/RX emu edsp]


ITzTravelInTime
 Share

588 posts in this topic

Recommended Posts

I replaced the SMBIOS and the sound card can't be driven. I didn't try many ways.

Now my system is the latest version of bigsur. I upgraded from a lower version: 10.13 or 10.14 I forgot.

How can I drive again? The current model is MAC mini8,1, while the previous model was imac19,2

I tried to change to 19,2 and still couldn't drive

Trying to add to EFI is no good

Link to comment
Share on other sites

1 hour ago, fangf2018 said:

I replaced the SMBIOS and the sound card can't be driven. I didn't try many ways.

Now my system is the latest version of bigsur. I upgraded from a lower version: 10.13 or 10.14 I forgot.

How can I drive again? The current model is MAC mini8,1, while the previous model was imac19,2

I tried to change to 19,2 and still couldn't drive

Trying to add to EFI is no good


You have to install the kext to /library/extensions on Big Sur like people do with voodoohda. Big Sur removed some kext dependencies for this driver from the kernel artifact so this driver no longer works with kext injection from the bootloader.

Edited by ITzTravelInTime
Link to comment
Share on other sites

5 hours ago, ITzTravelInTime said:


你必须在Big Sur上安装kext到/library/extension,就像人们对voodoohda所做的那样。Big Sur 从内核工件中删除了此驱动程序的一些 kext 依赖项,因此此驱动程序不再与引导加载程序中的 kext 注入一起使用。

Yes, I tried this operation.

1386687856_2022-04-017_04_59.png.645ab89245be731179cce2b87bcca2da.png1712476836_2022-04-017_04_38.thumb.png.8436038e044b379e6dd3126ea5264c3f.png

 

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

So after quite some work i managed to get more than 1 sound card supported by the driver working at the same time, this has always been one of the objectives of this project and i finally did it!

 

Attached to this post i also leave a new driver build for you to try, it should help with the cracking sound issues at higher sample ratesand improve overall performance too. This libraryless variant of the driver i have attached is also more amd-hackintosh-friendly since it doesn't use the vector instructions.

 

WARNING: On big sur and newer oses you have to install the kext in /Library/Extensions with SIP turned off.

 

EDIT: I have reuploaded the build because of some errors.

 

1984379607_Schermata2022-07-20alle12_36_04.png.3da433d1b6bf4bb6fa5b8937d89bcd1f.png

 

kXAudioDriver_LibraryLess.kext.zip

Edited by ITzTravelInTime
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

So guys i have news for you, i managed to re-use the work i have made to port the audio driver to PowerPC to port it to ARM64, this means that i have been able to make driver builds that should work on Apple Silicon Macs.

 

That said there is a major caveat that prevents us from testing it yet:

The driver is just made for PCI/PCIE only devices, and, as far as i am aware, even cards connected trought Thunderbolt adapters are seen as thunderbolt devices by macOS, this means that in order to test the driuver we need apple to release an Apple Silicon mac featuring pcie slots.

 

That said it's good news that i figured out how to port my custom sound card drivers to Apple Silicon, this means that i will be able to continue my projects in the future assuming that apple will release the rumored Apple Silicon Mac Pro.

 

For now i leave you this screenshot as a proof of what i did and will push the changes to my github repo for the kx audio driver soon.

 

2097694817_Schermata2022-09-15alle12_08_57.thumb.png.d0c627471bb7f7552a5eb848b539dc03.png

  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

 

4 hours ago, ruslan61 said:

I couldn't run Audigy 2 ventura 13.0.1
sip ef0f0000

opencore 0.8.7

/Library/Extensions kext copy paste

what is the problem?

 

 

I have it working with oc 0.8.6, same sip value, maybe after copying the kext make sure that: 

 

1) The pci device gets detected, use dpci manager for that.

 

2) Repair file system permits for the /library/extensions folder and perform a partial kextcache rebuild, to do that run those commands inside the terminal:

 

sudo -i
cd /Library/Extensions
chmod -R 755 ./
chown -R 0:0 ./
touch -f ./
kextcache -i /
kcditto

 and then reboot.

 

3) Retry with the libraryless build i have posted in one of my previous posts here.

Link to comment
Share on other sites

5 hours ago, ITzTravelInTime said:

 

 

I have it working with oc 0.8.6, same sip value, maybe after copying the kext make sure that: 

 

1) The pci device gets detected, use dpci manager for that.

 

2) Repair file system permits for the /library/extensions folder and perform a partial kextcache rebuild, to do that run those commands inside the terminal:

 

sudo -i
cd /Library/Extensions
chmod -R 755 ./
chown -R 0:0 ./
touch -f ./
kextcache -i /
kcditto

 and then reboot.

 

3) Retry with the libraryless build i have posted in one of my previous posts here.

Thanksss :)))))👏

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

So after i got a second pcie sound card supported by the kx audio driver i made some more tests on macOS ventura with 2 sound cards, and i found out that my fix for multiple cards (and the one used by @>Alejandro in his current github source code) is no longer working, so i figured out a solution that will solve this problem once and for all.

 

All the info on the fix can be found in this commit: https://github.com/ITzTravelInTime/kx-audio-driver/commit/d32fe400612bb61d5974c46a3641e4b0656229f3

 

I am still working on that code, so it will be changes, but basically the bulk of the fix is that i am now overriding the getGlobalUniqueID from the IOAudioEngine class to calculate an unique id from scratch, using various information about the current sound card that the driver is using.

 

In the pictures you can see an exmple of this multiple cards fix working and what the new calculated UID value is.

 

BTW i have also made another important change in my driver fork, i have migrated from using custom functions implemented using x86 I/O ports instructions (or direct I/O memory space access for the PowerPC port) to now using the system-provvided I/O Read/Write functions, this not only allows for safer driver operation (delegating I/O comunication responsibility to the OS) but could allow for way better driver potability, potentially also allowing an ARM port in the future.

 

For now the driver seems to be working well even for inputs on the E-MU card, however there are still issues i have yet to understand how to fix, so would like to at least tackle those before ever pubblishing any new releases out. If you want i can also post some early build for you to test out.

 

Anyway, thank you for the attention and support.

 

1306133775_Screenshot2022-12-12alle01_27_45.thumb.png.7efc581d456a923fa646b887ebe8fd2c.png

 

1004659968_Screenshot2022-12-12alle01_29_41.png.6041e5b3ce79813fa451fa249d0b0762.png

  • Like 1
Link to comment
Share on other sites

My fork hasn't been updated for a very long time and doesn't contain the actual code of my current driver version (https://applelife.ru/threads/creative-sb-live-audigy-e-mu-driver.2850376/) I tested on Catalina, 3 cards work fine. Did you actually test my version on Ventura or just assumed it didn't work?

Edited by >Alejandro
Link to comment
Share on other sites

3 hours ago, >Alejandro said:

My fork hasn't been updated for a very long time and doesn't contain the actual code of my current driver version (https://applelife.ru/threads/creative-sb-live-audigy-e-mu-driver.2850376/) I tested on Catalina, 3 cards work fine. Did you actually test my version on Ventura or just assumed it didn't work?

 

I tested an old build from the hardware heaven forum thread, only on ventura, and it didn't work.

 

If you use the setIndex function to get more than one sound card to show up, i can confidently say that it's broken on ventura and it will not work. According to some documentation attached to the open source release for apple's IOAudioFamily kext, overriding the audio engine's getGlobalUniqueID function, like i did , is the way to go to ensure that all the devices will show up. I recommend you to implement it too, it's and easy fix.

 

BTW i did some 5 cards testing today and everything worked as expected with this new driver build i made (see attached pictures). 

 

5FE5D3AD-0054-4CE4-9BAE-A638703D9835.thumb.jpeg.dc5153fde8283de46b88fae88b6a78eb.jpeg

 

5F31196F-F019-4462-A390-99913878C69E.thumb.jpeg.8e6ec6e2265a42d0bdfb4b35c001211a.jpeg

 

Link to comment
Share on other sites

6 hours ago, ITzTravelInTime said:

If you use the setIndex function to get more than one sound card to show up, i can confidently say that it's broken on ventura and it will not work.

I have implemented the getLocalUniqueID() function

OSString *kXAudioEngine::getLocalUniqueID()
{
    if (!hw->card_name)
        return super::getLocalUniqueID();
    char str[64] = "";
    snprintf(str, sizeof str, "%s:%lx", hw->card_name, (long unsigned int)index);
    return OSString::withCString(str);
}

But I haven't tested in os above Catalina.

Link to comment
Share on other sites

4 hours ago, >Alejandro said:

I have implemented the getLocalUniqueID() function

OSString *kXAudioEngine::getLocalUniqueID()
{
    if (!hw->card_name)
        return super::getLocalUniqueID();
    char str[64] = "";
    snprintf(str, sizeof str, "%s:%lx", hw->card_name, (long unsigned int)index);
    return OSString::withCString(str);
}

But I haven't tested in os above Catalina.

 

I think the build i testes was actually an early build, from like the first forum post, was all of this implemented yet?

 

Btw this is my implementation, i have added an extra string to the kx_hw struct so that i have a model id based off the subsystem ids (different to the user-friednly name that people could see in their device listings in various apps), and i am also using PCI and I/O locations, because the audio engine index number is a per-driver instance value and not a global value, so that i have something else to identify the card with.

 

About your code, in case someone uses more of the same model of sound card at the same time, both cards will have the same uid, so in ventura just one will show up, so you must add something more soecific like i did.

 

 

OSString* kXAudioEngine::getGlobalUniqueID(){
	//const OSMetaClass * const myMetaClass = getMetaClass();

	char uniqueIDStr[KX_MAX_STRING];
	bzero(uniqueIDStr, KX_MAX_STRING);

	//const char* className = (myMetaClass) ? myMetaClass->getClassName() : NULL;

	snprintf(uniqueIDStr, KX_MAX_STRING, "%s:%x:%x:%x:%x:%x", /*className,*/ hw->card_model_name, hw->pci_bus, hw->pci_dev, hw->pci_func, hw->actualPort >> 8, (const UInt32)this->index);
	//OSString* value = super::getGlobalUniqueID();
    OSString* value = OSString::withCString (uniqueIDStr);
    debug("kXAudioEngine[%p]::getGlobalUniqueID() -- Returned value: %s\n", this, value->getCStringNoCopy());

	return value;
}

 

 

 

 

Edited by ITzTravelInTime
Link to comment
Share on other sites

9 hours ago, ITzTravelInTime said:

I think the build i testes was actually an early build, from like the first forum post, was all of this implemented yet?

Yes, implemented.

 

9 hours ago, ITzTravelInTime said:

About your code, in case someone uses more of the same model of sound card at the same time, both cards will have the same uid, so in ventura just one will show up, so you must add something more soecific like i did.

hw->card_name contains the device name and port address, so getLocalUniqueID returns a unique ID. It would be interesting to test this in your code.

Link to comment
Share on other sites

6 hours ago, >Alejandro said:

hw->card_name contains the device name and port address, so getLocalUniqueID returns a unique ID. It would be interesting to test this in your code.

 

Good point, i forgot about the address in the name, but, In my code i have modified the card names (for a multitude of reasons, mostly for user friendliness, so instead of "SB1550" it shows "SB Audigy RX") that's why i have introduced a model name string, so that i can have this information still available, and i also plan on eventually removing the address from the names too, that's why i have included the address into the id itself explicitly, using this:

hw->actualPort >> 8

(I introduced this property for my PowerPC port, but it's of reliable usage on x86 too, it's shifted by 8 bits, because, for alignment reasons the first byte of the address is usually 0, so what really makes a difference are the bits above, and with this, i can shove some characters off the id, which helps since my id string is on the long side)

 

So in my case the name is way less unique, (and i will also eventually remove the address from it, eventually) so that's why i am using the model name, and the address explicitly, in my ID string.

 

BTW i can recommend you to change your code as well and to transition, to using the System's functions for accessing the I/O address space, since this will remove this responsibility from the driver and make it more portable, i have already done it in my fork, so that i don't have to worry about implementing the I/O ports stuff for any platform i'd like to support. For that take a lot at those commits:

 

https://github.com/ITzTravelInTime/kx-audio-driver/commit/5f09fdb814e80dfadaa35789b63e0b8dd2c72bdc

https://github.com/ITzTravelInTime/kx-audio-driver/commit/67753b11f462d6c726833721bd664a767389a411

 

 

  • Like 1
Link to comment
Share on other sites

Update, on my x99 system, using ventura and catalina, when i use the E-MU pcie card i have a sudden kernel panic caused by an unreleased spinlock that times out, this happens only after having the fpga programmed, so there must be something wrong with what gets called, to program it, i am trying to find it and fix it.

 

Edit : This doesn't seems to be a problem while using the sound card on big sur, on my sandy bridge test system (without cpu power management thought), to be really sure that this seems to be related to my cpu platform i must also do some tests using my mac pro 2010.

 

The kernel panic messange, if you are interested:

 

mp_kdp_enter() timed-out on cpu 16, NMI-ing
mp_kdp_enter() NMI pending on cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 14 15 17 18 20 21 22 23 24 25 26 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
mp_kdp_enter() timed-out during locked wait after NMI;expected 44 acks but received 4 after 11948971 loops in 1100000704 ticks
panic(cpu 16 caller 0xffffff80117e2f96): Ticket spinlock[0xffffff8011cf6c80] timeout after 1100000975 ticks; cticket: 0xf0, nticket: 0xfc, waiting for 0xf8, current owner: 0 (on CPU -1), start time: 1374267755462, now: 1375367756437, timeout: 1100000704 @lock_ticket.c:386
Panicked task 0xffffffa028e13218: 300 threads: pid 0: kernel_task
Backtrace (CPU 16), panicked thread: 0xffffff9b5d39a598, Frame : Return Address
0xffffff80ea0eb7b0 : 0xffffff8010fedf9d 
0xffffff80ea0eb800 : 0xffffff801115b786 
0xffffff80ea0eb840 : 0xffffff801114aa10 
0xffffff80ea0eb890

 

UPDATE: I think i have fixed it, it was a lock not being released in some circumstances, it's located in the DSP.cpp file and it's in the kx_update_microcode function. So far it seems to work, i will keep you updated.

Edited by ITzTravelInTime
  • Like 1
Link to comment
Share on other sites

Update: i managed to fix the cracking sounds on the audigy rx but not the e-mu 1212m pcie (all running on the same pc, using the same driver, the only major difference is that the e-mu is attached to the 1616m dock, i am investigating this issue)

 

Anyway since it's ready to test, at least for audigy rx users, i have attached to this post the new driver build in 2 flawors (the normal one and the libraryless one that is more AMD CPUs friendly since it drops the usage of vector instructions).

 

Those binaries are compiled for High Sierra onwards, but they should work with some older versions too, test them and let me know, if you need it, i can compile the from snow leopard to get a more compatible binary.

 

To enable recording you must also setup the ac97 app like so (see the spoiler):

 

Spoiler

1386189843_Screenshot2022-12-27alle13_06_32.png.350f1a85eaf68d6cc0ffcbd3773ab376.png

 

 

kXAudioDriver_LibraryLess.kext.zip kXAudioDriver.kext.zip

Edited by ITzTravelInTime
  • Like 2
  • Thanks 2
Link to comment
Share on other sites

  • 1 month later...

HI,

on the same pc I have a BigSur ssd and on it the driver it's perfectly working. Then I tried a Monterey installation (12.6) that seems to work fine but sound. I tried all the usual staff, installed the driver in Library/ Extensions (sip disabled) and also tried on System/Library/Extensions. The driver is there but no way. I installed with OC but only for installation. I use Clover 5150 to boot.

Is there anything I could try?

Thanks

 

edit: after update to 12.6.3 it works. I don't know w.t.... but it works. Thanks again

 

Edited by bluenote56
Link to comment
Share on other sites

  • 1 month later...
 Share

×
×
  • Create New...