Update readme(s) and AHI configuration things

This commit is contained in:
beeanyew 2021-10-03 01:23:13 +02:00
parent 951014c956
commit 54732d91f3
7 changed files with 60 additions and 13 deletions

View File

@ -10,7 +10,7 @@
* `#PiStorm-Amiga` bridged with `#software-amiga`, `#PiStorm-pi`, brigded with `#software-pi` and `#PiStorm-chat`, bridged with `#ot-and-chitchat`.
* **IMPORTANT NOTE: Selling blank or complete PCBs or derivatives on eBay or elsewhere for excessive profit is frowned upon and may lead to forthcoming related projects being closed source.**
* Even with the current global chip shortage (May 2021), components are not **so** expensive that you should pay up to a hundred dollars or Euros for a board.
* Even with the current global chip shortage (October 2021), components are not **so** expensive that you should pay up to a hundred dollars or Euros for a board.
* The PiStorm is not a project for making money, it is meant to be an affordable way to replace and extend the functionality of EOL Motorola 68000 processors and have fun in the process.
* This is not meant to discourage you from making PiStorm boards for others to enjoy, but for instance selling the product as a commercial item and then pawning off support to the community if something doesn't work is absolutely not good™.
@ -18,13 +18,13 @@
* The PiStorm itself is an adapter board intended to be paired with a Raspberry Pi Model 3A+. It goes in the DIP socket on and acts in place of the CPU, but functionality can be extended beyond simple CPU emulation.
* Hardware files are available in `PiStorm_RevB_EPM240_74LVC16373.zip`, but they may be out of date. Joining the Discord and checking for the latest revision/BoM for the PiStorm adapter board is recommended. Please note that just because it says "RevB_EPM240" does _NOT_ mean that all Rev B boards are EPM240s.
* ~~Please note that the `EMP240` and `EPM570` used on the PiStorm board must be an Altera **MAX II** CPLD. There are currently some speed grade issues with the newer **MAX V** counterparts that prevent them from functioning as a replacement.~~
* ~~Please note that the `EPM240` and `EPM570` used on the PiStorm board must be an Altera **MAX II** CPLD. There are currently some speed grade issues with the newer **MAX V** counterparts that prevent them from functioning as a replacement.~~
* There is now an experimental bitstream available for the **MAX V** EPM240 part that can be flashed using the `flash.sh` script, but please note that this is not yet thoroughly tested and since not all silicon is created equal and this firmware requires overclocking the CPLD itself, it may not or may not work properly. Testing is currently underway.
* While the PiStorm should work with any DIP socket 16-bit 68000-powered system, the FC lines are currently not properly handled and no guarantees can be made for it working on anything except an Amiga 500, 500+ and 2000.
* General Performance with the current use of Musashi as the 68k CPU emulator is somewhere around a 70-80 MHz 68030.
* While the PiStorm should work with any DIP socket 16-bit 68000-powered system, the FC lines are currently not properly handled and no guarantees can be made for it working on anything except an Amiga 500, 500+, 1000 and 2000. It does work to some extend in a CDTV, but the lack of bus arbitration signal handling in the CPLD firmware will mean that the CD-ROM drive either does not work at all, or only works sporadically when the timing stars align.
* General Performance with the current use of Musashi as the 68k CPU emulator is somewhere around a 100-125MHz 68030.
* The intended Raspberry Pi model to use with the PiStorm is Model 3A+. 3B+ works, but due to component clearance issues it will not fit unless the Pi itself is modified (USB ports replaced) or a GPIO spacer/relocator is installed.
* The Raspberry Pi Zero and Model 2/4 cannot currently be used with the PiStorm, and support for these is not officially planned yet.
* The Raspberry Pi Zero and Model 2/4 **cannot** currently be used with the PiStorm. While support for other Raspberry Pi models is planned with an updated CPLD firmware, there is no ETA for this.
* While the BOM lists an `EPM570T100C5N` as the CPLD that should be used, you can substitute it with for instance an `EPM240T100C5N` or equivalent, but there are some things worth knowing.
* The **T100** part of the component name is important, as this signifies the number of pins, make sure this is in the part name of the model you substitute the original one with.
* The number 5 in C**5**N is the speed grade of the CPLD. 5 is slower than 4 or 3, and while 4 works with the current bit stream (June 2, 2021), it cannot be guaranteed to work with upcoming CPLD bit streams, so please stick to speed grade 5 for the time being.
@ -67,7 +67,8 @@ You can now reach the PiStorm over SSH, check your router web/settings page to f
Now the final steps to get things up and running, all of this is done from a command prompt (terminal) either locally on the PiStorm or over ssh:
* `sudo apt-get update`
* `sudo apt-get install git libsdl2-dev`
* `sudo apt full-upgrade` (If you get mysterious 'not found' messages from running the line in the next step.)
* `sudo apt-get install git libasound2-dev`
* `git clone https://github.com/captain-amygdala/pistorm.git`
* `cd pistorm`
* `make`

View File

@ -50,6 +50,12 @@ platform amiga
# Uncomment to enable DPMS (monitor turns off) when RTG sleeps
#setvar rtg-dpms
# Uncommenting the lines below here sets the specified sample rate for the Pistorm AHI device and enables the PiStorm AHI
# device respectively. The PiStorm AHI device does not yet work properly, please read the information in the readme file
# located in the directory platforms/amiga/ahi.
#setvar pi-ahi-samplerate 44100
#setvar pi-ahi
# Uncomment to enable CDTV mode (not working, requires Kickstart 1.3+CDTV extended ROM)
#setvar cdtv
# Uncomment this line to enable the PiSCSI interface

View File

@ -41,7 +41,6 @@ static const char *op_type_names[4] = {
void print_ahi_sample_type(uint16_t type);
#endif
char pcm_device[255] = "plughw:1,0";
uint32_t tmp, dir, buff_size;
uint32_t playback_rate = 48000;
int32_t channels = 2, seconds;
@ -134,6 +133,11 @@ void *ahi_timing_task(void *args) {
return args;
}
void pi_ahi_set_playback_rate(uint32_t rate) {
playback_rate = rate;
printf("[PI-AHI] Playback sample rate set to %dHz.\n", playback_rate);
}
uint32_t pi_ahi_init(char *dev) {
pthread_t ahi_tid = 0;
int err;
@ -150,9 +154,9 @@ uint32_t pi_ahi_init(char *dev) {
if (dev) {
int32_t res = 0;
res = snd_pcm_open(&pcm_handle, pcm_device, SND_PCM_STREAM_PLAYBACK, 0);
res = snd_pcm_open(&pcm_handle, dev, SND_PCM_STREAM_PLAYBACK, 0);
if (res < 0) {
printf("[PI-AHI] Failed to open sound device %s for playback: %s\n", pcm_device, snd_strerror(res));
printf("[PI-AHI] Failed to open sound device %s for playback: %s\n", dev, snd_strerror(res));
return 1;
}

View File

@ -17,3 +17,4 @@ void handle_pi_ahi_write(uint32_t addr_, uint32_t val, uint8_t type);
uint32_t handle_pi_ahi_read(uint32_t addr_, uint8_t type);
int get_ahi_sample_size(uint16_t type);
int get_ahi_channels(uint16_t type);
void pi_ahi_set_playback_rate(uint32_t rate);

View File

@ -0,0 +1,16 @@
# Pi-AHI, AHI compatible "sound card" for the PiStorm.
**Please note:** Currently, this virtual AHI device does not work quite properly:
* There is no interrupt to operate the virtual AHI device at precisely 50Hz, which is required by AHI itself, so it will not work well in for instance 60Hz RTG modes.
* It may crash or lock up when closing certain applications because they never call FreeAudio for some reason.
* The resampling is very crude, and will not sound amazing.
# Instructions
To enable Pi-AHI, you have to follow these steps:
* Add the line `setvar pi-ahi` to the config file you're currently using.
* On your Amiga, install AHI (version 4.18, 6.0 may work, but is not suitable).
* Copy the file `pi-ahi.audio` to `DEVS:AHI` and `PI-AHI` to `DEVS:AudioModes`.
* Open the AHI Prefs application and set up PiStorm AHI like you would any other AHI device.
By default, audio output is done over the 3.5mm audio output jack. If you wish to output audio over HDMI instead, you have to configure your Raspberry Pi to do this and add something like `plughw:0,0` to the end of the `setvar pi-ahi` line, for instance like this: `setvar pi-ahi plughw:0,0`.

View File

@ -543,20 +543,21 @@ void setvar_amiga(struct emulator_config *cfg, char *var, char *val) {
}
// Pi-Net stuff
if (CHKVAR("pi-net")&& !pinet_enabled) {
if (CHKVAR("pi-net") && !pinet_enabled) {
printf("[AMIGA] PI-NET Interface Enabled.\n");
pinet_enabled = 1;
pinet_init(val);
adjust_ranges_amiga(cfg);
}
if (CHKVAR("pi-ahi")&& !pi_ahi_enabled) {
printf("[AMIGA] PI-AHI Audio Crap Enabled.\n");
// Pi-AHI stuff
if (CHKVAR("pi-ahi") && !pi_ahi_enabled) {
printf("[AMIGA] PI-AHI Audio Card Enabled.\n");
uint32_t res = 1;
if (val && strlen(val) != 0)
res = pi_ahi_init(val);
else
res = pi_ahi_init("default");
res = pi_ahi_init("plughw:1,0");
if (res == 0) {
pi_ahi_enabled = 1;
adjust_ranges_amiga(cfg);
@ -564,6 +565,11 @@ void setvar_amiga(struct emulator_config *cfg, char *var, char *val) {
printf("[AMIGA] Failed to enable PI-AHI.\n");
}
}
if (CHKVAR("pi-ahi-samplerate")) {
if (val && strlen(val) != 0) {
pi_ahi_set_playback_rate(get_int(val));
}
}
if CHKVAR("no-pistorm-dev") {
pistorm_dev_enabled = 0;

View File

@ -47,6 +47,7 @@ Example: `no-pistorm-dev`
Disables the PiStorm Interaction AutoConfig device. Disabling this can be useful if you're running out of Zorro II address space somehow, or if you just really hate the PiStorm Interaction Device and wish that it would burn in **Hell**.
# rtc_type
Example: `rtc_type msm`
Enables you to set the emulated RTC chip type to `msm` if you for some reason need that for something. Typically, the Ricoh RTC emulation ends up working fine.
**This is not a very useful option, and you should definitely not be enabling it unless you know you need it.**
@ -77,6 +78,18 @@ Combined with the PiStorm Interaction Device, this also offers some additional a
More detailed RTG information can be found in the `platforms/amiga/rtg` readme file.
**Note:** The PiGFX RTG **requires** 32-bit CPU emulation to work properly. It will not function with a 68000, 68010 or 68EC020 CPU selected in the config file. On the other hand, neither will Picasso96, so that's probably okay.
# pi-ahi
Example `setvar pi-ahi plughw:1,0`
Enables the Pi-AHI (virtual "sound card") emulation. This comes with a number of caveats and issues because it's still WIP, please check out the readme file in `platforms/amiga/ahi` for detailed information.
The second argument specifies the audio output device to be used on the Raspberry Pi. `plughw:1,0` is the 3.5mm audio output jack, and `plughw:0,0` is probably the HDMI output.
Defaults to the 3.5mm audio jack, but you can also target something like a USB 2.0 sound card as long as you figure out what the hell the `plughw:#,#` is for it. You may be tempted to try using `plug:` instead, but in that case the audio output device must support big endian samples, which at the very least the Raspberry Pi does not.
# pi-ahi-samplerate
Example `setvar pi-ahi-samplerate 44100`
Specifies the sample rate for the audio output on the Raspberry Pi. Defaults to 48000, but can be lowered to reduce CPU load, if this is for some reason important.
# swap-df0-df
Example: `setvar swap-df0-df 1`