Jump to content

Photo

Using Pulse Density Modulation for 8-bit PCM


202 replies to this topic

#101 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Sat May 19, 2018 3:32 PM

Haven't forgotten about the FAT player, BTW, and have been working on it a little this evening. I now have an EXE version of the FAT browser and I will bolt the already written IDE player code to it in the next few days. Can hardly wait to see if it works. :)



#102 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Mon May 21, 2018 9:12 AM

IDE player appears to work. Currently testing with 8MB interleaved raw file and will upload a video later. Interleaved format appears to be the way to go. Player is rough but once it's acceptable I'll upload it here. ;)



#103 mytek OFFLINE  

mytek

    River Patroller

  • 3,371 posts
  • Location:Santa Rosa, CA

Posted Mon May 21, 2018 10:01 AM

IDE player appears to work. Currently testing with 8MB interleaved raw file and will upload a video later. Interleaved format appears to be the way to go. Player is rough but once it's acceptable I'll upload it here. ;)

 

This will be so, soooo cool  :thumbsup:  :) .

 

Will the player eventually be integrated into the Side and XEL Loaders? It would be especially cool to be able to select a song, hit return, and have it play.



#104 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Mon May 21, 2018 10:09 AM

It's a stand-alone application, but it has the same UI as the XEX loader and can be launched from same. I think at length it would be a good idea to have a simpler toolchain for creating PDM files and some kind of file header containing metadata, etc.

#105 Mathy OFFLINE  

Mathy

    River Patroller

  • 2,924 posts
  • Location:Heerlen, NL

Posted Mon May 21, 2018 12:40 PM

Hello Jon

 

Will your IDE player only work with certain devices or would it be possible to use it with for instance the MIO or Blackbox too?

 

Sincerely

 

Mathy



#106 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Mon May 21, 2018 12:48 PM

Sorry the audio quality sucks as usual:



File is 8MB long and plays for some minutes (although I cut it short here, since you get the general idea). Still sufficient space left for monitoring keystrokes, etc, so perhaps some scanning functionality could be added. Most laborious part is building a table of cluster addresses by scanning the file's entire FAT chain (resulting table contains some 2,000 LBA values for this file).
 

Will your IDE player only work with certain devices or would it be possible to use it with for instance the MIO or Blackbox too?


I'm not as intimately familiar with SCSI as I am with IDE, but I see no reason why not, although much depends on seek times if you're using anything but solid state media. The delay allowed by this player for the IDE controller's data buffer to become ready (some 30,000 plus machine cycles) is overkill, though, so there's probably some headroom. One could - at the expense of more complexity in the player and the file format - allow for longer device seek times, but I have no idea if that would even be necessary.

 

At the moment, the player may be compiled on demand for SIDE/SIDE2, Incognito (although the 800 appears to have issues playing the samples), and 1088XEL/XEL-CF, and versions for IDE Plus 2.0, MYIDE II, etc, would be easy to produce. Some way to go before the player is even remotely 'polished', however, but I will upload it soon for general evaluation. There is no dependency whatsoever on U1MB or any other RAM expansion, so - for instance - 65XE and SIDE2 will do just fine.


Edited by flashjazzcat, Mon May 21, 2018 12:52 PM.


#107 Mathy OFFLINE  

Mathy

    River Patroller

  • 2,924 posts
  • Location:Heerlen, NL

Posted Mon May 21, 2018 2:34 PM

Hello Jon

 

It's been a while, but IIRC the biggest difference between SCSI and IDE, command wise, is that you have to select a drive number (and a LUN, which usually is "0") when using SCSI.

 

Sincerely

 

Mathy 



#108 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Mon May 21, 2018 2:50 PM

Ah yes: I just looked it up and LUN is rather more sophisticated that IDE's simple device selection bit (which allows only a primary and secondary drive). The LUN hierarchy is rather reminiscent of the device/controller hierarchy described by Drac030 in his XDCB specification (which is faithfully implemented by APT compatible firmwares and drivers).



#109 Mathy OFFLINE  

Mathy

    River Patroller

  • 2,924 posts
  • Location:Heerlen, NL

Posted Mon May 21, 2018 3:20 PM

Hello Jon

 

How much does APT differ from (AT)ASPI?

And does your IDE Player access the media at the FAT level or is the FAT stuff handled by a different routine?

 

Sincerely

 

Mathy



#110 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Mon May 21, 2018 4:03 PM

APT is just a partitioning scheme (like MBR or GPT; indeed APT co-exists with MBR), although the specification cross-references the details of Konrad's XDCB. An APT implementation may employ any device protocol (IDE, ASPI, etc) in a hardware abstracted fashion.

Unfortunately when playing 8-bit samples, hardware abstraction is a luxury we can't afford, so the player drives the hardware directly. The player accesses the hard disk at the raw sector level and handles MBR, FAT, etc, entirely in software.

The PDM player builds a large table of LBA sector addresses of each FAT cluster in the file before playback commences. Therefore - during playback - we're just dealing with a plain list of sector numbers.

#111 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Tue May 22, 2018 1:48 PM

Here's something to test with SIDE/SIDE2:

 

Attached File  PDM_Player_alpha_SIDE.zip   6.97MB   85 downloads

 

Just drop the XEX and the PDM file into a FAT partition and run the PDM.XEX application using the XEX loader. You can run it from the SDX command line as well but the player loads at $1000 at the moment, so an exit to DOS is unlikely to be successful. It exits back to the SIDE loader just fine, though.

 

I refrained from uploading the crude interleaving tool I wrote in C the other day since I'm certain Xuel can leverage a far superior toolchain. :) To recap: every 512 byte block (i.e. physical sector) of the file should be arranged thus:

 

Byte $000

Byte $100

Byte $001

Byte $101

 

...

 

Byte $0FF

Byte $1FF

 

No checks are currently made on file size, so anything larger than 16MB will probably crash the player. Partitions may be formatted FAT16 or FAT32. An unsophisticated stop byte in the cluster table currently signifies the end of the stream to the player, and handling that throws the cycle count off once per sector, but these things can be corrected later. I have no doubt that file browser will be full of bugs, since it's an aggressive and quick conversion of the ROM-based XEX loader.

 

Nice as the provided tune is, I'll be rather relieved to hear something different. :)

 



#112 Stephen OFFLINE  

Stephen

    Quadrunner

  • 7,586 posts
  • A8 Gear Head
  • Location:No longer in Crakron, Ohio

Posted Tue May 22, 2018 2:23 PM

Here's something to test with SIDE/SIDE2:

 

attachicon.gifPDM_Player_alpha_SIDE.zip

 

 

Nice as the provided tune is, I'll be rather relieved to hear something different. :)

 

Deleted because I am a dumb ass that cannot read.  Let me try this in my SIDE2 cart :)



#113 foft OFFLINE  

foft

    Dragonstomper

  • 798 posts
  • Location:Nyon, Switzerland

Posted Tue May 22, 2018 2:29 PM

Very cool! Would it be possible to make this work on SD card readers? I'm wondering if I can get it working on the EclaireXL if I expose the SD card SPI registers somewhere (or have some glue logic to make it look like compact flash), allowing direct Atari partitions etc. Is there any sort of standard for this?



#114 miker ONLINE  

miker

    Stargunner

  • 1,901 posts
  • Stay Atari!
  • Location:Warsaw, Poland

Posted Tue May 22, 2018 3:03 PM

OK, is there possiility to play those PDM samples correctly from .car file?



#115 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Tue May 22, 2018 3:10 PM

OK, is there possiility to play those PDM samples correctly from .car file?

 

No (and why?), if you're referring to the IDE player. It needs new files interleaved in the way I described.
 

Very cool! Would it be possible to make this work on SD card readers? I'm wondering if I can get it working on the EclaireXL if I expose the SD card SPI registers somewhere (or have some glue logic to make it look like compact flash), allowing direct Atari partitions etc. Is there any sort of standard for this?

 
Had several Polish hardware projects not fallen off the earth, I would probably have a PBI driver already written which drives SD carts via SPI, but as it stands the performance is a bit of an unknown quantity. That's why I'm hedging my bets on IDE emulation on some of these newer MCU-based, SD card multi-carts. If you can do IDE emulation in accordance with the ATA specs, then that would be ideal. The only ATA commands used are Identify Device, Set Features, Read Sector and Write Sector (plus device reset). Any IDE emulation need not worry about Atari partitions (the standard being APT), since all partition and logical drive stuff is handled by the 6502 (this is also true of the XEX loader on which the PDM player is based).


Edited by flashjazzcat, Tue May 22, 2018 3:18 PM.


#116 a8isa1 OFFLINE  

a8isa1

    Stargunner

  • 1,561 posts

Posted Tue May 22, 2018 4:41 PM

Here's something to test with SIDE/SIDE2:

 

attachicon.gifPDM_Player_alpha_SIDE.zip

 

Just drop the XEX and the PDM file into a FAT partition and run the PDM.XEX application using the XEX loader. You can run it from the SDX command line as well but the player loads at $1000 at the moment, so an exit to DOS is unlikely to be successful. It exits back to the SIDE loader just fine, though.

 

I refrained from uploading the crude interleaving tool I wrote in C the other day since I'm certain Xuel can leverage a far superior toolchain. :) To recap: every 512 byte block (i.e. physical sector) of the file should be arranged thus:

 

Byte $000

Byte $100

Byte $001

Byte $101

 

...

 

Byte $0FF

Byte $1FF

 

No checks are currently made on file size, so anything larger than 16MB will probably crash the player. Partitions may be formatted FAT16 or FAT32. An unsophisticated stop byte in the cluster table currently signifies the end of the stream to the player, and handling that throws the cycle count off once per sector, but these things can be corrected later. I have no doubt that file browser will be full of bugs, since it's an aggressive and quick conversion of the ROM-based XEX loader.

 

Nice as the provided tune is, I'll be rather relieved to hear something different. :)

 

As usual, I'm begging for an internal MyIDE version  ;-)

 

p.s.

and MyIDE (Slave drive-only version)

It's easier for me to get to my Slave CF card.  (Don't ask!)

 

p.p.s

...unless the program is very easy to patch with a different address for IDE registers


Edited by a8isa1, Tue May 22, 2018 4:46 PM.


#117 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Tue May 22, 2018 5:00 PM

It's a five minute job to compile builds for MYIDE, XEL, etc. Got side-tracked with a firmware bug. :)

Will upload the other builds tomorrow.

#118 Mathy OFFLINE  

Mathy

    River Patroller

  • 2,924 posts
  • Location:Heerlen, NL

Posted Tue May 22, 2018 5:57 PM

Hello Jon

 

How long will it to compile a BlackBox build?

 

Sincerely

 

Mathy



#119 rdea6 ONLINE  

rdea6

    River Patroller

  • 2,811 posts
  • Location:Arizona USA

Posted Tue May 22, 2018 7:49 PM

Here's something to test with SIDE/SIDE2:

 

Nice as the provided tune is, I'll be rather relieved to hear something different. :)

 

Yes I would also like to have more tune's to play on my SIDE/SIDE2 ..



#120 Xuel OFFLINE  

Xuel

    Dragonstomper

  • 744 posts
  • Location:US

Posted Wed May 23, 2018 2:18 AM

Just drop the XEX and the PDM file into a FAT partition and run the PDM.XEX application using the XEX loader. You can run it from the SDX command line as well but the player loads at $1000 at the moment, so an exit to DOS is unlikely to be successful. It exits back to the SIDE loader just fine, though.


Could you point me to step-by-step instructions for setting this up in Altirra? I tried creating a 300MB FAT VHD with the files and adding a SIDE 2 device (w/ sload129.rom) pointing to it but when I run the XEX, the screen goes haywire:
 

screenshot.png
 
settings.png

I'm running the XEX by dragging it to Altirra. Do I need to run it from DOS/SDX?
 

I refrained from uploading the crude interleaving tool I wrote in C the other day since I'm certain Xuel can leverage a far superior toolchain. :) To recap: every 512 byte block (i.e. physical sector) of the file should be arranged thus:


Working on it... :)

#121 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Wed May 23, 2018 2:26 AM

Looks like BASIC is enabled, and the player is so crude it currently does not disable it for you. But in any case you should launch the player from the SIDE loader. I'll upload a set of ROMs for you later on, but since the player doesn't use the Altirra settings and is geared for real hardware, it doesn't sound great in the emulator.

Edited by flashjazzcat, Wed May 23, 2018 2:26 AM.


#122 mytek OFFLINE  

mytek

    River Patroller

  • 3,371 posts
  • Location:Santa Rosa, CA

Posted Wed May 23, 2018 1:54 PM

PDM Stereo: Is this a possibility?

 

I asked this question a while back, and didn't see a reply.

 

Could this be implemented for Stereo Pokey boards, and if so what would get compromised if anything?



#123 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Thu May 24, 2018 12:52 PM

How long will it to compile a BlackBox build?


A long time, probably. I'd have to read up on the SCSI protocol and invest time I don't currently have in testing it.
 

Could you point me to step-by-step instructions for setting this up in Altirra?


Attached File  U1MB_Xuel.zip   229.42KB   37 downloads

Go to System->Configure System->Firmware->Firmware Manager, then "Add", navigate to U1MB.ROM, and set the type to Ultimate 1MB, making sure you "Set as default".

Your VHD should be formatted FAT16 or FAT32, without or without MBR partition table, and should have the player and the sample file in it. Boot the emulated machine, pressing 'L' to start the loader. Go to the Options menu in the loader and turn off internal BASIC, then in the launcher menu (rocket), hit enter on PDM.XEX and then use a very similar interface inside the player to do the same thing with the sample file.

#124 tomsmart1 OFFLINE  

tomsmart1

    Space Invader

  • 11 posts

Posted Thu May 24, 2018 1:09 PM

H

 

Here's something to test with SIDE/SIDE2:

 

attachicon.gifPDM_Player_alpha_SIDE.zip

 

Just drop the XEX and the PDM file into a FAT partition and run the PDM.XEX application using the XEX loader. You can run it from the SDX command line as well but the player loads at $1000 at the moment, so an exit to DOS is unlikely to be successful. It exits back to the SIDE loader just fine, though.

 

...

i test it on real hardware an it works great.

 

But if you press a key  the auto search function starts and the screen get overwritten with data and  the loader crash.

 

Regards

Thomas



#125 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,493 posts
  • Location:United Kingdom

Posted Thu May 24, 2018 1:37 PM

But if you press a key  the auto search function starts and the screen get overwritten with data and  the loader crash.


If you can crash the loader by invoking a search, I'd be interested to know how to reproduce the issue here, since this is the first I heard of any issue. Even a screenshot of the crash would be useful, since I'm not aware of any problem.

If it's the player crashing, then I would not be in the least surprised, meanwhile. :)




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users