kanjitalk755 / macemu

Basilisk II and SheepShaver Macintosh emulators
332 stars 50 forks source link

BasiliskII, no audio/sound on Linux #150

Closed EndeavourAccuracy closed 1 year ago

EndeavourAccuracy commented 1 year ago

Unfortunately, Basilisk does not give me audio on Linux.

Going by ~/.config/BasiliskII/prefs, it is still trying to use the old /dev/dsp and /dev/mixer devices, that no longer exist on modern systems.

I've tried four workarounds, but none gave me audio. 1. --enable-sdl-audio 2. $ apt install pulseaudio-utils $ padsp BasiliskIIGUI 3. $ apt install alsa-oss $ aoss BasiliskIIGUI 4. On the Graphics/Sound tab, changed the two audio device entries to /dev/snd/ (Replacing with any devices I could find.)

Is there anyone out there using BasiliskII on Linux, who has gotten audio to work?

kanjitalk755 commented 1 year ago

The audio device settings in the GUI are ignored. In the current version, an available audio device is detected by SDL. In my environment (Debian), sound is output normally using pulseaudio. The following log is output to the terminal.

Using SDL/pulseaudio audio output
EndeavourAccuracy commented 1 year ago

Thanks for your reply. I get the exact same output on my terminal, but audio does not work for me. Is there any chance you can help me debug the issue, for instance by telling me what commands to execute and paste the output of, or any custom code (e.g. modifications to the program) I can run to help you figure out why I get no sound in Basilisk? Thanks.

kanjitalk755 commented 1 year ago

If you got the same log message, the audio device was successfully opened. Next, AudioInterrupt() in BasiliskII/src/SDL/audio_sdl.cpp is called continuously while sound is playing on the guest side. Please check that.

EndeavourAccuracy commented 1 year ago

I appreciate your help and suggestion. I've edited the file and (re)compiled/linked. I added printf ("AudioInterrupt\n"); under D(bug("AudioInterrupt\n")); And I added printf ("play_startup\n"); under static int play_startup(void *arg) {

The resulting output is

@stimpy ~ $ BasiliskIIGUI 
Using prefs file at /home/norbert/.config/BasiliskII/prefs
Basilisk II V1.1 by Christian Bauer et al.
Using prefs file at /home/norbert/.config/BasiliskII/prefs
Reading ROM file...
Using SDL/pulseaudio audio output
Using SDL_Renderer driver: opengl
play_startup
WARNING: No FSM present, disabling ExtFS

Even when I play a game, it never shows "AudioInterrupt" on the console. The only output is what I pasted above.

RonaldPR commented 1 year ago

It may or may not be the issue here, but in my experience sound not working in an otherwise functional emulator is usual caused by incorrect settings.

  1. In the GUI, sound output should not be disabled (in the prefs file: "nosound false").

  2. In Sound control panel in the installed System/MacOS, "Built-in" should be selected (= clicked on to highlight it) for the sound output device.

(In MacOS 8.1, the Sound control panel is sometimes installed in the “Apple Extras” folder. You can use it there to select the built-in output device.)

EndeavourAccuracy commented 1 year ago

Hi Ronald. I don't think either is the issue here. The Disable Sound Output checkbox is not checked, and prefs says nosound false. The system is System 7 (System70_boot.dsk, with PERFORMA.ROM), which I don't think had/has functionality to toggle audio. All other applications, including other emulators (DOSBox, ZSNES, etc) have audio on my computer.

cat7 commented 1 year ago

That floppy image does not do audio. It has no control panels. Have you tried a full installation?

EndeavourAccuracy commented 1 year ago

That floppy image does not do audio.

Hm, I see. Can you tell me which volume I can add to get System 7 with out-of-the-box audio support? Preferably an image that is relatively widely available (i.e. on more than one website, and without any unusual customizations). Thanks in advance.

cat7 commented 1 year ago

To prevent any hidden surprises it really would be best to install yourself.

EndeavourAccuracy commented 1 year ago

Hi again cat7. I prefer to get the name (and download location(s)) of a volume that provides System 7 with out-of-the-box audio support. I'll provide some context. I am the author of popyorn, the level editor of Prince of Persia for the Macintosh. I'm on the verge of releasing an improved version, that will also provide its users with more accurate instructions on how to initiate playtesting. Simultaneously, I'm in the process of rewriting a 2016 how-to document about using Basilisk II on GNU/Linux. To you and me, an additional installation step on top of what's already necessary to edit/launch PoP is not a big deal, but it will be too much to ask of some users. I'm therefore looking for a standard System 7 image, that will allow users to immediately get started, skipping any installation steps. Quite frankly, getting PoP for Mac to run properly is already a pain in the balls, particularly on GNU/Linux. (Even after already doing all the work to unpack the game archives to create HFS images.)

cat7 commented 1 year ago

Ah, nice. You know about these? https://www.emaculation.com/doku.php/sheepshaver_basiliskii_linux Alas I know of no stable source for a pre-installed disk image. What system should it preferably contain?

EndeavourAccuracy commented 1 year ago

What system should it preferably contain?

Any release of System 7 (that is not a floppy image) should be fine, assuming all can run Prince of Persia with out-of-the-box audio.

cat7 commented 1 year ago

You can drop me a line at hsp.cat7@gmail.com and I'll send you a google drive link to a 7zipped 100Mb system 753 installation that runs pop.

EndeavourAccuracy commented 1 year ago

Hi, that's not useful to me. I'm closing this issue, so everyone can move on.

cat7 commented 1 year ago

Hi, you leave me perplexed. I attempted to offer you a public link to a clean system 753 disk image to use with Basilisk with audio enabled. I tested it, it can run pop. For obvious reasons I would not share such a link in this discussion.