Music 5000 in B-Em

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Fri Dec 08, 2017 1:03 pm

There are three ways B-Em can receive MIDI under Linux:
  • JACK (disabled by default)
  • ALSA sequencer (enabled by default)
  • ALSA raw (enabled by default)
If you want to use JACK, for example to talk to ardour etc. you can enable it with the following in the b-em.cfg file:

Code: Select all

[midi]
jack_enabled=1

With JACK and ALSA Sequencer, B-Em creates a virtual MIDI-in port and you use an external application to link this to another MIDI application's virtual MIDI out port. I use qjackctl as this does both Jack and ALSA but aconnect should be fine for ALSA.
ALSA raw is different in that B-Em opens a "default" device, which should be your first hardware MIDI-in port and therefore shouldn't need to be connected with an external software application. If it doesn't work, check b-emlog.txt for errors. Also the ALSA RAW device to use can be configured with a similar line in the b-em.cfg file:

Code: Select all

[midi]
alsa_raw_device = whatever
where whatever is the port you want to use.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Fri Dec 08, 2017 2:16 pm

Cheers Coeus...........I had started jack but not seen the entry in Jack ( ALSA midi port ) - I'll edit the config file tonight....

Wouldn't it be nice if down the line a bootable ISO could be made with just B-Em that anyone could put into their machine that loads up Music 5000 with a collection of Roms and Software ( like AMX Rom e.t.c ) ........that would be great like a portable BBC micro you can use anywhere
Last edited by pixelblip on Fri Dec 08, 2017 5:09 pm, edited 2 times in total.

User avatar
BigEd
Posts: 1694
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Music 5000 in B-Em

Postby BigEd » Fri Dec 08, 2017 2:33 pm

And the emulator should start full-screen!

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Fri Dec 08, 2017 10:47 pm

Ok sorry Coeus as this will test your patience at the weekend :lol:
You do realise I'm probably the only one in the world actually using this as the moment! I am determined to get this working as you put so much effort in. I am nearly there!

In Linux I cannot see B-Em in ALSA connect as an entry . I am assuming I should so as the default state is ALSA sequencer. In that case maybe something is wrong with my setup.........

I checked the b-emlog.txt log for problems but nothing there.

I am watching Aconnect and when I start B-EM it does not create a virtual port. I am using Ubuntu Studio. I realise you can't spend too much time troubleshooting my setup!

I downloaded B-eM 4000 from Github from the link you gave earlier a few threads ago ( there's only one place to download this isn't there just to check I'm not doing anything stupid)

I tried using Jack, but what happened was that there was no way of joining up my USB midi keyboard to B-EM.

I can see 'B-EM' on the right hand side under the MIDI tab in Jack control panel (it lists B-EM as Writeable Clients/Input Ports' ) but I can't drag anything to it! Arrgh!
Under 'ALSA' I can see my USB midi keyboard.......under Readable and Writeable on both sides.

It's frustrating I can see everything and yet not make the connection as B-em is in one tab and my keyboard in another.

Also as an aside - wouldn't using Jack mean B-EM creates an audio port under Audio so you can route that to system ouputs?

Sorry if this is too much to explain - it's quite possible me installing libraries has buggered it up at some point.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Fri Dec 08, 2017 11:30 pm

Ok I can see where I was going wrong.
I re-read your post.

You stated that to start B-EM in Jack you need to send an Application's midi output to B-EM input under the MIDI tab in Jack Control Panel.
So I started Hydrogen and then could connect them via midi in jack. Hoorah!
The only problem is I am hearing nothing. How does B-EM send it's sound out? Should it have created an entry in Audio (in the jack control panel?)

I am still puzzled why I can't use ALSA and it hasn't created a virtual ALSA sequencer port.......maybe it's my setup.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Fri Dec 08, 2017 11:52 pm

I will keep notating this as it might help others if they decide to go down this path of using B-em under Linux with Music 5000!
When I select instruments in Ubuntu studio it creates entries in Alsa and I can play thse instruments from my keyboard in Alsa by making a connection......so Alsa and Alsa Sequencer is working ok from what I can see.....

Which makes me then think am I using the right version of B-em Music 4000 from Github ( I assume so as it can create a jack entry for B-EM in the midi section)......

Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Sat Dec 09, 2017 12:14 am

pixelblip wrote:The only problem is I am hearing nothing. How does B-EM send it's sound out? Should it have created an entry in Audio (in the jack control panel?)


It seems there is a quirk in that, though OpenAL, the audio library B-Em uses for its general audio output, is JACK-aware, if you have the B-Em M4000 emulation start JACK to use for MIDI, OpenAL does not detect the JACK server and tries to use ALSA for sound output. The answer is to use qjackctl to start JACK (or start it from the command line but qjackctl is easier).

Here's what I get if I let B-Em start JACK:

Screenshot from 2017-12-09 00-02-37.png
Qjackctl "Connections" with JACK started by B-Em


If I start JACK from qjackctl first, then start B-Em:

Screenshot from 2017-12-09 00-05-15.png
Qjackctl "Connections" with JACK started by Qjackctl


Confusingly, B-Em appears in that list as alsoft as that seems to be the name OpenAL uses when connecting to JACK. You can see in that screendump that B-Em's audio output has been automatically connected to the first two playback channels on the soundcard.

Next you can see B-Em's MIDI port in the MIDI tab. As I provide the correct name to JACK that one is sensibly named. As I have no other JACK-aware MIDI applications running just for these screen dumps there is nothing to connect it to but I am guessing Hydrogen should appear in the left pane if you have it running.

Screenshot from 2017-12-09 00-08-32.png
Qjackctl "Connections" MIDI tab


Finally, this tab shows the ALSA sequencer port:

Screenshot from 2017-12-09 00-21-04.png
Qjackctl "Connections" ALSA tab


For reference, here is the output if aconnect -l:

Code: Select all

$ aconnect -l
client 0: 'System' [type=kernel]
    0 'Timer           '
    1 'Announce        '
   Connecting To: 128:0
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 16: 'Hammerfall DSP' [type=kernel,card=0]
    0 'HDSP MIDI 1     '
client 129: 'B-Em' [type=user,pid=31831]
    0 'b-em:in         '


If you think your version may not be up-to-date, from within the directory you built in in try running

Code: Select all

git log src/midi-linux.c
. You should see something like this:

Code: Select all

commit e56628e7f499b94c19d9943d4d37d44a6eaa4f13
Author: Steve Fosdick <steve@fosdick.me.uk>
Date:   Wed Dec 6 19:53:18 2017 +0000

    m4000: implement MIDI running status for ALSA raw MIDI

commit 24a29923be4815b88448a538e30c8efd38d841b7 (tag: music4000-pre1)
Author: Steve Fosdick <steve@fosdick.me.uk>
Date:   Mon Dec 4 23:37:10 2017 +0000

    m4000: add an untested Windows MIDI implementation.

commit 42ca0a07bbe5807f5e4f0ab8f41c1c8757ba3401
Author: Steve Fosdick <steve@fosdick.me.uk>
Date:   Mon Dec 4 20:34:07 2017 +0000

    m4000: Separate and improve Linux MIDI implementation.
   
    This moves the Linux MIDI implementation into a separate file from the
    Music 4000 keyboard emulation and adds an ALSA raw MIDI implementation
    to compiliment the existing JACK and ALSA sequencer options.  It also
    uses conditional compilation to compile the implementations for which
    the headers are present on the system being compiled and allows run-time


If it is out-of-date, do

Code: Select all

git pull
to update it.
Last edited by Coeus on Sat Dec 09, 2017 12:31 am, edited 1 time in total.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 12:30 am

Thank you so much for that clearly worded reply :)

I am starting jack from qjackctl then B-Em but not seeing those ports likealsoft under Audio or B em under Alsa so something must be wrong with my setup. How strange I can see the B em midi port though.

I guess I'll have to start from scratch to prove to myself its nothing weird with my Linux setup. It's pretty vanilla ubuntu studio 16........

Hmmmm.....

Well Coeus you have gone the extra mile for me.....I'm just going to have to see if I can spot it or reinstall.

Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Sat Dec 09, 2017 12:39 am

pixelblip wrote:Thank you so much for that clearly worded reply :)

I am starting jack from qjackctl then B-Em butnot seeing those ports under Audio or Alsa so something must be wrong with my setup. How strange I can see the B em midi port though.


Interesting. Reading my own commit line I saw the line: "conditional compilation to compile the implementations for which the headers are present on the system". In midi-linux.c there is code like this:

Code: Select all

#ifdef HAVE_ALSA_ASOUNDLIB_H

extern int quited;
#include <alsa/asoundlib.h>

static pthread_t alsa_seq_thread;

static void *alsa_seq_midi_run(void *arg) {
    int status;
    snd_seq_t *midi_seq = NULL;
    int alsa_seq_port = -1;
    snd_seq_event_t *ev;
...


The variable HAVE_ALSA_ASOUNDLIB_H is set by ./configure when it tests to see if it can find that include file. If it can't find the include file alsa/asoundlib.h it doesn't include the ALSA midi options, only the JACK ones. Did you have the alsadev package installed when you ran ./configure? If not, re-run it and re-compile it and the ALSA driver will then be compiled in. Check the output from make. If you don't see midi-linux.c being re-compiled then remove src/b_em-midi-linux.o (the .o, not the .c) then make to force it to recompile.

As for the audio output not appearing in JACK, that maybe to do with whether the Ubuntu OpenAL package has the JACK option enabled. I'm on Arch and packages tend to be fairly fully-featured. Debian tends to go for many small packages so you may have alternate versions of some packages with and without extra feature, or a main package and extra plug-in packages so see what's in the Ubuntu repository for OpenAL.
Last edited by Coeus on Sat Dec 09, 2017 12:42 am, edited 1 time in total.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 12:42 am

I was about to go to bed and thought nope I gotta check this out :lol:

When I type
git log src/midi-linux.c

I get

fatal: Not a git repository (or any of the parent directories): .git

So it seems I haven't set this up right ( I just downloaded it straight from a link you posted ).

Could it be I am not using the most up to date version......let's see

I've got really used github before so it's all new I am afraid!

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 12:45 am

Sorry just re-read your post. Let me recompile the program again just to see then we can workout github!
You are being very patient with a newbie here! Thank you.

Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Sat Dec 09, 2017 12:45 am

pixelblip wrote:I've got really used github before so it's all new I am afraid!


OK, I don;t remember now if you got github to generate a .zip for you to download or if you are using the source for the version for Windows but either way your source tree should be recent enough. I think the problem with ALSA MIDI is most likely alsadev was not installed when you ran ./configure so it wasn't compiled in. See my previous post.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 12:50 am

You are very good......
Looking through Synaptic, alsadev is not listed as an option. So this could be the problem.
Sorry.....what a headache for you trying to work this out!

Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Sat Dec 09, 2017 12:54 am

pixelblip wrote:You are very good......
Looking through Synaptic, alsadev is not listed as an option. So this could be the problem.
Sorry.....what a headache for you trying to work this out!


Which version of Ubuntu?

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 12:56 am

I have libasound-dev installed already ( I am reading alsa dev belongs to that.......is that correct or should I be installing something called alsadev?)
Oh the joys of Linux for the noob! :lol: I would hate to be trying to help me on the other end!

I am going to re-compile it in the meantime anyway!

Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Sat Dec 09, 2017 1:02 am

pixelblip wrote:I have libasound-dev installed already ( I am reading alsa dev belongs to that.......is that correct or should I be installing something called alsadev?)
Oh the joys of Linux for the noob! :lol: I would hate to be trying to help me on the other end!

I am going to re-compile it in the meantime anyway!


It looks like Ubuntu artful also has a libasound2-dev. We want the header file /usr/include/alsa/asoundlib.h to be present so going to https://packages.ubuntu.com/ and sticking this in the search box under "Search the contents of packages" we get: https://packages.ubuntu.com/search?sear ... l&arch=any so that says to install libasound2-dev

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 1:06 am

libasound-dev2 was already installed.....and I re-compiled B-EM but still no luck. I am using Ubuntu Studio 16.

Rather than me using up what is left of your precious weekend :lol: perhaps it's better I start from scratch with a Debian distro or a new Ubuntu......at least I know all the steps now........on my pc now libasound-dev2 is installed and it is still not working maybe something has screwed up.....i can see that file asoundlib.h in usr/include/alsa by the way.

I will give you credit, you sure know your Linux Coeus!

Thank you for all of your help so far.......you've been amazing.

Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Sat Dec 09, 2017 1:21 am

pixelblip wrote:libasound-dev2 was already installed.....and I re-compiled B-EM but still no luck. I am using Ubuntu Studio 16.


Ok, so when you re-compiled it did you see midi-linux in the list of things getting re-compiled? You should see something like:

Code: Select all

  CC       b_em-midi-linux.o
  CXXLD    b-em
cp b-em ..


If it is not there then make didn't re-compile it. Make tries to clever and only re-compile what you've changed but in this case that isn't helpful as we know something else has changed that means that module needs to be recompiled. You could try:

Code: Select all

./configure
make clean
make


If it still plays up it may be worth compiling it for debug messages enabled. To do this:

Code: Select all

./configure --enable-debug
make clean
make


Then when you start B-Em check in the b-emlog.txt file and you should see lines like these:

Code: Select all

09/12/2017 01:18:39 DEBUG midi-linux: jack client open
09/12/2017 01:18:39 DEBUG midi-linux: jack process callback set
09/12/2017 01:18:39 DEBUG midi-linux: jack midi port open
09/12/2017 01:18:39 DEBUG midi-linux: ALSA MIDI sequencer client created
09/12/2017 01:18:39 DEBUG midi-linux: ALSA MIDI sequencer port created
09/12/2017 01:18:39 DEBUG midi-linux: waiting for ALSA MIDI sequencer event
09/12/2017 01:18:39 DEBUG midi-linux: jack active


If lines are missing it would be useful to post what lines you do have, for example by running

Code: Select all

grep midi-linux b-emlog.txt
and posting the output. Also the output of

Code: Select all

grep -i asound config.status
which should show something like:

Code: Select all

"Y_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_JACK_JACK_H=1 -DHAVE_ALSA_ASOUNDLIB_H=1"

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 1:24 am

Ok I will try all these things......and report back ( I can't get to sleep now as I need to solve this! :D )
Before I try your latest instructions here was my previous compile:


checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether to enable debugging... no
checking platform...... checking for allegro-config... /usr/bin/allegro-config
checking for Allegro - version >= 4.0.0... yes (version 4.4.2)
checking for gzopen in -lz... yes
checking for alGetError in -lopenal... yes
checking for alutInit in -lalut... yes
checking for asprintf... yes
checking for tdestroy... yes
checking for stpcpy... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking jack/jack.h usability... yes
checking jack/jack.h presence... yes
checking for jack/jack.h... yes
checking alsa/asoundlib.h usability... yes
checking alsa/asoundlib.h presence... yes
checking for alsa/asoundlib.h... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: executing depfiles commands

Configured version: 2.2

Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Sat Dec 09, 2017 1:32 am

pixelblip wrote:Ok I will try all these things......and report back ( I can't get to sleep now as I need to solve this! :D )
Before I try your latest instructions here was my previous compile:

Code: Select all

...
checking alsa/asoundlib.h usability... yes
checking alsa/asoundlib.h presence... yes
checking for alsa/asoundlib.h... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: executing depfiles commands

Configured version: 2.2


That looks just like mine except mine finishes:

Code: Select all

config.status: executing depfiles commands

Configured version: 24a2992-dirty


but that is because working out the git commit number (24a2992) relies on the source tree being a git repository otherwise it falls back to the number of the last released version. There are others clues in your configure output that this is the one from GitHub so that's fine.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 1:34 am

Hoorahhhhhhhhhhhhhhhhhhh! :lol: :lol: :lol:
B-em is there now under Alsa! =D> =D>
So I have learnt something about make and the quirks of compiling.
It was that make clean that did it. Wow.

Well done Coeus! I shall reward you with some decent music I hope!
You are a * and have gone up and above the call of duty for a fellow Beebhead!
I wish you a lovely relaxing weekend. I know I am going to have some fun now making some music because of you :)

The only slight issue is that B-EM is not appearing under Audio........ at all.
I wonder if that is anything to do with Pulse Audio being installed...........anyway we are so nearly there.

We can pick up this another time........it's almost there now.
Last edited by pixelblip on Sat Dec 09, 2017 1:42 am, edited 2 times in total.

Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Sat Dec 09, 2017 1:36 am

pixelblip wrote:Well done Coeus! I shall reward you with some decent music I hope!


I'll look forward to it. In the meantime my bed is calling.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 1:37 am

Ah bedtime for you as well.
Goodnight Coeus.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 6:15 am

Morning......of course I couldn't stop dreaming about this could I ......even when asleep. Doh!
I have made the midi connection to B-EM now in ALSA.
I am getting no sound coming out......I can see Midi is working.

Also in Jack there was no audio output for asound..........
I don't mind starting again ( I left Debian ISOS downloading overnight ) but sometimes it's better to trouble shoot these things as they no doubt might pop up again............
Last edited by pixelblip on Sat Dec 09, 2017 6:31 am, edited 1 time in total.

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 6:28 am

Blimey. We got there!
Finally! =D>
It was because I needed to put back

[midi]
jack_enabled=0
alsa_seq_enabled=1
alsa_raw_enabled=1
alsa_raw_device=default

in the config file.

It's easy to slip up!

The only thing that isn't working now is Jack Audio. It would be interesting to know why though.....as it means I can record my output into Ardour..........
The buffer is quite high for me in ALSA......I am getting break ups holding the note down. I will see if I can spot when you change the buffer from your notes.


Like I said it doesn't create an audio port so maybe it's something to do with Asound? I recall I got Asound from running a Git command but dunno if that makes any difference.

If I can solve this Jack issue it might mean lower latency ( comparable to windows )

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 7:23 am

Screenshot
Attachments
no audio.png

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 11:37 am

Ok I will start again ........try Debian........perhaps there's something up with asound on this........at least I have all the steps now.

Coeus
Posts: 705
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Postby Coeus » Sat Dec 09, 2017 1:16 pm

pixelblip wrote:Ok I will start again ........try Debian........perhaps there's something up with asound on this........at least I have all the steps now.


I think your issue is to do with OpenAL. I'd not really come across OpenAL before B-Em and so I thought I'd do some digging. First I ran the ldd command on B-Em to find where the OpenAL library is:

Code: Select all

$ ldd b-em
   linux-vdso.so.1 (0x00007ffc565bf000)
   liballeg.so.4.4 => /usr/lib/liballeg.so.4.4 (0x00007f6658877000)
   libz.so.1 => /usr/lib/libz.so.1 (0x00007f6658660000)
   libopenal.so.1 => /usr/lib/libopenal.so.1 (0x00007f6658394000)
   libalut.so.0 => /usr/lib/libalut.so.0 (0x00007f665818c000)
   libjack.so.0 => /usr/lib/libjack.so.0 (0x00007f6657f6b000)
   libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f6657d4d000)
   libasound.so.2 => /usr/lib/libasound.so.2 (0x00007f6657a5e000)
   libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f66576d7000)
   libm.so.6 => /usr/lib/libm.so.6 (0x00007f665738b000)
   libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f6657174000)
   libc.so.6 => /usr/lib/libc.so.6 (0x00007f6656dbc000)
   librt.so.1 => /usr/lib/librt.so.1 (0x00007f6656bb4000)
   libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f6656875000)
   libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f6656663000)
   libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007f6656459000)
   libXpm.so.4 => /usr/lib/libXpm.so.4 (0x00007f6656247000)
   libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x00007f6656041000)
   libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f6655e3d000)
   libdb-5.3.so => /usr/lib/libdb-5.3.so (0x00007f6655a7e000)
   /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f665a0f0000)
   libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f6655855000)
   libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007f665564a000)
   libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007f6655444000)
   libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f6655240000)
   libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f665503a000)

The ldd command gives the list of shared libraries that will be loaded when you run a program. In that list, above, was:

Code: Select all

   libopenal.so.1 => /usr/lib/libopenal.so.1 (0x00007f6658394000)
so I repeated for that file:

Code: Select all

$ ldd /usr/lib/libopenal.so.1
   linux-vdso.so.1 (0x00007ffe815b1000)
   librt.so.1 => /usr/lib/librt.so.1 (0x00007f5aac447000)
   libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f5aac229000)
   libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f5aac025000)
   libm.so.6 => /usr/lib/libm.so.6 (0x00007f5aabcd9000)
   libc.so.6 => /usr/lib/libc.so.6 (0x00007f5aab921000)
   /usr/lib64/ld-linux-x86-64.so.2 (0x00007f5aac91b000)

That doesn't reveal much so this suggests OopenAL is choosing which backends to load at run-time so I thought "maybe it has plugins". To find out I ran:

Code: Select all

$ pkgfile /usr/lib/libopenal.so.1
extra/openal

Bear in mind I am on Arch so the command on Ubuntu will be slighly different but this is asking "which package does the file /usr/lib/libopenal.so.1 belong to?". On Ubuntu you'd do:

Code: Select all

$ dpkg -S /usr/lib/libopenal.so.1

That told me it was part of a package called openal in the extra part of the repository so the next thing is to see what other files are in the package. Again on Arch this is:

Code: Select all

$ pacman -Ql openal
openal /usr/
openal /usr/bin/
openal /usr/bin/alrecord
openal /usr/bin/alsoft-config
openal /usr/bin/altonegen
openal /usr/bin/bsincgen
openal /usr/bin/makehrtf
openal /usr/bin/openal-info
openal /usr/include/
openal /usr/include/AL/
openal /usr/include/AL/al.h
openal /usr/include/AL/alc.h
openal /usr/include/AL/alext.h
openal /usr/include/AL/efx-creative.h
openal /usr/include/AL/efx-presets.h
openal /usr/include/AL/efx.h
openal /usr/lib/
openal /usr/lib/cmake/
openal /usr/lib/cmake/OpenAL/
openal /usr/lib/cmake/OpenAL/OpenALConfig-release.cmake
openal /usr/lib/cmake/OpenAL/OpenALConfig.cmake
openal /usr/lib/libopenal.so
openal /usr/lib/libopenal.so.1
openal /usr/lib/libopenal.so.1.18.2
openal /usr/lib/pkgconfig/
openal /usr/lib/pkgconfig/openal.pc
openal /usr/share/
openal /usr/share/doc/
openal /usr/share/doc/openal/
openal /usr/share/doc/openal/3D7.1.txt
openal /usr/share/doc/openal/ambdec.txt
openal /usr/share/doc/openal/ambisonics.txt
openal /usr/share/doc/openal/env-vars.txt
openal /usr/share/doc/openal/hrtf.txt
openal /usr/share/openal/
openal /usr/share/openal/alsoftrc.sample
openal /usr/share/openal/hrtf/
openal /usr/share/openal/hrtf/default-44100.mhr
openal /usr/share/openal/hrtf/default-48000.mhr
openal /usr/share/openal/presets/
openal /usr/share/openal/presets/3D7.1.ambdec
openal /usr/share/openal/presets/hexagon.ambdec
openal /usr/share/openal/presets/itu5.1.ambdec
openal /usr/share/openal/presets/presets.txt
openal /usr/share/openal/presets/rectangle.ambdec
openal /usr/share/openal/presets/square.ambdec


Nothing that looks like a plugin there but I did notice a command (because it's in 'bin') called alsoft-config so I thought that was worth a look. That gives a UI for configuring OpenAL and sure enough there is a "Backends" tab:
Screenshot from 2017-12-09 13-15-06.png
OpenAL Config Backends tab

User avatar
pixelblip
Posts: 622
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Postby pixelblip » Sat Dec 09, 2017 3:13 pm

Great! Its funny as was reading about backends in openal this morning and how to view them.
I will have a look when I get back thank you.
Id rather try to sort the issue out rather than reinstall again.....
Ive sure learnt a bit more this weekend

User avatar
hoglet
Posts: 6979
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Music 5000 in B-Em

Postby hoglet » Sat Dec 09, 2017 6:03 pm

Steve,

I've just been doing a bit of regression testing on the code in the sf/m4000 branch.

(And also trying to get the right packages installed on my new Ubuntu 16.04 (64 bit) system.)

I currently have the following in b-em.cfg:

Code: Select all

[midi]
jack_enabled = 0
alsa_seq_enabled = 0
alsa_raw_enabled = 0
alsa_raw_device = default


I'm finding that tracks played in Music 5000 are suffering audio break-up/stuttering. I've quickly switched back to the code on master, and that seems to be fine. Doubling the M5 buffering from 750 to 1500 seems to resolve the issue.

My CPU usage (in top) is consistently about 68%. This is a fairly old system now, using a Core 2 Quad Q9550.

Dave