gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Hardware > connecting an audio in cable into the data port on a GBA

#5303 - strider999 - Thu Apr 24, 2003 10:57 pm

im sure this is quite technical, but is there any way i can build a plug converter that will allow me to connect, lets say a CD player's audio out cable, into a GBA's data port and channel it to the headphone jack?

also is there a way to tell if the audio volume dial is moving, through GBA code?

#5308 - Malefactor - Thu Apr 24, 2003 11:50 pm

I'm sure it's possible, you'll have to splice you're own cable and then write a program to channel the intput into sound...

But then, you may even have to program a chip that accepts the audio input from cd player, then converts it into digital data and sends it to the GBA.

I really don't know, just educated guessing.
_________________
[Images not permitted - Click here to view it]

#5315 - joemmac - Fri Apr 25, 2003 6:07 am

Yes, you'd definitely need an A/D converter (Analog to Digital) of some sort, because the GBA port only supports serial digital data transfer. The A/D converter would take the analog signal from the audio jack, and translate it into a digital signal. I don't think the sound quality would be very good though, depending on the transfer rate of the serial port.

I know that they make a headphone output for the new GBA SP port, so there may be some analog connections in that port you could use. They may be just one-way connections tho (line-out not line-in). I'm not familiar with it.

But no, you can't tell the position of the volume dial with just code. If you really wanted to know the volume, there are two ways I can think of. First you could run a splice from the headphone jack to an A/D converter, like I mentioned above. If you put the digital output to the serial GBA port, you could read the amplitude (ie. volume) with code. The second (and better) solution, would be to include volume control in your program. You could make L and R turn up and down the volume. Then the volume is just another variable in your code.

#5395 - strider999 - Sat Apr 26, 2003 5:48 pm

hmm interesting, but i wanted to make a game where the volume dial would play a part in the game it self. oh well, i can do something else.

do you know exactly where a A/D chip could be purchased? or even how to use them in detail?

#5402 - joemmac - Sat Apr 26, 2003 9:43 pm

Sorry, the volume dial just wasn't designed as an input.

For the A/D converter, I would just do a search at some common electronics sites, as I have never had to buy one myself. The way it works is it takes in an analog waveform, and samples it at various time intervals. When it samples the waveform, it measures the amplitude. It then converts that amplitude into a digital combination. For instance, if the max and min amplitude settings were 0v and +5v and it was an 2-bit A/D converter, then when the amplitude was between 0v and +1.25v, it would interpret this as the digital signal 00. +1.25v to +2.5v would be 01, +2.5v to +3.75v would be 10, and +3.75v to +5v would be 11.

The exact usage would depend on the specs of the one you use tho. You may also need a microcontroller or some other way to convert the A/D output to a serial signal.

#5445 - strider999 - Mon Apr 28, 2003 12:25 am

thanks joemmac, youve been alot of help!