daisy icon indicating copy to clipboard operation
daisy copied to clipboard

`audio` example produces no sound, or produces a loud tone.

Open GregoryTravis opened this issue 2 years ago • 19 comments

With this command:

make flash WHAT=audio BOARD=seed_1_1

I get no audio output at all.

With this:

make flash WHAT=audio BOARD=seed

I get a loud tone. I'm a total beginner with embedded programming, but it sounds like it produced one buffer of data and it's just looping that.

I don't know the revision of the Daisy Seed, but I get this from dfu-utils:

Found DFU: [0483:df11] ver=0200, devnum=1, cfg=1, intf=0, path="1-1", alt=1, name="@Option Bytes   /0x5200201C/01*128 e", serial="200364500000"
Found DFU: [0483:df11] ver=0200, devnum=1, cfg=1, intf=0, path="1-1", alt=0, name="@Internal Flash   /0x08000000/16*128Kg", serial="200364500000"

GregoryTravis avatar Oct 29 '23 22:10 GregoryTravis

Hey @GregoryTravis, thanks for reporting this.

If you look at your daisy, what is written on top? Is there Seed or Seed 1.1? If you have bought it recently, chances are it is seed_1_1.

The audio example is not producing any tone on its own, it only passes through the input audio and switches left input to the right output and vice versa. In other word - you have to plug in some sound input to get an output. Could you try that?

Let me know if you would have any other issues. Hope you'll have fun with Rust and Daisy!

phoracek avatar Oct 29 '23 22:10 phoracek

It looks like 1.2:

PXL_20231030_180837981

I had audio coming in the input port, but I didn't hear it at all, only the loud tone.

GregoryTravis avatar Oct 30 '23 18:10 GregoryTravis

Oh interesting. I was not aware that there is a new Daisy release. Would you mind sharing a closer photo of the chip thats on the far side of the photo above? I would like to see what Codec it uses. I suspect it is the same one as used on the Daisy Patch SM. If that's the case, I could add support for that - if you would be willing to test it.

phoracek avatar Oct 30 '23 19:10 phoracek

I would be happy to test it. PXL_20231030_195558124 PXL_20231030_195601136

GregoryTravis avatar Oct 30 '23 19:10 GregoryTravis

Cool! I'll try to get a patch ready for tomorrow.

On Mon, Oct 30, 2023, 20:58 GregoryTravis @.***> wrote:

I would be happy to test it. [image: PXL_20231030_195558124] https://user-images.githubusercontent.com/24406074/279180177-b8abe529-ac6d-46df-9fa6-92f9cbe8424e.jpg [image: PXL_20231030_195601136] https://user-images.githubusercontent.com/24406074/279180181-b37aabe9-f095-443a-9263-bb9ec52ca193.jpg

— Reply to this email directly, view it on GitHub https://github.com/zlosynth/daisy/issues/2#issuecomment-1785942137, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2U7RUFWRVUXV7YOTVW2NTYCABEVAVCNFSM6AAAAAA6VEACRCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBVHE2DEMJTG4 . You are receiving this because you commented.Message ID: @.***>

phoracek avatar Oct 30 '23 21:10 phoracek

@GregoryTravis when you find some time, please try this with feature flag seed_1_2.

# Cargo.toml
[dependencies]
daisy = { git = "https://github.com/zlosynth/daisy.git", branch = "seed_1_2" }

phoracek avatar Oct 30 '23 22:10 phoracek

I'm working directly in the zlosynth/daisy repo, on branch seed_1_2 -- how do I set the feature flag in this case?

I'm getting:

error: target board must be selected using a feature: "seed_1_2" | "seed_1_1" | "seed" | "patch_sm"
  --> src/lib.rs:92:1
   |
92 | / compile_error!(
93 | |     "target board must be selected using a feature: \"seed_1_2\" | \"seed_1_1\" | \"seed\" | \"patch_sm\""
94 | | );
   | |_^

error[E0432]: unresolved imports `super::codec::Codec`, `super::codec::Pins`
  --> src/audio/interface.rs:3:20
   |
3  | use super::codec::{Codec, Pins as CodecPins};
   |                    ^^^^^  ^^^^^^^^^^^^^^^^^ no `Pins` in `audio::codec`
   |                    |
   |                    no `Codec` in `audio::codec`
   |

GregoryTravis avatar Oct 31 '23 18:10 GregoryTravis

You have to specify it when flashing the example:

make flash WHAT=audio BOARD=seed_1_2

phoracek avatar Oct 31 '23 19:10 phoracek

I can't build the project on branch seed_1_2. I get the errors shown above.

GregoryTravis avatar Oct 31 '23 19:10 GregoryTravis

Could you share the commands you run to build it?

phoracek avatar Oct 31 '23 19:10 phoracek

I apologize -- I forgot that you don't need to build it first. I flashed it with make flash WHAT=audio BOARD=seed_1_2, but I'm still getting the loud tone.

GregoryTravis avatar Oct 31 '23 19:10 GregoryTravis

Darn. I'll check with the Daisy Discord. Speaking of - I found a mention of a libdaisy-rust that is patched with Daisy Seed 2 DFM support. I suspect that it may also cover Seed 1.2. Give it a shot https://github.com/CorvusPrudens/libdaisy-rust, so I don't block you with my troubleshooting. Plus, knowing that whatever is done on that fork works (or does not) would make my work simpler too. I recommend visiting #rust room on the Discord channel https://discord.com/channels/1037767234803740694/1039305128886403072

phoracek avatar Oct 31 '23 20:10 phoracek

Thanks for the tip, I'll try it! I'm actually in that discord, I saw you asking about it :)

GregoryTravis avatar Oct 31 '23 20:10 GregoryTravis

Forgive me, I'm a rust beginner. Below is what I got with that fork, running cargo objcopy --example passthru --release -- -O binary passthru.bin. I don't quite understand the results; it mentions 2 errors, but there were no errors.

   Compiling libdaisy v0.1.0 (/Users/gmt/pedal-stuff/rust-libraries/patched-libdaisy-rust/libdaisy-rust)
error: could not compile `libdaisy` (example "passthru") due to 2 previous errors
error: Failed to parse crate metadata

GregoryTravis avatar Oct 31 '23 21:10 GregoryTravis

@GregoryTravis it is hit or miss, but I made some changes to the branch (commit fdca39e) and maybe (big maybe) it will work now. If you get to try it, please let me know if it is any better now.

Edit: If it would not work after this, I suggest trying this too:

        #[cfg(feature = "seed_1_2")]
        let transfer_config = TransferConfig {
            tx_channel: Channel::A,
            rx_channel: Channel::B,
            tx_sync: Sync::Slave,
            rx_sync: Sync::Master,
        };

phoracek avatar Oct 31 '23 22:10 phoracek

The tone is gone! But I'm still not getting audio through. I tried it unchanged and also with the transfer_config change.

GregoryTravis avatar Nov 01 '23 13:11 GregoryTravis

Mmm, too bad. While trying to get to the bottom of this, here is another idea - could you try flashing the original version that produced the beep 6ace8b2? And once you flash it, try restarting the module by clicking the buttons or just power off-on. Sometimes the firmware gets stuck for me after flashing over USB, but after restart it works. If that won't help, try the other combinations of A/B Slave/Master.

phoracek avatar Nov 01 '23 16:11 phoracek

I restarted the model after flashing using the two buttons, which made the beep go away. I tried all four combinations; only the original one produced a beep:

            tx_channel: Channel::A,
            rx_channel: Channel::B,
            tx_sync: Sync::Master,
            rx_sync: Sync::Slave,

Is there another way to do a power-on, other than the white buttons? If there is, I didn't try it.

I assume that the two buttons a full reset -- if I am running an LED-blinking patch on it, the blinking stops when I reset with the two buttons.

GregoryTravis avatar Nov 01 '23 20:11 GregoryTravis

This is odd; only this one produces a blinking LED:

            tx_channel: Channel::B,
            rx_channel: Channel::A,
            tx_sync: Sync::Slave,
            rx_sync: Sync::Master,

GregoryTravis avatar Nov 01 '23 20:11 GregoryTravis

I have finally got Seed 1.2. With 942ae2e it seems to be working. The only issue is that the output is very noisy. While that is not seen much with loud signal, this is what it looks like with 0.7 VPP.

Seed 1.0:

7

Seed 1.2:

6

Even with 3 VPP it looks pretty rugged on 1.2:

8

And it is not any better with the reference bypass example:

9

phoracek avatar Jun 09 '24 21:06 phoracek

I checked with Daisy Discord and it seems that this is expected and should not be too audible. It can be further countered using a low-pass filter. With the support for Seed 1.2 introduced to the create, I'm closing this issue.

phoracek avatar Jun 10 '24 17:06 phoracek