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

compile error from cloned openMHA #7

Open
JohnAbarro opened this issue Aug 5, 2018 · 11 comments
Open

compile error from cloned openMHA #7

JohnAbarro opened this issue Aug 5, 2018 · 11 comments

Comments

@JohnAbarro
Copy link

Hi again! I'm trying to compile openMHA and install it. but I get a missing header file error for not being able to find sndfile.h
image

I simply used the git clone command, cd openMHA, then wrote the ./configure && sudo make
I also tried ./configure && make
am I supposed to get the file(s) elsewhere?
it is most likely that I'm doing something wrong. If so, please tell me.

@pmaanen
Copy link

pmaanen commented Aug 5, 2018

sndfile.h is part of of the external dependency libsndfile. The corresponding package is named libsndfile1-dev. You can install it with apt-get:

sudo apt-get install libsndfile1-dev

Before you continue best make sure you also have the other dependencies installed:

  • libjack-jackd2-dev
  • jackd2
  • portaudio19-dev

@JohnAbarro
Copy link
Author

JohnAbarro commented Aug 7, 2018

I might have missed this along the way, but it certainly fixed the problem. Sorry for the trouble but, I'd like to know if I'm somewhat doing this right. Currently, I am unable to physically test the ports, so I am a lot more blind to what is currently happening. Though I think I managed to autostart the program by means of adding a few lines in .bashrc, I feel uncertain about my configurations. I'd like to note that I have not made changes to the initial configuration files such as openMHA.cfg. I tried to execute these lines manually on the terminal instead of executing them through .bashrc. Currently, I've been flooded with these repetitive lines which I am oblivious to what it means.
image
I'm clueless if these lines are normal. I also decided to check up on my connections through njconnect, and once again, I am not sure if I'm getting the appropriate results.
image
If it helps to know, I am using the audio injector octo sound card, which I believe our pi could detect as it shows up in the lists like aplay -l. But aside the soundcard used, I would just like to know if I'm doing it right at this point or if I missed anything crucial. Thank you :)

@suaefar
Copy link
Contributor

suaefar commented Aug 27, 2018

Hi John,

sorry for the late response.
You are trying to use the code in a different environment, which is fine but might need some adjustments.

I use the .bashrc as a simple possibility to "autostart" a script after the (automatic) login of the raspberry pi user. You can comment out the last line in .bashrc reboot and then use the start.sh script to fire up everything.

The XRun happen when the hardware was not fast enough to process the data.
Here is an explanation.
A few of them are normal. They happen when the system is busy working on interrupts from the wifi/network/usb. Hence, while using the device (after the configuration) wifi/network/usb usage should be avoided.

I tuned the settings for the two channel setup with the stereo card.
Maybe the eight channels are to much for the Raspberry Pi 3.
You can try increasing the buffer length of jackd in start.sh, e.g. from 2 to 4.
However, this will also increase the latency.

If you hear somthing at the output it probably works.

Good luck :)

@fotisdr
Copy link

fotisdr commented Nov 19, 2018

Hello all,

I'm also trying to setup the openMHA with a Raspberry Pi 3+ and a Cirrus Logic audio card and I am having the same problem. During boot I get some noise played back through my headphones (or the text2speech message) but I keep getting these XRun errors (e.g. pinknoise/thresholdnoise/abhang/mha was not finished) and the calibration procedure stops at different points each time until I break it with Ctrl+C.
I've tried increasing the buffer lenght of jackd but no improvement. Do you have any experience with this?

@m-r-s
Copy link
Owner

m-r-s commented Nov 19, 2018

Hi!

The causes of XRuns can be manifold.
Here is a list of things which can influence the performance [1].

Given, that the features of the sound cards are similar, it could also be due to a inadequate fragment size [2]. I don't remember now if you can just double it. Try with FRAGSIZE=96 instead of 48, and with NPERIODS=4 instead of 2.

Also, I think it is unavoidable that there are some XRuns at the beginning.

A few of them are normal. They happen when the system is busy working on interrupts from the wifi/network/usb. Hence, while using the device (after the configuration) wifi/network/usb usage should be avoided.

Are you using a display or are you connected via ssh (wifi or LAN)?
Do the XRuns appear when the cursor blinks?

Also, do you have a microphone amplifier with a gain of approx. 36 dB?
If not, the feedback cancellation might do awkward things (which it will also if the latency of the feedback exceeds 20ms [3]).

To help you I need much more specific explanations of what you exactly did and what the result was.
If you want to find out more, I would suggest to try running jackd without all the stuff, that the script starts.
Just comment out the line in the .bashrc which auto-starts the script, reboot and then try to "optimize" jack [4]. i.e, find settings which run without XRuns.

Best wishes,
Marc

[1] http://www.manual.ardour.org/setting-up-your-system/the-right-computer-system-for-digital-audio/
[2] https://github.com/m-r-s/hearingaid-prototype/blob/1.1/start.sh#L17
[3] https://github.com/m-r-s/hearingaid-prototype/blob/1.1/tools/abhang/src/core/constants.h#L17
[4] https://wiki.linuxaudio.org/wiki/optimize_jack

@fotisdr
Copy link

fotisdr commented Nov 19, 2018

Hi Marc,

Thanks for the prompt reply!

I was hoping to test the openMHA prototype at first so I don't have the complete setup (I am using a headset without an amplifier). I thought that it will be possible to try this out with a headset. I am also connected to the raspberry pi through a display, does this make a difference?

To be more specific, I've tried running the jackd command alone and it runs without any XRun errors with the default settings (fragsize=48 and nperiods=2). So, I guess that this might be something related to my setup and the calibration during boot. Is there a way to make this work without the suggested earphones and amplifier for now?

Best wishes,
Fotis

@m-r-s
Copy link
Owner

m-r-s commented Nov 19, 2018

No, probably not without fundamental modifications.

You can get openMHA running, but most probably you will need to adapt the openMHA configuration to match your setup (i.e., number of input/output channels, compensation filters, calibration, ...).
However, I doubt that my static feedback cancellation hack would work in that case.
If I were you, I would use the SD-card image but start from scratch by setting up openMHA.
OpenMHA is well documented [1,2].

Best wishes,
Marc

[1] https://github.com/HoerTech-gGmbH/openMHA/blob/master/openMHA_application_manual.pdf
[2] https://github.com/HoerTech-gGmbH/openMHA/blob/master/openMHA_calibration_manual.pdf

@fotisdr
Copy link

fotisdr commented Nov 20, 2018

Hi Marc,

Thanks a lot for your help. I set up the openMHA after all from your SD-card image by bypassing your static feedback algorithm, I'm now trying to find out how to make the various algorithms work.

Best,
Fotis

@Gartenmmeisen
Copy link

Hey, I also got the XRUN-Issue (picture) trying to set it up with the SD-Card Image for my graduate internship. I have basically the same setup as recommend, though using a display and a keyboard.
Any recommendations for me?

best wishes,

Marten

2
3

@m-r-s
Copy link
Owner

m-r-s commented Dec 4, 2018

It is normal that you get some XRUNs while the device is still booting.
If you don't get XRUNs every second after the whole boot process finished, it should be fine.
Do you get XRUNs after the
[COMMANDER] range2 = [X Y]
line?

Do you hear "clicks" (every second or more often) in the reproduced signal?

Best wishes,
Marc

@Gartenmmeisen
Copy link

Okay thanks for the fast reply.
No error after the range and no clicks. Just the text2speech and the sound finally stops.
So it probably works fine.

best,
Marten

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

No branches or pull requests

6 participants