VirtualBox

Opened 3 years ago

Last modified 3 years ago

#20106 new defect

AC97 possible regression in rev 76862

Reported by: deadwood Owned by:
Component: audio Version: VirtualBox 6.1.16
Keywords: Cc:
Guest type: other Host type: Linux

Description

I'm investigating why ac97 driver (https://github.com/deadw00d/AROS/tree/alt-abiv0/workbench/devs/AHI/Drivers/ac97) that we created stopped working with VBox. The driver continues working with real hardware and QEMU. After debugging and analysing VBox code I think a regression was introduced in rev 76862 by deleting the ichac97R3StreamFetchBDLE(pThis, pStream); call when setting up LVI register.

What happens now is that CIV register is advanced, but the PICB register is not refreshed (refresh is done ichac97R3StreamFetchBDLE(pThis, pStream)). What then happens is when ichac97R3StreamTransfer() is called, the cbLeft is zero so the whole logic of this function is skipped. The "hardware" hangs in mode where DMA is saying its active, Bus Master is enabled but nothing is tranfered. The only way to kick the "hardware" again is to set the CR register where the code again advanced the CIV but then calls ichac97R3StreamFetchBDLE() to update PICB. This way however a previous buffer is lost.

There are two places I see possible to change:

  • restore the call to ichac97R3StreamFetchBDLE when setting LVI and advancing CIV
  • allow ichac97R3StreamTransfer to operate with *initial* empty PICB just like the code in the look (when it sees empty PICB it continues to next buffer)

Change History (2)

comment:1 by deadwood, 3 years ago

A note on "advancing on empty initial PICB" (solution 2): this seems to be the behaviour of real hardware as well as QEMU. Our driver actually was setting up first buffer in position 1 instead of 0 and setting up LVI to 1. The situation is CIV=0, LVI=1, PIV=0, buffer 0 length 0, buffer 1 length <correct>. This works with real hardware and QEMU emulation, while in VBox this was also hanging the driver, because length of initial buffer (buffer 0) was 0 so the while(cbLeft){} exits immediately.

comment:2 by Sima, 3 years ago

This is a big problem. AC97 regression broke the sound in AROS operating system launched in VirtualBox, everything was fine before.. Competitors from VMWare still work fine. Dear developers, help your users, we don't want to migrate to VMWare Player.. This problem is most likely manifested not only in AROS.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use