sysprog21 / semu

A minimalist RISC-V system emulator capable of running Linux kernel
MIT License
251 stars 47 forks source link

Implement VirtIO sound device #50

Open Cuda-Chen opened 4 months ago

Cuda-Chen commented 4 months ago

Currently, semu lacks of sound playing feature.

To implement, we can use VirtIO sound with ALSA architecture.

jserv commented 3 months ago

we can use VirtIO sound with ALSA architecture.

Can you illustrate the progress and the potential integration considerations?

Cuda-Chen commented 3 months ago

Hi @jserv ,

For the progress:

For potential integration considerations:

Cuda-Chen commented 2 months ago

Hi @jserv ,

For the supporting operations mentioned in https://github.com/sysprog21/semu/pull/53, to let semu plays sound I consider it requires to support more operations (and the operations are mentioned in VirtIO official document), should we investigate then list the operations that have to be implemented to support the common sound operation (e.g., playing sound, querying sound device information, etc.)?

jserv commented 2 months ago

should we investigate then list the operations that have to be implemented to support the common sound operation (e.g., playing sound, querying sound device information, etc.)?

Yes, go ahead.

Cuda-Chen commented 2 months ago

For this issue, I am going to implement VirtIO sound device supporting these operations:

Cuda-Chen commented 1 month ago

Update:

I am going to solve the sound card endpoint issue first.

Cuda-Chen commented 1 month ago

Update:

Cuda-Chen commented 4 weeks ago

Statue update:

jserv commented 3 weeks ago
  • I am going to implement to receive the PCM frames from TX queue to buffer so that we can play the sound.

Do you think whether if single-threaded queue manipulation is enough. I am not sure that such TX queue can be operated without extra threads.

Cuda-Chen commented 3 weeks ago

Do you think whether if single-threaded queue manipulation is enough. I am not sure that such TX queue can be operated without extra threads.

For my current findings, qemu and rust-vmm do not use any extra threads to operate TX queue. However, we may consider using extra threads as it seems we have to notify the device to complete transmission once it gets PCM frame from TX queue.

Cuda-Chen commented 3 weeks ago

Statue update:

Cuda-Chen commented 5 days ago

Statue update: