Falcon DSP mp2 replay frequency

Hardware, coding, music, graphic and various applications

Moderators: Mug UK, [ProToS], lp, moondog/.tSCc., Moderator Team

fenarinarsa
Atari freak
Atari freak
Posts: 50
Joined: Sat Mar 15, 2014 11:23 pm

Falcon DSP mp2 replay frequency

Postby fenarinarsa » Fri Nov 09, 2018 12:10 am

I'm new to the Falcon and I'm currently using the DHS framework to start doing some stuff.

I use the included mp2 player but it seems it doesn't replay the file at the correct frequency. For instance when I use a 48kHz mp2 file, it's played a bit too fast (actually I can see this since I'm trying to port Bad Apple on Falcon, in which audio/video sync is very important).

Then I found the following comment in the 2005 patch by ray//.tSCc.:

Code: Select all

mp2_intspeed    =   32000   ;49170   ; Internal speed


And indeed when I use a 49170Hz file encoded as a 48kHz (so it actually plays slower on a PC), it looks like it plays at the correct speed on Falcon.

Any idea what's causing this? Is it because of some clock mystery in the DSP or because of the player? Or maybe I really don't use the good settings?


Also on a side note: Videl should have been renamed Vidhell.

mzry
Atari Super Hero
Atari Super Hero
Posts: 511
Joined: Tue Jan 26, 2016 12:39 pm

Re: Falcon DSP mp2 replay frequency

Postby mzry » Fri Nov 09, 2018 3:37 am

That's probably because the Falcon can only output 32khz or 50khz by default as far as I know. I'm sure you'll get some very good answers from people here.
Falcon ct60e 060 - 256mb ram - phantom bus and dsp accel // Atari TT - Thunder and Storm IDE 64mb ram - Lightning VME - USB LAN - Ati Mach64 2mb // Atari STM 4160 - 4MB ram - 16Mhz exxos 1.5 booster - Ultrasatan

User avatar
calimero
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2250
Joined: Thu Sep 15, 2005 10:01 am
Location: STara Pazova, Serbia
Contact:

Re: Falcon DSP mp2 replay frequency

Postby calimero » Fri Nov 09, 2018 7:00 am

https://archive.org/details/Atari_Falco ... 3/page/n47

Without eternal clock (dongled on DSP port) Falcon can not replay at 48KHz or 44.1KHz.

Btw
Why Videl is hell?
using Atari since 1986.http://wet.atari.orghttp://milan.kovac.cc/atari/software/ ・ Atari Falcon030/CT63/SV ・ Atari STe ・ Atari Mega4/MegaFile30/SM124 ・ Amiga 1200/PPC ・ Amiga 500 ・ C64 ・ ZX Spectrum ・ RPi ・ MagiC! ・ MiNT 1.18 ・ OS X

User avatar
dhedberg
Atari Super Hero
Atari Super Hero
Posts: 832
Joined: Mon Aug 30, 2010 8:36 am
Contact:

Re: Falcon DSP mp2 replay frequency

Postby dhedberg » Fri Nov 09, 2018 12:45 pm

It's correct what calimero says. To replay a 48kHz MP2 on the Falcon030 you need an external clock on the DSP port. If you have the original sound data then you can do the following to make it play at a correct speed on a stock Falcon030 without an external clock:

Upsample the sound data to 49.17kHz (but keep any headers specifying the frequency as 48kHz). When done, encode it as a 48kHz MP2. It will then play correctly on a Falcon030. Most software can perform good upsampling. I use Wavosaur on Windows for this purpose. For MP2 encoding I use CDex.
Daniel, New Beat - http://newbeat.atari.org. Like demos? Have a look at our new Falcon030 demo MORE.

fenarinarsa
Atari freak
Atari freak
Posts: 50
Joined: Sat Mar 15, 2014 11:23 pm

Re: Falcon DSP mp2 replay frequency

Postby fenarinarsa » Fri Nov 09, 2018 7:36 pm

Thanks a lot for all your replies. As I said in my first message I did what you say dhedberg, and it looks like it's correctly in sync.

It'as amazing that I never heard of this 49170Hz frequency before. I thought the "50kHz" of the Falcon was 50066Hz like on STE (which is not even 50066Hz)

I was referring to the fact that Videl isn't easy to set up, actually even the assembly code generated by screen pain doesn't work?
And in NTSC the RGB frequency is 59.50Hz instead of 60.03 (the STE frequency), 59.94 (the standard NTSC frequency) or 60Hz VGA... so it's more complicated to keep effects in sync.
Maybe there's a way to change it but I don't have a lot of time in my hands so I stick with the standard resolutions.

User avatar
Cyprian
Atari God
Atari God
Posts: 1518
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Falcon DSP mp2 replay frequency

Postby Cyprian » Sat Nov 10, 2018 2:00 pm

fenarinarsa, Videl is very flexible. It gives you a full control of video signal and allows you to define vertical/horizontal frequency whatever you want.
There are some valuable docs about Videl and Jag which has the same video register scheme as Falcon:
https://mikro.naprvyraz.sk/docs/mikro/videl.html
https://www.mulle-kybernetik.com/jagdox/video.html
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.appspot.com/

fenarinarsa
Atari freak
Atari freak
Posts: 50
Joined: Sat Mar 15, 2014 11:23 pm

Re: Falcon DSP mp2 replay frequency

Postby fenarinarsa » Sat Nov 10, 2018 9:07 pm

Cyprian wrote:fenarinarsa, Videl is very flexible. It gives you a full control of video signal and allows you to define vertical/horizontal frequency whatever you want.


Yes I know, except that the vertical frequency is related to the number of scanlines, and that for me to change it I need dig into Videl's registers for days and a lot of trial and errors on the actual machine. I already knew the documentations you linked but they focus on certain use cases and are not very clear IMO. They need a good rewriting :?

I don't even know if 60Hz or 59.94Hz is possible with the Falcon in RGB. It's just that if it's possible, I don't understand why they're not the standard used vertical frequencies. So my guess is that it's not possible.

To put it simply, I don't have time for this :) xbios will do and it will work better in VGA.

mikro
Hardware Guru
Hardware Guru
Posts: 1784
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: Falcon DSP mp2 replay frequency

Postby mikro » Sat Nov 10, 2018 9:59 pm

Of course it's possible. Vertical frequency, same as any other parameter, is totally configurable.

evil
Captain Atari
Captain Atari
Posts: 165
Joined: Sun Nov 12, 2006 8:03 pm

Re: Falcon DSP mp2 replay frequency

Postby evil » Sun Nov 11, 2018 2:39 pm

fenarinarsa wrote:I don't even know if 60Hz or 59.94Hz is possible with the Falcon in RGB. It's just that if it's possible, I don't understand why they're not the standard used vertical frequencies. So my guess is that it's not possible.

To put it simply, I don't have time for this :) xbios will do and it will work better in VGA.


The OSSC reports these vertical frequencies on a Falcon.

VGA - 59.94 Hz
RGB/TV PAL - 50.03 Hz
RGB/TV NTSC - 59.54 Hz

These are standard modes you set with Xbios. Wouldn't 59.54 suffice?

User avatar
shoggoth
Nature
Nature
Posts: 952
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Falcon DSP mp2 replay frequency

Postby shoggoth » Sun Nov 11, 2018 4:38 pm

The code generated by screens of pain works very well unless you’re doing something very wrong (obviously you need to call it from supervisor mode, for example).
Ain't no space like PeP-space.

fenarinarsa
Atari freak
Atari freak
Posts: 50
Joined: Sat Mar 15, 2014 11:23 pm

Re: Falcon DSP mp2 replay frequency

Postby fenarinarsa » Mon Nov 12, 2018 1:12 am

shoggoth wrote:The code generated by screens of pain works very well unless you’re doing something very wrong (obviously you need to call it from supervisor mode, for example).


Well actually it doesn't work for RGB but I may have done something wrong. Unfortunately Screen Pains does not allow advanced settings, only screen center/borders adjustment.

evil wrote:Wouldn't 59.54 suffice?


It makes a huge difference!

The original video I'm doing the conversion from is made for 30Hz and is 3mn40s long.
By doubling the framerate and playing it at 59.94Hz it ends with a sync drift of 12 frames (220ms).
At 59.54Hz it ends completely off sync because the audio/video drift is 100 frames, almost two seconds (1690ms).

What's really strange is that 59.54 is really not standard at all (it's either 60 or 59.94Hz).
The 60Hz mode of the STE was not standard either but with 60.03Hz at least it was near 60Hz.

I wonder why Atari didn't implement 59.94Hz in the standard Xbios call. That's why I say it may not be possible to achieve in RGB :)

So far I succeded in keeping the sync by using a timer locked to 60Hz and syncing the frame render on it.
But I get another issue, the timer is somewhat interfering with the display, as if Videl could not access video RAM during a few pixels, and I don't know why.

(I'm going to open another thread to discuss this)

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1809
Joined: Sun Jul 31, 2011 1:11 pm

Re: Falcon DSP mp2 replay frequency

Postby Eero Tamminen » Mon Nov 12, 2018 9:38 pm

fenarinarsa wrote:Yes I know, except that the vertical frequency is related to the number of scanlines, and that for me to change it I need dig into Videl's registers for days and a lot of trial and errors on the actual machine


You can use Hatari to do initial testing. While it's Videl emulation is still missing few things (listed in Hatari todo.txt file), it should be pretty good, You can check Videl register values at any point with debugger "info videl" command.

User avatar
Cyprian
Atari God
Atari God
Posts: 1518
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Falcon DSP mp2 replay frequency

Postby Cyprian » Mon Nov 12, 2018 10:23 pm

fenarinarsa wrote:Yes I know, except that the vertical frequency is related to the number of scanlines, and that for me to change it I need dig into Videl's registers for days and a lot of trial and errors on the actual machine


There is no need to code Videl yourself. You can BlowUp tool to tweak resolution a bit:
Image


http://milan.kovac.cc/atari/software/?f ... ON/_SCREEN
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.appspot.com/

fenarinarsa
Atari freak
Atari freak
Posts: 50
Joined: Sat Mar 15, 2014 11:23 pm

Re: Falcon DSP mp2 replay frequency

Postby fenarinarsa » Mon Nov 12, 2018 11:15 pm

Wow, great! Thanks for pointing this out. The only software I knew of was screen pains.

BTW I think I found why the Falcon cannot generate standard NTSC, it's related to the horizontal frequency as expected.
The standard horizontal video frequencies are:

PAL - 15625 Hz
15625/50 = 312.5 lines (interlaced: 625)

NTSC (color*) - 15734 Hz
15734/59.94 = 262.5 lines (interlaced: 525)

NTSC (black&white*) - 15750 Hz
15750/60 = 262.5 lines (interlaced: 525)

The last one gave the base frequency used in VGA mode : 15750*2=31500 Hz

Since the Falcon seems to use only 15625Hz in RGB, I guess it cannot generates standard 15kHz NTSC without help of an external sync.

* https://en.wikipedia.org/wiki/NTSC#Color_encoding

User avatar
calimero
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2250
Joined: Thu Sep 15, 2005 10:01 am
Location: STara Pazova, Serbia
Contact:

Re: Falcon DSP mp2 replay frequency

Postby calimero » Thu Nov 15, 2018 11:42 am

Here you have program for editing NVRAM settings on Falcon030. Among other things, you can choose between PAL and NTSC in RGB mode.


http://milan.kovac.cc/atari/software/?f ... OTCONF.FTP

Image
using Atari since 1986.http://wet.atari.orghttp://milan.kovac.cc/atari/software/ ・ Atari Falcon030/CT63/SV ・ Atari STe ・ Atari Mega4/MegaFile30/SM124 ・ Amiga 1200/PPC ・ Amiga 500 ・ C64 ・ ZX Spectrum ・ RPi ・ MagiC! ・ MiNT 1.18 ・ OS X

ctirad
Captain Atari
Captain Atari
Posts: 261
Joined: Sun Jul 15, 2012 9:44 pm

Re: Falcon DSP mp2 replay frequency

Postby ctirad » Fri Nov 16, 2018 1:45 pm

fenarinarsa wrote:Since the Falcon seems to use only 15625Hz in RGB, I guess it cannot generates standard 15kHz NTSC without help of an external sync.


Jus note, there are a slight hardware differences aoround the main 32MHz oscillator between PAL and NTCS Falcon boards.

mikro
Hardware Guru
Hardware Guru
Posts: 1784
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: Falcon DSP mp2 replay frequency

Postby mikro » Fri Nov 16, 2018 4:02 pm

ctirad wrote:Jus note, there are a slight hardware differences aoround the main 32MHz oscillator between PAL and NTCS Falcon boards.

For the sake of completion - CT2B does this differently, too - its external 32 MHz clock for RGB compatibility isn't sourced from the master Falcon clock but from DSP's former 32 MHz crystal making it slightly incompatible with the standard RGB modes.


Social Media

     

Return to “Professionals”

Who is online

Users browsing this forum: No registered users and 6 guests