• Butterfly
    Butterfly
    Georg
    Posts: 90 from 2004/4/7
    The AC97 driver (https://github.com/aros-development-team/AROS/tree/master/workbench/devs/AHI/Drivers/ac97) works too and works better than SB128 after similiar endianess hacks to QEMU's ac97.c:

    hw/audio/ac97.c/fetch_bd():

    Code:

    +#if 0
    r->bd.addr = le32_to_cpu (*(uint32_t *) &b[0]) & ~3;
    r->bd.ctl_len = le32_to_cpu (*(uint32_t *) &b[4]);
    +#else
    + r->bd.addr = be32_to_cpu (*(uint32_t *) &b[0]) & ~3;
    + r->bd.ctl_len = be32_to_cpu (*(uint32_t *) &b[4]);
    +#endif


    hw/audio/ac97.c/ac_97_io_nam_ops struct:

    Code:

    - .endianness = DEVICE_LITTE_ENDIAN,
    + .endianness = DEVICE_BIG_ENDIAN,


    hw/audio/ac97.c/ac97_io_nabm_ops struct:

    Code:

    - .endianness = DEVICE_LITTE_ENDIAN,
    + .endianness = DEVICE_BIG_ENDIAN,


    hw/audio/ac97.c/write_audio() before AUD_write() call:

    Code:

    {
    unsigned short sample;
    int ii;

    for(ii = 0; ii < to_copy / 2; ii++)
    {
    sample = ((unsigned short *)tmpbuf)[ii];
    ((unsigned short *)tmpbuf)[ii] = bswap16(sample);
    }
    }


    Code:

    ./qemu-system-ppc -machine sam460ex -rtc base=localtime -drive if=none,id=cd,file=aros-sam440-ppc.iso,format=raw -device ide-cd,drive=cd,bus=ide.1 -device ac97,audiodev=snd0 -audiodev pa,id=snd0
  • »11.02.22 - 07:51
    Profile