Shop OBEX P1 Docs P2 Docs Learn Events
SIDcog's rockin' but SNEcog and AYcog silent? — Parallax Forums

SIDcog's rockin' but SNEcog and AYcog silent?

overclockedoverclocked Posts: 80
edited 2014-09-03 10:25 in Propeller 1
Hi all,

I'm very happy to getting the simple ExamplePlayRoutine in SIDCog to sound from my P1V. Have anybody else tried sound from it? Running the examples shipped with SNECog and AYCog soudn nothing? The code is written by the same genius and using the same output pins and everything? Anybody got an idea to why the 2 brothers don't want to sing?

Comments

  • roglohrogloh Posts: 5,794
    edited 2014-09-02 19:58
    That's weird. Haven't tried it myself though I will try to when my DE0-nano arrives (hopefully today or tomorrow with any luck!). Not too sure why audio would be a problem. I looked at the PASM code of these objects and they all use the same general counter mode to output the sound (single ended duty cycle output). The only significant difference I could see is that the SIDCog sample rate is much lower than the other two. Perhaps that has something to do with it, especially if you are not running at the standard 80MHz.
  • overclockedoverclocked Posts: 80
    edited 2014-09-02 22:19
    rogloh wrote: »
    That's weird. Haven't tried it myself though I will try to when my DE0-nano arrives (hopefully today or tomorrow with any luck!). Not too sure why audio would be a problem. I looked at the PASM code of these objects and they all use the same general counter mode to output the sound (single ended duty cycle output). The only significant difference I could see is that the SIDCog sample rate is much lower than the other two. Perhaps that has something to do with it, especially if you are not running at the standard 80MHz.

    Yes you are correct. Due to Instabilities in the xilinx build I'm running the P1V at 60/120 MHz. Thanks for the info. I'll have a look at this and give some feedback if i find a solution.
  • pik33pik33 Posts: 2,366
    edited 2014-09-02 22:59
    How do you output the sound from the sidcog?

    I use sidcog in my player here: http://forums.parallax.com/showthread.php/156954-A-DE2-115-Propeller-demo-board-project-now-programmable-with-the-Propplug

    I didn't try AY and SNE emulators.
  • overclockedoverclocked Posts: 80
    edited 2014-09-03 01:56
    Its down and dirty, but works and actually sounds great!

    Microblaze Starterkit connected to my own ArcadeExtender board.
    I rebuilt the P1V to connect pin 10-11 to right/left audio output fo my ArcadeExtender. This is just the pins connected directly to RC-net filter and then to a line-out mini-phono socket.

    The only change I've done to the Spin-source is to change the freq to suit my underclocked P1V thus:
    5_000_000 => 3_750_000

    But I only tried the simple Player application that includes the actual player data. I'm very interested in doing SD-access and using the dump-player instead! This is the next step, but would really like to understand why only 1 of the chips sounds first..
  • pik33pik33 Posts: 2,366
    edited 2014-09-03 04:16
    Try setting false clkfreq=80_000_000. Maybe 60 MHz is too slow to run these chips. The sidcog is on its border @60 MHz, it needs something about 1900..2000 cycles for one loop and it has about 1880 cycles @60 MHz. It can hang with some more advanced tunes.

    If I am right, setting clkfreq at 80000000 where the true freq is 60000000 will make the sound lower, but it will run. If this is the case, you will have to decrease sample rate to make these chips run @ 60 MHz
  • overclockedoverclocked Posts: 80
    edited 2014-09-03 05:47
    pik33 wrote: »
    Try setting false clkfreq=80_000_000. Maybe 60 MHz is too slow to run these chips. The sidcog is on its border @60 MHz, it needs something about 1900..2000 cycles for one loop and it has about 1880 cycles @60 MHz. It can hang with some more advanced tunes.

    If I am right, setting clkfreq at 80000000 where the true freq is 60000000 will make the sound lower, but it will run. If this is the case, you will have to decrease sample rate to make these chips run @ 60 MHz

    Ahh thanks pik! That makes sense. I will try this when I get home.
  • overclockedoverclocked Posts: 80
    edited 2014-09-03 10:05
    OK yes this was correct! Very nice ctach there pik! The timing for the SIDcog and the simple song was OK at 3.75Mhz but none of the others was. So after defaulting back to 5Mhz on them all eveything works, but are running a tad slower of corse. Thanks for clearing this out.

    And by changing for example the following line in AYcog from 125 to (125/80*60 => 93,75) everything seem to work ok!
    SAMPLE_RATE = 93_000 ' Sample rate of AYcog (125 kHz is maximum for an 80 Mhz propeller)

    The reason for the SIDcog to work is that it actually uses the following scheme when calculating max output freq:
    sampleRate := clkfreq/trunc(C64_CLOCK_FREQ/32.0)
    

    Thus the higher the clock, the higher the quality, but it always copes with it and plays music! Nice work there! Maybe all of these should do the same.. if that is what one wants..

    Is there an easy way to know how busy the Propeller/Cog really is? Like how many percent load it running?

    OK next up s the SD-card.. lets see if I can get one of those Dump-player running! it would be great!
  • pik33pik33 Posts: 2,366
    edited 2014-09-03 10:25
    No, SidCog always outputs the same quality sound

    SampleRate variable is the number of clocks for one loop, so the real sample rate is something about 32 KHz regardless of Propeller clock. Then, after SidCog ends its work for one loop, a waitcnt is used.

    For 80 MHz SampleRate is something about 2512

    The number of cycles for SidCog to complete one loop depends on sound complexity and is something about 2000, so the works at 80% of its power @80 MHz.

    If the frequency is lower and SampleRate go under 2000 there can be cases when it will be too low cycles to complete the loop and then it will hang on this waitcnt at the end of the loop.
Sign In or Register to comment.