Author Topic: Updated Uniaud32 build  (Read 681992 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2528
  • Karma: +193/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1080 on: April 13, 2025, 04:09:53 am »
Confirming.... the following is a snip fro, 6.6.x log:
Code: [Select]
OSS32_MixSetVolume of Headphone Playback Volume streamid f0e5f460 to (80,80)(118,118) caps 127
OSS32_MixSetVolume of Master Playback Volume streamid f0e5f460 to (90,90)(124,0) caps 127
Init=200/0 Between=16/0 Complete=0/0
get_free_dma_pages: size=1000 adr=fa07f000 (phys 101000) total alloc size=ad000
get_free_dma_pages: size=1000 adr=fa07e000 (phys 148000) total alloc size=ae000
OSS32_WaveOpen. streamid f0e603d0

OSS32_MixSetVolume of Master Playback Volume streamid f0e5f460 to (49,49)(83,0) caps 127
OSS32_MixSetVolume of Master Playback Volume streamid f0e5f460 to (49,49)(83,0) caps 127
channels: 2, period size: b00
channels selected: 2
HWP: SR rate 44100, BPS 16, CH 2, PRSZ 2c0, periods 16

with 6.12 (here at least), the last line in the log is:
Code: [Select]
OSS32_MixSetVolume of Headphone Playback Volume streamid f0e5f460 to (80,80)(118,118) caps 127

Sigurd Fastenrath

  • Hero Member
  • *****
  • Posts: 649
  • Karma: +36/-0
  • OS/2 Versus Hardware - Maximum Warp!
    • View Profile
Re: Updated Uniaud32 build
« Reply #1081 on: April 13, 2025, 08:56:11 am »
Hi Paul,

thank you very much, gave it a try with my ASUS ROG, boot result in a Trap000e.

I will investigate later, bit short of time today.

Sigurd

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2528
  • Karma: +193/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1082 on: April 13, 2025, 08:58:44 am »
Interesting! I don't suppose that box has a serial port? Clear photo of the trap screen may also help.

Edit: I doubt it fixes anything, but https://smedley.id.au/tmp/uniaud32.sys has a few changes to address compiler warnings.
« Last Edit: April 13, 2025, 10:35:17 am by Paul Smedley »

David McKenna

  • Hero Member
  • *****
  • Posts: 880
  • Karma: +30/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1083 on: April 13, 2025, 02:33:32 pm »
Hey Paul,

  I tried this last build in a VBox 7.1 machine and can confirm your results: ac97 'works' and hda hangs while booting.

 I have never used ac97 for sound in a VBox because it always plays sounds too fast - voices sound like chipmunks. Wonder if anyone else has noticed that. HDA has always been fine.

Regards,

Sigurd Fastenrath

  • Hero Member
  • *****
  • Posts: 649
  • Karma: +36/-0
  • OS/2 Versus Hardware - Maximum Warp!
    • View Profile
Re: Updated Uniaud32 build
« Reply #1084 on: April 13, 2025, 05:40:46 pm »
Interesting! I don't suppose that box has a serial port? Clear photo of the trap screen may also help.

Edit: I doubt it fixes anything, but https://smedley.id.au/tmp/uniaud32.sys has a few changes to address compiler warnings.

No Serial Port, will test the fix later.

Screenshot:

Sigurd Fastenrath

  • Hero Member
  • *****
  • Posts: 649
  • Karma: +36/-0
  • OS/2 Versus Hardware - Maximum Warp!
    • View Profile
Re: Updated Uniaud32 build
« Reply #1085 on: April 13, 2025, 05:54:15 pm »
Boot freeze with modified uniaud32.sys:


Paul Smedley

  • Hero Member
  • *****
  • Posts: 2528
  • Karma: +193/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1086 on: April 14, 2025, 12:07:00 am »
Hey Dave,
  I tried this last build in a VBox 7.1 machine and can confirm your results: ac97 'works' and hda hangs while booting.

 I have never used ac97 for sound in a VBox because it always plays sounds too fast - voices sound like chipmunks. Wonder if anyone else has noticed that. HDA has always been fine.
Thanks for confirming. I'll try spend some time today working this out. I'm away from home right now and only have access to my dev box (over VPN) and virtualbox - so if I can at least work out what broke setting mixer controls that will be a good start (assuming the hang is whilst calling the mixer controls).

I did run a diff of the changes between 6.6.x and 6.12.x looking for any obvious merge errors (reverting the changes that introduced guard() and scoped_guard() was pretty tedious and there is/was a good chance I made an error there!)

https://smedley.id.au/tmp/uniaud32.sys stubs the code in https://trac.netlabs.org/uniaud/browser/GPL/branches/uniaud32-exp/lib32/soundmixer.c#L361 and boots ok with sound in Virtualbox. interestingly the volume is much louder than usual.

Clearly this isn't a long term solution but it at least confirms the sound driver is working, and it's some kind of hang whilst setting a mixer control, which narrows now the code that could be causing the issue.

Digging in some more, seems the first mixer set (Headphones) works ok, but when setting the Master Front, it hangs at https://trac.netlabs.org/uniaud/browser/GPL/branches/uniaud32-exp/lib32/soundmixer.c#L376
« Last Edit: April 14, 2025, 05:48:08 am by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2528
  • Karma: +193/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1087 on: April 14, 2025, 06:30:06 am »
https://smedley.id.au/tmp/uniaud32-linux-6.12.21-20250414.zip ignores attempts to set OSS32_MIX_VOLUME_MASTER_FRONT - but should allow other mixer controls. I need to do some testing with pmunimix to see if this works - or if it's a case of setting the 1st mixer works, then any subsequent one hangs.

Edit: confirming - running pmunimix with HDA hangs. I'm guessing something changed in https://trac.netlabs.org/uniaud/browser/GPL/branches/uniaud32-exp/alsa-kernel/core/control.c
Nope: backlevelled alsa-kernel/core/control.c and alsa-kernel/include/sound/control.h and the behaviour is the same :/
« Last Edit: April 14, 2025, 08:09:45 am by Paul Smedley »

Lars

  • Hero Member
  • *****
  • Posts: 1428
  • Karma: +72/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1088 on: April 14, 2025, 08:23:12 am »
For sure, it`s a NULL pointer error: CR2 = 00000004 which should be a linear address but likely something is being addressed via [EBX+4] with EBX = 0 (or EAX or ECX instead of EBX, as can be seen in the trap screen).

That said, the error location in soundmixer.c:
370   if(pHandle == NULL || pHandle->magic != MAGIC_MIXER_ALSA32) {
371   printk("Invalid handle in OSS32_MixSetVolume\n");
372   DebugInt3();
373   return OSSERR_INVALID_STREAMID;
374   }
375   //set operation to non-blocking
376   pHandle->file.f_flags = O_NONBLOCK; <------- ERROR

seems to make that unlikely, as "pHandle" is tested in line 370 if it is a NULL pointer. Unless there is some code that executes in parallel (from a context handler, for example) that would make the memory that pHandle points to invalid while you are trying to access it. Note that "pHandle" is actually the "streamid" that you are being passed in and that might be deallocated where you do not want it to.

@Paul: have you already located Sigurds Trap Position "0xE1DA82E1" and "0xE5D780A2" in the source code ? Given the memory object info for USBAUD2.SYS, it must be in the "EXECUTABLE, READABLE, 32-bit" memory object at either of these offsets:
0x82E1
0x182E1
0x282E1
0x382E1
0x482E1
0x582E1
0x682E1
0x782E1
0x882E1

and analogue for 0xE5D780A2:
0x80A2
0x181A2
etc.

In order to get a confirmed offset, Sigurd would need to use Theseus to display the memory object layout for module "UNIAUD32" but since it hangs/traps already on bootup, that will be a problem ...
« Last Edit: April 14, 2025, 08:43:47 am by Lars »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2528
  • Karma: +193/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1089 on: April 14, 2025, 08:37:11 am »
Hi Lars, note that source code reference is where the system is hanging with HDA under virtualbox - I believe Sigurd's problem is elsewhere in the code, so your reading of the trap is probably useful. I haven't spent any time of analysing the trap screens yet.

@Sigurd - with a recent version of uniaud32.sys that doesn't trap, are you able to generate a report from theseus in line with the vladest post from https://uniaud-dev.netlabs.narkive.com/5BviGUFc/uniaud-3-trap-000e-on-shutdown
« Last Edit: April 14, 2025, 08:47:10 am by Paul Smedley »

Lars

  • Hero Member
  • *****
  • Posts: 1428
  • Karma: +72/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1090 on: April 14, 2025, 08:47:27 am »
Hi Lars, note that source code reference is where the system is hanging with HDA under virtualbox - I believe Sigurd's problem is elsewhere in the code, so your reading of the trap is probably useful. I haven't spent any time of analysing the trap screens yet.

Ok. My hope would be that Sigurds trap screens will give an indication of what REALLY went wrong. In both cases, it is a NULL pointer issue.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2528
  • Karma: +193/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1091 on: April 14, 2025, 09:04:48 am »
Hi Lars, note that source code reference is where the system is hanging with HDA under virtualbox - I believe Sigurd's problem is elsewhere in the code, so your reading of the trap is probably useful. I haven't spent any time of analysing the trap screens yet.

Ok. My hope would be that Sigurds trap screens will give an indication of what REALLY went wrong. In both cases, it is a NULL pointer issue.
Well hopefully, if I can't fix it whilst I'm away, I can reproduce the issue on one of the thinkpads I have around the house :)

btw there is a uniaud32.map in https://smedley.id.au/tmp/uniaud32-linux-6.12.21-20250413.zip but I don't see any offsets similar to what you posted...

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2528
  • Karma: +193/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1092 on: April 14, 2025, 09:31:16 am »
I refreshed today's build (https://smedley.id.au/tmp/uniaud32-linux-6.12.21-20250414.zip) it should have a bldlevel Date/Time (for the debug version) of "Date/Time:       14 Apr 2025 16:56:23"

Found another silly typo - doesn't seem to change much tho...

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2528
  • Karma: +193/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1093 on: April 14, 2025, 10:33:24 am »
OK https://smedley.id.au/tmp/uniaud32-linux-6.12.21-20250414b.zip fixes the hang at boot under virtualbox with HDA. @Sigurd you never know, it might help your situation too.

David McKenna

  • Hero Member
  • *****
  • Posts: 880
  • Karma: +30/-0
    • View Profile
Re: Updated Uniaud32 build
« Reply #1094 on: April 14, 2025, 12:00:19 pm »
 Thanks Paul - yep, this works on VBox using the hda driver. If I start PMUniMix though, I lose sound altogether. Next time I start PMUniMix, everything is set to zero. So as long as I don't start PMUniMix, sound works OK.

Regards,
« Last Edit: April 14, 2025, 12:05:09 pm by David McKenna »