haxo-rs icon indicating copy to clipboard operation
haxo-rs copied to clipboard

Errors running pressure sensor test

Open ddodge40 opened this issue 1 year ago • 9 comments

I get the following errors when running the pressure test:

pi@raspberrypi://home/pi/haxo-rs $ cargo test pressure -- --nocapture --ignored
    Finished test [unoptimized + debuginfo] target(s) in 0.96s
     Running unittests src/main.rs (target/debug/deps/haxo001-5a0cd2e3cec856e3)

running 2 tests
test pressure::tests::pressure_step ... Blow and draw air from the mouthpiece...
+ pressure: 12
+ pressure: 14
+ pressure: 17
+ pressure: 18
+ pressure: 19
+ pressure: 13
- pressure: -15
ok
test pressure::tests::read_io ... Blow and draw on the mouthpiece...
pressure: 531976, min: 2147483647, max: 0
pressure: 539912, min: 531976, max: 531976

thread 'pressure::tests::read_io' panicked at 'assertion failed: pressure_range_detected', src/pressure.rs:163:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAILED

failures:

failures:
    pressure::tests::read_io

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 6 filtered out; finished in 5.57s

error: test failed, to rerun pass `--bin haxo001`

Also missing the TenorSax2.sf2 file;

What should I try next?

ddodge40 avatar Apr 17 '23 15:04 ddodge40

Hi @ddodge40,

That specific test is checking that there is a sufficiently large range between the maximum and minimum air pressures. Are you blowing and drawing hard enough into the mouthpiece (or neck, if not using mouthpiece)?

pressure: 13 ... pressure: -15

These values are very low. We would expect the difference between the max and the minimum to be around 700,000.

What I would do:

  1. test without the mouthpiece first, blowing directly into the neck
  2. check your silicon tubing... is there a tight fit into the sensor, or is the air leaking? In particular, you might need to use a wire brace to tighten the tubing.

Regarding TenorSax2.sf2, I'll respond in a separate issue to keep them easily searchable.

jcard0na avatar Apr 17 '23 15:04 jcard0na

Regarding soundfonts, see https://github.com/jcard0na/haxo-rs/issues/10

jcard0na avatar Apr 17 '23 16:04 jcard0na

Loaded a fresh copy from the RPi Archive using ver 3.6 but still get the errors attached. All the cargo tests pass and I see the audio card using the aplay -l

Any ideas to try next? errors-4-22.txt

ddodge40 avatar Apr 23 '23 02:04 ddodge40

The file does not seem to be correctly attached to your comment: I is just a link to https://github.com/jcard0na/haxo-rs/issues/9 Could you re-attach or paste the contents here? Are the errors the same as you previously reported? Did the suggestions I made earlier have any effect?

jcard0na avatar Apr 23 '23 07:04 jcard0na

Yes i did all of them

Here it the text @.:~/haxo-rs $ haxo001 bash: haxo001: command not found @.:~/haxo-rs $ cargo run Finished dev [unoptimized + debuginfo] target(s) in 3.96s Running target/debug/haxo001 fluidsynth: warning: Failed to set thread to high priority Synth created Starting haxophone... fluidsynth: warning: Failed to allocate a synthesis process. (chan=0,key=59) ^C @.:~/haxo-rs $ haxo001 bash: haxo001: command not found @.:~/haxo-rs $

Thanks

On Apr 23, 2023, at 12:26 AM, Javier Cardona @.***> wrote:

The file does not seem to be correctly attached to your comment: I is just a link to #9 https://github.com/jcard0na/haxo-rs/issues/9 Could you re-attach or paste the contents here? Are the errors the same as you previously reported? Did the suggestions I made earlier https://github.com/jcard0na/haxo-rs/issues/9#issuecomment-1511632172 have any effect?

— Reply to this email directly, view it on GitHub https://github.com/jcard0na/haxo-rs/issues/9#issuecomment-1518979347, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTPHL4FGP43VGWCU5L42XDXCTKUBANCNFSM6AAAAAAXBLCLIE. You are receiving this because you were mentioned.

Donald Dodge @.*** W6SNX Cell 714-271-7888

ddodge40 avatar Apr 23 '23 15:04 ddodge40

Hi @ddodge40,

Are you still trying to resolve the pressure sensor issues ("Errors running pressure sensor test") or is this something else? The output you pasted shows two problems:

  1. bash: haxo001: command not found

This is just a file path problem: haxo001 is not in that directory or in the current PATH. cargo run reports its location (a few lines down in your log), so this would work: ./target/debug/haxo001. That said, launching the haxo001 directly like this or with cargo run makes no difference. You only care about the difference once you want to have a service launch it automatically on boot.

  1. fluidsynth: warning: Failed to allocate a synthesis process. (chan=0,key=59)

This error message is generated by fluidsynth, the application that synthesises the sound for the haxophone. haxo001 is telling it to generate the sound corresponding to midi key 59, which corresponds to a concert mid Bb, or the sound produced when air flows with no keys pressed. So this is a good sign that air pressure and the correct fingering are detected, and haxo001 is triggering note sounds... progress! 🥳

I do not know the cause of "Failed to allocate a synthesis process", though. @raychmond also reported them here and then said they were solved by properly installing the executable, see here. He's planning to document his installation process (see here), so if you ask him nicely he might be able to help.

Also, you mention that you "see the audio card using the aplay -l". Can you post the output here? Is it the max98357a? Did you go through the audio card configuration steps here? Which Raspberry Pi model are you using?

jcard0na avatar Apr 23 '23 17:04 jcard0na

I recompiled the halo-rs and now pass all the tests.

When I start haxo001, I still get the Fluidsynth warning and get no sound from the Haxaphone. I do get some strange clicking and it sounds like it is trying to play sounds.

I can play music using the Vterm on my pi and it does play thru the speaker output.

Is it possible that the sf2 file needs to be the TenorSax2.sf2 file, which i do not have.

Thanks

On Apr 23, 2023, at 10:46 AM, Javier Cardona @.***> wrote:

Hi @ddodge40 https://github.com/ddodge40,

Are you still trying to resolve the pressure sensor issues ("Errors running pressure sensor test") or is this something else? The output you pasted shows two problems:

bash: haxo001: command not found This is just a file path problem: haxo001 is not in that directory or in the current PATH. cargo run reports its location (a few lines down in your log), so this would work: ./target/debug/haxo001. That said, launching the haxo001 directly like this or with cargo run makes no difference. You only care about the difference once you want to have a service launch it automatically on boot.

fluidsynth: warning: Failed to allocate a synthesis process. (chan=0,key=59) This error message is generated by fluidsynth, the application that synthesises the sound for the haxophone. haxo001 is telling it to generate the sound corresponding to midi key 59, which corresponds to a concert mid Bb, or the sound produced when air flows with no keys pressed. So this is a good sign that air pressure and the correct fingering are detected, and haxo001 is triggering note sounds... progress! 🥳

I do not know the cause of "Failed to allocate a synthesis process", though. @raychmond https://github.com/raychmond also reported them here https://github.com/jcard0na/haxo-hw/discussions/10#discussioncomment-5505066 and then said they were solved by properly installing the executable, see here https://github.com/jcard0na/haxo-hw/discussions/14#discussion-5041739. He's planning to document his installation process (see here https://github.com/jcard0na/haxo-hw/discussions/15#discussioncomment-5700775), so if you ask him nicely he might be able to help.

Also, you mention that you "see the audio card using the aplay -l". Can you post the output here? Is it the max98357a? Did you go through the audio card configuration steps here https://github.com/jcard0na/haxo-rs#sound-card? Which Raspberry Pi model are you using?

— Reply to this email directly, view it on GitHub https://github.com/jcard0na/haxo-rs/issues/9#issuecomment-1519119387, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTPHL4GH4KEY3576PCYH6LXCVTH7ANCNFSM6AAAAAAXBLCLIE. You are receiving this because you were mentioned.

Donald Dodge @.*** W6SNX Cell 714-271-7888

ddodge40 avatar Apr 24 '23 16:04 ddodge40

Yes, you need at least one .sf file, as that is where the sound samples come from.

See https://github.com/jcard0na/haxo-rs/issues/10 for suggestions on how to get files.

Javier

On Mon, 24 Apr 2023 at 17:46 ddodge40 @.***> wrote:

I recompiled the halo-rs and now pass all the tests.

When I start haxo001, I still get the Fluidsynth warning and get no sound from the Haxaphone. I do get some strange clicking and it sounds like it is trying to play sounds.

I can play music using the Vterm on my pi and it does play thru the speaker output.

Is it possible that the sf2 file needs to be the TenorSax2.sf2 file, which i do not have.

Thanks

On Apr 23, 2023, at 10:46 AM, Javier Cardona @.***> wrote:

Hi @ddodge40 https://github.com/ddodge40,

Are you still trying to resolve the pressure sensor issues ("Errors running pressure sensor test") or is this something else? The output you pasted shows two problems:

bash: haxo001: command not found This is just a file path problem: haxo001 is not in that directory or in the current PATH. cargo run reports its location (a few lines down in your log), so this would work: ./target/debug/haxo001. That said, launching the haxo001 directly like this or with cargo run makes no difference. You only care about the difference once you want to have a service launch it automatically on boot.

fluidsynth: warning: Failed to allocate a synthesis process. (chan=0,key=59) This error message is generated by fluidsynth, the application that synthesises the sound for the haxophone. haxo001 is telling it to generate the sound corresponding to midi key 59, which corresponds to a concert mid Bb, or the sound produced when air flows with no keys pressed. So this is a good sign that air pressure and the correct fingering are detected, and haxo001 is triggering note sounds... progress! 🥳

I do not know the cause of "Failed to allocate a synthesis process", though. @raychmond https://github.com/raychmond also reported them here < https://github.com/jcard0na/haxo-hw/discussions/10#discussioncomment-5505066> and then said they were solved by properly installing the executable, see here < https://github.com/jcard0na/haxo-hw/discussions/14#discussion-5041739>. He's planning to document his installation process (see here < https://github.com/jcard0na/haxo-hw/discussions/15#discussioncomment-5700775>), so if you ask him nicely he might be able to help.

Also, you mention that you "see the audio card using the aplay -l". Can you post the output here? Is it the max98357a? Did you go through the audio card configuration steps here < https://github.com/jcard0na/haxo-rs#sound-card>? Which Raspberry Pi model are you using?

— Reply to this email directly, view it on GitHub < https://github.com/jcard0na/haxo-rs/issues/9#issuecomment-1519119387>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADTPHL4GH4KEY3576PCYH6LXCVTH7ANCNFSM6AAAAAAXBLCLIE . You are receiving this because you were mentioned.

Donald Dodge @.*** W6SNX Cell 714-271-7888

— Reply to this email directly, view it on GitHub https://github.com/jcard0na/haxo-rs/issues/9#issuecomment-1520505933, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFFCVKI4MNHMRI3HICJGE3XC2U4TANCNFSM6AAAAAAXBLCLIE . You are receiving this because you commented.Message ID: @.***>

jcard0na avatar Apr 24 '23 17:04 jcard0na

Can I close this issue?

jcard0na avatar Sep 08 '23 06:09 jcard0na