FDH2 / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.5k stars 76 forks source link

Uxplay fails to start in my pentium devices #335

Closed ank-007 closed 2 days ago

ank-007 commented 2 weeks ago

I tested in two devices, both are Intel pentium Silver J5005, one running Windows 11 pro and another Windows 11 IOT, I added Debug logs to check where it is failing , the last log I got was before this line

mask = 0x1 << (bit - 32); or this mask = 0x1 << bit; You have any idea what might be the issue here?

Other thing is I compiled uxplay in my other i5 device and running it in these device.

fduncanh commented 2 weeks ago

This is code to set the uxplay features bit string at startup. You did say what the error was (segmentation fault?)


void dnssd_set_airplay_features(dnssd_t *dnssd, int bit, int val) {
    uint32_t mask;
    uint32_t *features;
    if (bit < 0 || bit > 63) return;
    if (val < 0 || val > 1) return;
    if (bit >= 32) {
        mask = 0x1 << (bit - 32);
        features = &(dnssd->features2);
    } else {
        mask = 0x1 << bit;
        features = &(dnssd->features1);
    }
    if (val) {
      *features = *features | mask;
    } else {
      *features = *features & ~mask;
    }
ank-007 commented 2 weeks ago

It is crashing at this line "mask = 0x1 << bit; " that I can see. Not sure whether it's a segmentation fault or other thing

fduncanh commented 2 weeks ago

crashing means what? if there is a core dump, there usually is some message.

probably the address "dnssd" is not valid for some reason. Check this by adding a line to show the address

printf("dnssd = %p\n",dnssd);

just before "void dnssd_set_airplay_features(dnssd_t *dnssd, int bit, int val) {" in lib/dnssd.c.

also add this printf line before the first call to dnssd_set_features in uxplay.c

this will help to see what is happening, but not why.

fduncanh commented 3 days ago

@ank-007 should this issue be closed?

ank-007 commented 2 days ago

I didn't find any solution for that, I got busy with other work, that is still open. I'll close this since we don't know the exact reason for the issue, it might be nothing to do with uxplay, it might be bonjour causing something in particular windows version. I'll reopen this if I am able to root cause it.

Thank you for all the help :)

fduncanh commented 2 days ago

If you get a small amount of time, please do the test I suggested:

probably the address "dnssd" is not valid for some reason. Check this by adding a line to show the address

printf("dnssd = %p\n",dnssd);

just before "void dnssd_set_airplay_features(dnssd_t *dnssd, int bit, int val) {" in lib/dnssd.c.

also add this printf line before the first call to dnssd_set_features in uxplay.c

Then rebuild and run.

this will help to see what is happening, but not why.

This will show if you correctly diagnosed the place where the coredump occurs.