Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Doc Block
Apr 15, 2003
Fun Shoe
and if you don't set the "output composite sync on vsync" bit then it fucks up the screen for real vs the faux analog fuckup that i was trying for earlier

Adbot
ADBOT LOVES YOU

Pile Of Garbage
May 28, 2007



Doc Block posted:

was messing around with setting custom video modes and this happened:


turns out I didn't set the bit in the video mode register telling it to clear the line buffer before processing each line. could be a cool effect, except the background flashes green every 17 frames because the last line is solid green every 16th frame. (the title sprite is set as transparent)

NICE

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Doc Block posted:

was messing around with setting custom video modes and this happened:


turns out I didn't set the bit in the video mode register telling it to clear the line buffer before processing each line. could be a cool effect, except the background flashes green every 17 frames because the last line is solid green every 16th frame. (the title sprite is set as transparent)

this owns

I bet you have enough DMA time to could append a GPU interrupt to your display list every 16 frames that sets the the line buffer clear bit

I've been doing some optimizing - I rewrote the 16.16 multiplication routine to take advantage of the second register page and reordered instructions to reduce wait states. I average about 13-14fps with one triangle on screen but sometimes it spikes and gets going real fast when the triangle is seen from certain angles (as you can see at the end of the gif before it repeats). I think this is a good time to redo my screen drawing GPU program.

Doc Block
Apr 15, 2003
Fun Shoe

Luigi Thirty posted:

this owns

I bet you have enough DMA time to could append a GPU interrupt to your display list every 16 frames that sets the the line buffer clear bit

I can’t figure out how to restart the object processor from the interrupt, though. if you don’t restart it, it’s black screen time. I’ll post my GPU code when I’m back at my computer and hopefully someone can point out what I’m doing wrong.

or I could change the grid sprite so the bottom line is “black” but not a palette entry that gets rotated.

Luigi Thirty posted:

I've been doing some optimizing - I rewrote the 16.16 multiplication routine to take advantage of the second register page and reordered instructions to reduce wait states. I average about 13-14fps with one triangle on screen but sometimes it spikes and gets going real fast when the triangle is seen from certain angles (as you can see at the end of the gif before it repeats). I think this is a good time to redo my screen drawing GPU program.



wicked sick, dude :science:

Doc Block fucked around with this message at 09:36 on Nov 13, 2017

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Doc Block posted:

was messing around with setting custom video modes and this happened:


turns out I didn't set the bit in the video mode register telling it to clear the line buffer before processing each line. could be a cool effect, except the background flashes green every 17 frames because the last line is solid green every 16th frame. (the title sprite is set as transparent)

do you have any color that always stays black? alternatively: make a 15-color palette cycling animation and reserve the 16th color for the last black line. :woop:

Doc Block
Apr 15, 2003
Fun Shoe
here is my GPU code from the test where I was trying to mess with a sprite's X position each scanline. i gave up on it because restarting the Object Processor doesn't work (or I'm doing something dumb). it doesn't have the palette rotation because that's a different program.
code:
	.include	"jaguar.inc"

	.text
	.phrase
_gpu_code_start::
	.gpu

	.org G_RAM

SP		.equr	r31
ISR_RET_ADDR	.equr	r28
ISR_GFLAGS	.equr	r29
ISR_TEMP2	.equr	r8
ISR_TEMP3	.equr	r9

	.macro ISR_NOT_SET
		.rept 8
		nop
		.endr
	.endm

	; CPU interrupt
	movei	#gpu_main,r0
	jump	(r0)
	.rept 4
	nop
	.endr

	; DSP interrupt
	ISR_NOT_SET

	; timing generator
	ISR_NOT_SET

	; Object Processor interrupt
	movei	#op_interrupt,r0
	jump	(r0)
	.rept 4
	nop
	.endr

	; blitter interrupt
	ISR_NOT_SET

op_interrupt:
	movei	#G_FLAGS,r30
	load	(r30),ISR_GFLAGS	; get GPU flags
	bclr	#3,ISR_GFLAGS		; clear IMASK
	bset	#12,ISR_GFLAGS		; write a 1 to bit 12 to acknowledge handling of OP GPU interrupt
	load	(SP),ISR_RET_ADDR	; get return address
	addq	#4,SP			; erase return address from stack
	addq	#2,ISR_RET_ADDR		; "return" address is address of the last instruction executed before interrupt,
					; make it point to the one after that

	; test: just restart the OP and exit
	
	; re-enable the object processor
	movei	#OBF,ISR_TEMP2
	movei	#1,ISR_TEMP3
	store	ISR_TEMP3,(ISR_TEMP2)

	; return
	jump	(ISR_RET_ADDR)
	store	ISR_GFLAGS,(r30)	; re-enable interrupts etc.

gpu_main:
	movei	#G_ENDRAM,SP		; give us a stack
	moveta	SP,SP			; in both register banks

	movei	#G_FLAGS,r1		; address of GPU flags
	load	(r1),r0			; fetch
	bset	#7,r0			; Object Processor interrupt enable
	bclr	#3,r0			; clear interrupt mask bit
	store	r0,(r1)			; write flags back to GPU flags

.waitloop:
	; do  nothing
	movei	#.waitloop,r0
	jump	(r0)
	nop
	jump	(r0)
	nop

	nop

	.long
	.68000
_gpu_code_end::
it's uploaded by the CPU and run, with an object list that's:
a sprite object, with next object pointer set to the GPU interrupt object
GPU interrupt object
STOP object

the object processor is supposed to begin with the next object in memory after the GPU interrupt object, but the OP doesn't seem to be getting restarted by the interrupt service routine, so the screen goes black once this object list is set.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

try changing the jump instructions to jump t,(ADDRESS), I think you always need a condition flag there

Doc Block
Apr 15, 2003
Fun Shoe
i borrowed the boilerplate stuff from here, which works fine for his demo program.

changing the jumps to jump t,(address) didn't solve anything.

Arcsech
Aug 5, 2008
latest idiot spare time project: coworker has a busted pair of decent but not like, super expensive headphones (sony mdr-7506) that's totally busto. no sound at all.

i like fixing things if they can be fixed rather than throwing them away, so i grabbed them to take a crack at repairing them

first thing i check is the solder joints from the cable to the drivers. look fine
next thing i check is the cable, make sure it has at least semi-reliable connectivity. it's fine, less than an ohm resistance on left/right/ground despite wiggling cable, etc.

however, the drivers themselves appear to be open circuits. both of them. which would explain the no sound thing, but i dunno what would cause that. the drivers themselves are more or less sealed units, so i can't really crack them open and look... i might be able to, but i'm not sure I'd be able to get them back together again

so, audio knowers: did this guy just plug his headphones into the mains or what

echinopsis
Apr 13, 2004

by Fluffdaddy
dat sweet 50hz/60hz bass line

josh04
Oct 19, 2008


"THE FLASH IS THE REASON
TO RACE TO THE THEATRES"

This title contains sponsored content.

Arcsech posted:

latest idiot spare time project: coworker has a busted pair of decent but not like, super expensive headphones (sony mdr-7506) that's totally busto. no sound at all.

i like fixing things if they can be fixed rather than throwing them away, so i grabbed them to take a crack at repairing them

first thing i check is the solder joints from the cable to the drivers. look fine
next thing i check is the cable, make sure it has at least semi-reliable connectivity. it's fine, less than an ohm resistance on left/right/ground despite wiggling cable, etc.

however, the drivers themselves appear to be open circuits. both of them. which would explain the no sound thing, but i dunno what would cause that. the drivers themselves are more or less sealed units, so i can't really crack them open and look... i might be able to, but i'm not sure I'd be able to get them back together again

so, audio knowers: did this guy just plug his headphones into the mains or what

you might already have looked it up, but mdr-7506s come with a wiring diagram on the box

muckswirler
Oct 22, 2008

They tell you how to pop out the driver in the service manual, but it can be hard to get legit replacements. So go through actual retailers not ebay.

People swap them out all the time and i'm sure that's how you wound up with a borked pair. Those little speakers take a lot of abuse and with frequent use actually need to be replaced regularly cause they wear out, so you want to replace them both anyway. Especially since there's no real guarantee you're going to get the same driver you have. In any case break them in for a few days after you do the swap because more than any other headphone they improve after a little burn in.

Arcsech
Aug 5, 2008

muckswirler posted:

They tell you how to pop out the driver in the service manual, but it can be hard to get legit replacements. So go through actual retailers not ebay.

People swap them out all the time and i'm sure that's how you wound up with a borked pair. Those little speakers take a lot of abuse and with frequent use actually need to be replaced regularly cause they wear out, so you want to replace them both anyway. Especially since there's no real guarantee you're going to get the same driver you have. In any case break them in for a few days after you do the swap because more than any other headphone they improve after a little burn in.

Yeah I looked up the wiring diagram and made sure everything was wired right. That's why I was so confident the drivers themselves seem to be the problem

Did not know they need to be replaced regularly. I'd expect them to sound bad tho, not die entirely

Also 2 new drivers cost as much as a new pair of these headphones, lol

evil_bunnY
Apr 2, 2003

Unless your cans are made out of schmancy materials this is generally the case. It's dumb AF.

muckswirler
Oct 22, 2008

The chinese copy drivers are ok if you can get them cheap. They're usually lower impedance and won't handle a watt of power like the og ones, but they'll sound fine enough for normal loud listening.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

speaking of Atari, I found of all things a Race Drivin’ machine for sale in the mall arcade. It boots and passes the self-test but crashes with an address error 15 seconds into attract mode.

they want too much money for it but the salesman said they really want it gone because they can’t convert it into anything or sell it. he’s gonna pass my number on to the owner (who knows my mom) and see if I can get a deal on it instead of scrapping it. if I can walk away with it for $400 or something I’d be happy

Trig Discipline
Jun 3, 2008

Please leave the room if you think this might offend you.
Grimey Drawer
DAN CARLIN SAW MY THING

https://www.youtube.com/watch?v=ceItMiYZe9Y

19 minutes in


i've always considered myself to be flattering an a bit terrifying

simble
May 11, 2004

Trig Discipline posted:

DAN CARLIN SAW MY THING

https://www.youtube.com/watch?v=ceItMiYZe9Y

19 minutes in


i've always considered myself to be flattering an a bit terrifying

nice! joe rogan called you crazy!

Luigi Thirty
Apr 30, 2006

Emergency confection port.

update: looks like i'm picking up a Race Drivin' standup for $300 next week :toot:

Doc Block
Apr 15, 2003
Fun Shoe
:w00t:

Star War Sex Parrot
Oct 2, 2003

Trig Discipline posted:

DAN CARLIN SAW MY THING

https://www.youtube.com/watch?v=ceItMiYZe9Y

19 minutes in


i've always considered myself to be flattering an a bit terrifying

I always believed in you

Bloody
Mar 3, 2013

I didn't watch the thing it seemed creepy

Trig Discipline
Jun 3, 2008

Please leave the room if you think this might offend you.
Grimey Drawer

Bloody posted:

I didn't watch the thing it seemed creepy

yeah it's about america

super nailgun
Jan 1, 2014


Luigi Thirty posted:

update: looks like i'm picking up a Race Drivin' standup for $300 next week :toot:

Hell yeah! Nice score.

longview
Dec 25, 2006

heh.
been learning DSP by doing DSP this weekend

first attempt was to make a CTCSS decoder using a STM32F030, it didn't go well. seems that a) the tone spacing and low frequency means that very long filters are required (resulting in an unacceptable response time) and b) the '030 isn't powerful enough to really run those filters anyway

Icom manages a really good decoder in a HD78k series CPU using otherwise similar hardware but they've probably invested a decent amount of effort into it (and they're probably doing the detection in time domain)

second attempt was actually reasonably successful, I implemented a direct conversion FM discriminator in a STM32F407.
IF input is around 455 kHz, two of the ADCs are synchronized to sample the IF input in quadrature using synchronized timers.
first attempt was to sample really fast and decimate in software, but that just wasn't fast enough so today I switched tactics and reduced the sample rate to 25 ksps.
it means filtering the input signal before sampling is even more important but the processor actually has enough power to process the data in real time.

so now I get the two ADC buffers when the DMA finishes, I convert the buffer to float, then run this demodulator on it: https://www.embedded.com/design/configurable-systems/4212086/DSP-Tricks--Frequency-demodulation-algorithms-
haven't checked how much time I have left, but there's definitely enough time to run a 19 element floating point FIR filter to low-pass/tweak the audio before writing it to the DAC buffer.

Bloody
Mar 3, 2013

just dump it through a lil IIR filter

Luigi Thirty
Apr 30, 2006

Emergency confection port.

lol if your DSPs don't have completely hosed up everything

hobbesmaster
Jan 28, 2008

Luigi Thirty posted:

lol if your DSPs don't have completely hosed up everything

that f407 is a cortex-m4f running at about 168mhz. it’s probably more powerful than the stuff the developers for the Jaguar were using

Luigi Thirty
Apr 30, 2006

Emergency confection port.

hobbesmaster posted:

that f407 is a cortex-m4f running at about 168mhz. it’s probably more powerful than the stuff the developers for the Jaguar were using

my kingdom for SIMD multiplication

hobbesmaster
Jan 28, 2008

Luigi Thirty posted:

my kingdom for SIMD multiplication

https://www.keil.com/pack/doc/CMSIS/Core/html/group__intrinsic__SIMD__gr.html

look at those beautiful intrinsics

longview
Dec 25, 2006

heh.
the 407 is nice for this, but the most impressive to me is probably stuff like the '030, it's the size and cost of an atmega328 but has 4 kb ram, 48 MHz core, 12-bit 1 MSps ADC, DMA etc.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I got my game home today :toot:

https://twitter.com/LuigiThirty/status/933132488590761984

hobbesmaster
Jan 28, 2008

longview posted:

the 407 is nice for this, but the most impressive to me is probably stuff like the '030, it's the size and cost of an atmega328 but has 4 kb ram, 48 MHz core, 12-bit 1 MSps ADC, DMA etc.

the cortex-m0+ is insanely good for what it costs

and of course in response microchip raises prices. :rip: atmel

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

hobbesmaster posted:

the cortex-m0+ is insanely good for what it costs

and of course in response microchip raises prices. :rip: atmel

they’re probably doing that because they myopically think it’s a great idea to push avr customers to pic not realizing that anyone on an avr is going to go arm over pic

hobbesmaster
Jan 28, 2008

i have literally heard "well we're a pic shop but this project is as good as any to start moving to arm"

Sagebrush
Feb 26, 2012

avr to pic would be the dumbest transition in history

"well we're currently driving a toyota corolla, but we're thinking of transitioning to a canoe"

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

hobbesmaster posted:

the cortex-m0+ is insanely good for what it costs

and of course in response microchip raises prices. :rip: atmel
i'm not a microcontroller person but yeah cortex m0 is nice, set up a docker to compile for the ones in my keyboard 2ez, although i haven't tricked cmake into linking between objects from rust and objects from c yet

longview
Dec 25, 2006

heh.
ever forward, found some fun bugs caused by not reading the reference manual and inexperience

i thought i had a misconfigured DMA since the ADC DMA would just stop after the first round no matter what. turns out I had the half-complete interrupt activated, and the ADC wasn't properly configured so it would stop sending data at the end of a DMA.
I was then resetting the DMA in the ISR to make it work, i did wonder why the DMA length was off by a factor of two...
so i figured out how to properly use half-complete interrupt+circular mode to double buffer the data in hardware (the F4 DMAs can also do hardware dma chaining but it's not necessary for my use case)

fixing that brought up a new bug where it looked like the demodulator filter state was being overwritten with the last values of the current buffer instead of the old one, that made the first two samples out of the demodulator all wrong

turns out when the ISR for the ADC fires it set the flag to process data, the main loop then processes the data.
at some point during all that the quadrature ADC finishes and sets the process flag again and since the processing loop only resets the flag at entry it would dutifully run the some processing again, using old data but with filter state intended for the next data set

now i'm actually checking interrupt sources and using the HAL task callbacks instead of writing everything in the ISR file. also moved the processing in to its own freertos thread that's triggered using xTaskNotifyFromISR, leaving more time for potential other lower priority tasks (like say a squelch or AGC task).

Spatial
Nov 15, 2007

speaking of DMA, someone tell me if this is normal

i'm doing some graphics stuff on an nxp lpc4357. basically i'm using the dma as a scanline rasteriser using the scatter gather mode.

i made a benchmark to see how much i can wring out of this thing and it's not as good as i hoped:
code:
Test: 32KB transfer

M4 built-in memcpy transfer time: 26689 cycles
Bytes per cycle: 1.23 (61.39% of max)

M4 spatial memcpy transfer time: 18997 cycles
Bytes per cycle: 1.73 (86.25% of max)

DMA transfer time: 20705 cycles
Bytes per cycle: 1.58 (39.56% of max)
it's not bad but not very impressive. the dma has 32-deep FIFOs and 2 bus masters, and there is no other bus activity during the transaction because i put the M4 to sleep

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

every dma is broken at least a little

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply