Skip to content

Audio frequency issue #51

@andreondra

Description

@andreondra

First of all, thank you for such a great project!

I have a strange issue with the sound output. The image works perfectly without any problems, both in my CPU project and in the hdmi-demo project. I use Nexys Video devboard.

However, in both projects I have an issue with the audio frequency. In both projects a sawtooth waveform with a certain frequency is generated: in my project I tried various freqs, in the hdmi-demo it is 480 Hz if I see correctly. For debugging, I use my HDMI monitor with an audio output (via 3.5mm jack). I measured the frequency of the signal coming from the jack in two ways to mitigate a measurement error:

  • I connected the speakers, recorded the audio and then measured the frequency,
  • I connected the oscilloscope and measured the frequency directly in the instrument.

I found out that in both projects the frequency is always approximately double. See the measurement of the waveform generated by the hdmi-utils demo:
Image.

I also measured the frequency of the generated audio_clk, it seems correct.

Do you have any idea what the issue may be? Is this a known issue, or maybe I do something wrong? If this occurred only in my project I wouldn't be surprised but the same issue is also in the demo project. And my monitor (which I also suspected) is working correctly, because if I connect a computer and generate an arbitrary waveform, the frequency is OK.

Edit: so it seems that modifying the audio_clk generator in the demo like this:

// from this
assign clk_audio = clk_pixel && counter == 11'd1546;
// to this
assign clk_audio = counter == 11'd1546;

Fixes the issue. In the Questa Sim I saw a glitch caused by the clk_pixel &&. So -- in my design a have probably the same issue, will investigate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions