Author Topic: Nspire Audio player!  (Read 54583 times)

0 Members and 2 Guests are viewing this topic.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Nspire Audio player!
« on: February 28, 2013, 02:26:08 pm »
WARNING: Two people destroyed their touchpads by accidentially shorting some pins, so be VERY careful!
Read the thread here


Some days ago I found out (with diags) there are some GPIOs connected to the dock connector.
We also have one relatively fast timer we could use for pwm and one for loading new data from the buffer, so here ya go:



Dock connector (connected to pins 5 + 6):



There are still a few bugs/improvements that need to be done:
-Only 10 kHz sampling rate, more is possible
-Crashes on exit
-Loads file twice
-Max file size 2000000 Bytes (2MB)
-Only works on CX
-Only loads "/documents/ndless/monsta.raw.tns" for now
-Haven't got a name, any suggestions?

I'll publish the source code after it works completely.

Possible features:
-WAV loading
-Volume control
-Stereo :-)

BTW: Don't plug your speaker in before "Playing!" or you'll short 3,6 V (While playing, you only short ~1,8V)! Unplug them before exiting, the GPIO becomes high on reset! Don't use your amplifier, you may blow it!

Edit: Updated video

Newest version: here
« Last Edit: March 20, 2013, 05:53:59 pm by Vogtinator »

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Nspire Audio player!
« Reply #1 on: February 28, 2013, 02:28:39 pm »
WOW this is freaking amazing! O_O Even at 10kHz that sound sounded... soundtastic. I do wonder, why no rickroll :P

Some people need a high five in the face... with a chair.
~EC

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Nspire Audio player!
« Reply #2 on: February 28, 2013, 03:10:24 pm »
Very nice hack :D
« Last Edit: February 28, 2013, 03:12:43 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline christop

  • LV3 Member (Next: 100)
  • ***
  • Posts: 87
  • Rating: +20/-0
    • View Profile
Re: Nspire Audio player!
« Reply #3 on: February 28, 2013, 03:23:08 pm »
BTW: Don't plug your speaker in before "Playing!" or you'll short 3,6 V (While playing, you only short ~1,8V)! Unplug them before exiting, the GPIO becomes high on reset! Don't use your amplifier, you may blow it!
Do you know how the GPIO port is driven? If it uses a pull-up resistor (this is what all the TI-8x and TI-9x calculators use in their link port hardware), shorting the port to ground will not harm the calculator (the pull-up resistor is between the 3.6V source and the GPIO pin).
Christopher Williams

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Nspire Audio player!
« Reply #4 on: February 28, 2013, 03:26:59 pm »
Nope, I don't. I haven't got the right screwdriver, but if it really uses a pull-up, it'd be great!

BTW: I'll make a new video tomorrow, this one isn't the greatest.

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: Nspire Audio player!
« Reply #5 on: February 28, 2013, 04:08:22 pm »
Very glad to see there is finally an audio solution for Ndless programs and some progress on the TI-Nspire Dock Connector! :)

And very glad to see that somebody has allready updated Hackspire:
http://hackspire.unsads.com/wiki/index.php/Hardware#Connector_J01_-_Dock_connector


Let's go on: we still have a little more than 20 pins to identify! ;)
TI-Planet co-admin.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Nspire Audio player!
« Reply #6 on: February 28, 2013, 04:18:25 pm »
Quote
And very glad to see that somebody has allready updated Hackspire:
That somebody was me, some days ago :D

Quote
Let's go on: we still have a little more than 20 pins to identify!
The long pins are GND, now we only have 19 more D: (3 of them SPI, 8(?, don't remember exactly) GPIOs)
They shouldn't be a problem with diags and SLED tests

Offline excale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 103
  • Rating: +19/-1
    • View Profile
Re: Nspire Audio player!
« Reply #7 on: February 28, 2013, 04:22:34 pm »
Awesome! Make it for clickpads too :D.

PS: Can you please update hackspire ( http://hackspire.unsads.com/wiki/index.php/Memory-mapped_I/O_ports#90000000_-_General_Purpose_I.2FO_.28GPIO.29 ) ? (not now, but when you think you've found enough and have some time :) ).
« Last Edit: February 28, 2013, 04:23:23 pm by excale »

Offline christop

  • LV3 Member (Next: 100)
  • ***
  • Posts: 87
  • Rating: +20/-0
    • View Profile
Re: Nspire Audio player!
« Reply #8 on: February 28, 2013, 09:02:53 pm »
Nope, I don't. I haven't got the right screwdriver, but if it really uses a pull-up, it'd be great!
Sorry, I didn't mean to imply that there would be a visible, discrete resistor on the board. More likely than not the pull-up resistor (if there is one) is inside an ASIC that controls the GPIO hardware, so you wouldn't be able to see it without an electron microscope or something. :)
Christopher Williams

Offline Rhombicuboctahedron

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 437
  • Rating: +41/-6
    • View Profile
Re: Nspire Audio player!
« Reply #9 on: February 28, 2013, 09:42:12 pm »
Awesome
Though I had problems when I just tried it
First. I did not solder, I just used scotch tape, and I may not have done it correctly (I did red wire 6 from the left, and the black wire of my speakers 5 from the left), nor do I know if I took apart my speakers very well. And one of the wires was thin
Also, I took a random song, changed it to 10 seconds long, used a converter to change it to .raw (where do you find those?) then saved as the monsta file
Anyway, I ran it and got a bunch of fuzz and high pitch sounds, instead of classical accordion
So I got something, which is good

(Also, was that Peter Fox? He is one of the few german singers I have listened to, so idk)

Offline Rhombicuboctahedron

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 437
  • Rating: +41/-6
    • View Profile
Re: Nspire Audio player!
« Reply #10 on: February 28, 2013, 10:39:50 pm »
Okay update on the problem. I got a rough form of the audio to play, but it still has way to much squeaky sound to be good. I used this to convert it, and converted an mp3 to a mono 8000 raw file
It still is fuzzy and squeaky though, so I don’t know if it is my file or my speaker.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Nspire Audio player!
« Reply #11 on: March 01, 2013, 01:17:04 am »
I used audacity, change project rate to 10000 (after import), convert it to mono
and export it as raw data (unsigned 8-bit pcm).

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Nspire Audio player!
« Reply #12 on: March 01, 2013, 04:06:03 am »
* ElementCoder wonders if this could be used in games
* ElementCoder thinks VVVVVV

Some people need a high five in the face... with a chair.
~EC

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Nspire Audio player!
« Reply #13 on: March 01, 2013, 04:49:33 am »
PWM only uses 60 cpu cycles every pwm cycle (128 kHz) so you can still use 124 MHz.
« Last Edit: March 01, 2013, 04:51:34 am by Vogtinator »

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Nspire Audio player!
« Reply #14 on: March 01, 2013, 06:57:38 am »
Needs more amp.
If you like my work: why not give me an internet?