• Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 109 from 2004/4/7

    jacadcaps wrote:

    I am not aware of qemu being able to emulate any cards that MorphOS has drivers for.

    SB128 driver (https://github.com/aros-development-team/AROS/tree/master/workbench/devs/AHI/Drivers/SB128) sort of works with some problems (maybe driver bugs) with AROS PPC on Qemu PPC after some changes/hacks to QEMU's hw/audio/es1370.c. Port to MOS would probably take half an hour.

    QEMU hw/audio/es1370.c/es_write():


    + val = bswap32(val); /* maybe the AHI driver is supposed to do that */
    addr = es1370_fixup (s, addr);

    QEMU hw/audio/es1370.c/es_read():


    + val = bswap32(val); /* maybe the AHI driver is supposed to do that */
    return val;

    QEMU hw/audio/es1370.c/es_transfer_audio():


    + if (1) { /* surely the AHI driver is supposed to do that */
    + unsigned short sample;
    + int ii;
    + for(ii = 0; ii < to_copy / 2; ii++)
    + {
    + sample = ((unsigned short *)tmpbuf)[ii];
    + ((unsigned short *)tmpbuf)[ii] = bswap16(sample);
    + }
    + }

    copied = AUD_write (voice, tmpbuf, to_copy);

    It does not really work correctly but it makes the beep sound in AHI Prefs program when clicking Test button. But there are sometimes distortions. Sometimes it sounds correct. Maybe something with buffer underflow, interrupt problem. Don't know. Qemu x86 with AROS x86 with same SB128 driver has same sound problem.

    Normally when running AROS on qemu on Linux with PulseAudio, sound is muted with this driver. A workaround for AROS is to also activate the ac97 drive in qemu, not just the es1370 device. The ac97 AHI driver I guess does something in initialization that causes the sound to no longer be muted:


    qemu-system-ppc .. .. -device ac97,audiodev=snd0 -device es1370,audiodev=snd0 -audiodev pa,id=snd0

    Another workaround is to build and run qemu-system-ppc with alsa driver (is by default notcompiled in). But sound distortions are worse compared to PulseAudio.


    ./configure --target-list="ppc-softmmu" --audio-drv-list=pa,alsa


    qemu-system-ppc -audiodev alsa,id=snd0
  • »10.02.22 - 17:51