Hatari 2.1.0 Linux Falcon emulation sound issue

A forum about the Hatari ST/STE/Falcon emulator - the current version is v2.1.0

Moderators: simonsunnyboy, thothy, Moderator Team

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 741
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Faucon2001 » Thu Nov 08, 2018 1:20 pm

Hi,
I have been trying to include in BeeKey a Falcon setup with Hatari 2.1.0 and I am facing issues with sound, or it crashes or I don't have sound.
System : Ubuntu sever 16.04, X11, Openbox, SDL 2.0.8, Alsa, jackd, Hatari 2.1.0 latest build with portaudio

1 - First I don't have any issue if I run Hatari in STE emulation with TOS 1.62. Sound is working, system is stable.

2 - If I run Hatari in Falcon emulation mode without jackd I have sound but the emulation crashes after a few minutes.
Hatari error messages :
ALSA lib pcm_route.c:867: Found no matching channel map
ALSA lib pulse.c:243: Unable to connect : Connection refused
hatari: pcm.c:2758: Assertion 'dst < src || dst >= src + bytes' failed
Aborted

3 - If I run Hatari in Falcon emulation mode with jackd ( jackd -d alsa) the emulation is stable but I have no sound.
Hatari error message :
ALSA lib pcm_dmix.c:1029: unable to open slave
ALSA lib pcm_snoop.c:606: unable to open slave

Any idea of what can be wrong with my setup?
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1812
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Eero Tamminen » Mon Nov 12, 2018 10:01 pm

Faucon2001 wrote:I have been trying to include in BeeKey a Falcon setup with Hatari 2.1.0 and I am facing issues with sound, or it crashes or I don't have sound.
System : Ubuntu sever 16.04, X11, Openbox, SDL 2.0.8, Alsa, jackd, Hatari 2.1.0 latest build with portaudio

1 - First I don't have any issue if I run Hatari in STE emulation with TOS 1.62. Sound is working, system is stable.

2 - If I run Hatari in Falcon emulation mode without jackd I have sound but the emulation crashes after a few minutes.
Hatari error messages :
ALSA lib pcm_route.c:867: Found no matching channel map
ALSA lib pulse.c:243: Unable to connect : Connection refused
hatari: pcm.c:2758: Assertion 'dst < src || dst >= src + bytes' failed
Aborted

3 - If I run Hatari in Falcon emulation mode with jackd ( jackd -d alsa) the emulation is stable but I have no sound.
Hatari error message :
ALSA lib pcm_dmix.c:1029: unable to open slave
ALSA lib pcm_snoop.c:606: unable to open slave

Any idea of what can be wrong with my setup?


Assert & abort seems to come from ALSA initialization, same with the other ALSA errors. Hatari doesn't do anything directly with ALSA, all audio data goes through SDL APIs.

Portaudio should be used only for Falcon microphone, but maybe it's interfering with SDL audio functionality. If you build Hatari without portaudio, does it work any better?

If not, do other SDL2 programs with audio output work in your setup?

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 741
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Faucon2001 » Wed Nov 14, 2018 8:08 pm

I have build Hatari without portaudio and Falcon mode is working perfectly ; no more crash and I have sound.
I have tried to build myself portaudio for ALSA without jack, and it crashes again. So it seems that something is fishy with portaudio.
I'll try to build portaudio again with jack.
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 741
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Faucon2001 » Wed Nov 14, 2018 8:47 pm

I build portaudio with libjack-dev and got the same crash adter a few minutes with the same error message.
So for now, I am reduced to use hatari without protaudio input in Falcon mode.
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1812
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Eero Tamminen » Mon Nov 19, 2018 12:17 am

Thanks for testing!

When I get time, I'll install portaudio and will try whether I can reproduce the issue.

When you say that Hatari crashes after few minutes, is this just from idling in TOS v4 desktop, or are you running some program?

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 741
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Faucon2001 » Tue Nov 20, 2018 1:14 pm

Yes, it crashes just waiting under the TOS 4.04 desktop. No need to have any app running. The TOS setup I use is basic, no NVDI or auto prg, just xcontrol for Falcon.
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1812
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Eero Tamminen » Wed Nov 21, 2018 12:01 am

I get more audio library warnings with portaudio2 support enabled (no jack daemon, just pulseaudio) than you:

Code: Select all

ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock


But there's no assert and sound works, both YM stuff from demo on Hatari cartridge (available when GEMDOS HD is enabled), and from Ace MIDI (demo).

Do things work any better if you have pulseaudio running like I did, instead of using plain ALSA?

Note, when I tested having Xcontrol present, its sound module defaulted to zero volume & gain (also after removing saved NVRAM settings), so obviously there was no sound when booting with that. Those settings needed to be changed to hear something.

EDIT: clarify question.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1812
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Eero Tamminen » Wed Nov 21, 2018 11:15 pm

When I ran also JACK (jackd -d alsa), alsa/pulseaudio libraries froze Hatari when using ACE MIDI (demo). Killing Jack unfroze Hatari.

I guess that's just too many audio libraries (SDL, Portaudio, Pulseaudio, Jack, ALSA) interfering with each other.

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 741
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Faucon2001 » Thu Nov 22, 2018 1:17 am

Thanks Eero, I’ll try With pulseaudio.
The Messages you got for from alsa can be solved by changing the output assignation in alsa.conf
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 741
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Faucon2001 » Sat Nov 24, 2018 10:26 am

I confirm that with pulseaudio installed, Hatari build with portaudio is no longer crashing and sound is working.
Thanks !
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1812
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Eero Tamminen » Sun Nov 25, 2018 10:23 pm

Ok, great that you got it working!

I had no idea that Portaudio doesn't work properly with SDL and/or ALSA unless pulseaudio is also installed. Maybe Portaudio just doesn't work without Pulseaudio, if had been built with Pulseaudio support?

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 741
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Faucon2001 » Tue Nov 27, 2018 8:06 pm

I don't know. When I build Portaudio, it did it without pulseaudio support, nor Jack. it's kind of strange.
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1812
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari 2.1.0 Linux Falcon emulation sound issue

Postby Eero Tamminen » Tue Nov 27, 2018 9:51 pm

Oh, I didn't realize you had rebuilt also portaudio. But looking at the upstream portaudio code, I don't actually see there any pulseaudio support code.

When looking at the library dependencies on my system ("readelf -d <lib> | grep NEEDED"), portaudio doesn't link pulseaudio, even indirectly, it depends on libjack -> libasound. Only libSDL2 depends on pulseaudio.

When I looked into ALSA libasound and straced what Hatari does in ST & Falcon emulation, I found following...

In ST mode, Hatari just runs pulseaudio stuff, because SDL2 uses pulseaudio directly.

However, in Falcon mode, portaudio initialization apparently goes directly to ALSA, but libasound2 is configured in Ubuntu to use pulseaudio server.

See following files:

Code: Select all

/usr/share/alsa/alsa.conf.d//pulse.conf
/usr/share/alsa/pulse-alsa.conf


So... I think it's actually ALSA that fails in your system when pulseaudio isn't present.

My guess is that ALSA tries to connect pulseaudio server directly, whereas pulseaudio library might be able to start or works as one, if server isn't already running.


Social Media

     

Return to “Hatari”

Who is online

Users browsing this forum: No registered users and 2 guests