Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce sound related system calls #197

Merged
merged 1 commit into from
Aug 26, 2023
Merged

Introduce sound related system calls #197

merged 1 commit into from
Aug 26, 2023

Conversation

ChinYikMing
Copy link
Collaborator

@ChinYikMing ChinYikMing commented Aug 24, 2023

mus2midi utility is referenced by Mus2Midi .

Tested in Ubuntu 20.04.

Close #152

Makefile Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
src/mus2midi.h Outdated Show resolved Hide resolved
src/mus2midi.h Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update docs/syscall.md and provide a test program in tests directory.

@ChinYikMing
Copy link
Collaborator Author

ChinYikMing commented Aug 24, 2023

Provide a test program in tests directory.

Sound version of doom.elf is come with the commit, simply run make doom in sound branch

src/syscall.c Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
@jserv
Copy link
Contributor

jserv commented Aug 24, 2023

Sound version of doom.elf is come with the commit, simply run make doom in sound branch

No, let's minimize the necessary changes. You should provide a minimal C program that demonstrates the use of the proposed system calls instead of making extensive modifications to Doom. Once this pull request is merged, we can proceed with the Doom and Quake pull requests in their respective repositories.

@jserv
Copy link
Contributor

jserv commented Aug 24, 2023

Simple SDL2 Audio operates independently of SDL2 Mixer and is designed to play a single music file at a time. It also supports an unlimited number of sounds, achieving audio mixing natively without the need for an external mixer. It might be useful.

@ChinYikMing
Copy link
Collaborator Author

ChinYikMing commented Aug 25, 2023

Update docs/syscall.md and provide a test program in tests directory.

You may test the result of integration using the test program in tests/sound directory, use =h option to check the usage.

To test all at once, simply run ../../build/rv32emu sound.elf =m d_e1m1.mus =s dspistol =upmv =srep in tests/sound directory.

README.md Outdated Show resolved Hide resolved
jserv

This comment was marked as outdated.

docs/syscall.md Outdated Show resolved Hide resolved
docs/syscall.md Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
src/syscall.c Outdated Show resolved Hide resolved
docs/syscall.md Outdated Show resolved Hide resolved
src/mus2midi.c Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
tests/sound/sound.c Outdated Show resolved Hide resolved
tests/sound/sound.c Outdated Show resolved Hide resolved
tests/sound/sound.c Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@sysprog21 sysprog21 deleted a comment from ChinYikMing Aug 25, 2023
@ChinYikMing
Copy link
Collaborator Author

Move the content of src/mus2midi.c to src/syscall_sdl.c since the former is short and dedicated to the latter.

tests/sound/sound.c requires src/mus2midi.c, I think we should leave it to be.

I made a mistake which mus2midi is only used in emulator since it control the sound, I will adopt the required change.

src/syscall_sdl.c Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve git commit messages.

src/syscall_sdl.c Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
docs/syscall.md Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
docs/syscall.md Outdated Show resolved Hide resolved
@ChinYikMing ChinYikMing requested a review from jserv August 26, 2023 14:37
docs/syscall.md Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
src/syscall_sdl.c Outdated Show resolved Hide resolved
tests/sound/sound.c Outdated Show resolved Hide resolved
src/common.h Show resolved Hide resolved
tests/sound/sound.c Outdated Show resolved Hide resolved
tests/sound/sound.c Outdated Show resolved Hide resolved
@ChinYikMing ChinYikMing requested a review from jserv August 26, 2023 17:48
Incorporate the SDL2_mixer library to play sound in games
like Doom and Quake. The test program "tests/sound/sound.c"
illustrates the integration result. For more technical information,
see docs/syscall.md.

Close #152
@jserv jserv merged commit d746341 into sysprog21:master Aug 26, 2023
11 checks passed
@jserv
Copy link
Contributor

jserv commented Aug 26, 2023

Thank @ChinYikMing for contributing!

@ChinYikMing ChinYikMing deleted the sound branch August 26, 2023 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce sound related system calls
2 participants