I don't know how to put this, an Apple Audio HW bug?

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) I don't know how to put this, an Apple Audio HW bug?
# 1  
Old 06-26-2014
I don't know how to put this, an Apple Audio HW bug?

Hi guys and gals...

Apologies for any typos...

Well I have a major problem and I don't know how to take it further so I need your advice AND help...
Found from the AudioScope.sh calibration method(s)...

I think I have found a HW bug in Apple gear...

This has been checked so far on a new iPhone 5S,
a 3 month old iPad Air and my Macbook Pro...

As a confirmation I have tried it on my old Blackberry Phone, Windows Vista and XP on various machines
Debian Linux and PCLinuxOS 2009 on an HP laptop and an Acer Aspire One netbook these work perfectly as
the sound _card_ should...
It has even been checked as a RAW file in /dev/dsp too and is correct.
(Will check CygWin tomorrow.)

Consider the code below:-
It was written to set up the vertical amplifier polarity and works as designed BUT........
Code:
#!/bin/bash --posix
> /tmp/pulse.wav
printf "\x52\x49\x46\x46\x24\x00\x01\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x10\x00\x00\x00\x01\x00\x01\x00\x40\x1f\x00\x00\x40\x1f\x00\x00\x01\x00\x08\x00\x64\x61\x74\x61\x00\x00\x01\x00" >> /tmp/pulse.wav
for n in {0..8191}
do
	printf "\xFF\xFF\x00\x00\x00\x00\x00\x00" >> /tmp/pulse.wav
done
afplay /tmp/pulse.wav
exit 0

This works perfectly on the RANDOM gear as it should; a NEGATIVE going pulse NOT a POSITIVE one.
When pulse.wav is transferred to run on the Apple gear above the waveform is inverted, I.E. it is a
POSITIVE going pilse. AFAIK this is wrong.

What I would dearly like is for the interested on here to check the waveform from the earphone socket
against a known Oscilloscope and reply to this thread.

You can test on anything that plays a .WAV file. The quality of the wave is NOT important the polarity
IS however...

It should look something like this:-

Code:
 =-+  +-----------+  +-------  <- 0x00 Unsigned 8 bit.
   |  |           |  |
   |  |           |  |
   |  |           |  |
   |  |           |  |
   +--+           +--+  <- 0xFF Unsigned 8 bit.

Remember quality is NOT important, polarity IS...

I will be checking on other machines and phones myself over the WE...

Many thanks in advance...

NOTE:- I have not yet posted anywhere else and hope I am wrong. thanks guys and gals...

If this is consitent throughout Apple gear then I don't know how to take it further...

Barry.

EDIT:
Many thanks to my workmate Richard Carter for letting me test on his iPhone 5S and
his iPad Air...

Last edited by wisecracker; 06-26-2014 at 04:47 PM.. Reason: See above...
# 2  
Old 06-26-2014
Quote:
Originally Posted by wisecracker
This works perfectly on the RANDOM gear as it should; a NEGATIVE going pulse NOT a POSITIVE one.
When pulse.wav is transferred to run on the Apple gear above the waveform is inverted, I.E. it is a
POSITIVE going pilse. AFAIK this is wrong.
It could be anything from the software implementation of the player and codecs, its DSP chipset, or the output amplifier which causes the inversion. It really doesn't matter for audio purposes, since it sounds the same. You're just seeing the relative popularity of different designs, not "right" or "wrong".

By which I mean, I don't think you can count on it always being the same, you'll need a way to invert it.

[edit] Actually, you could put a switch in your circuit to invert, couldn't you? To flip the secondary side of the transformer.

Last edited by Corona688; 06-26-2014 at 07:22 PM..
# 3  
Old 06-26-2014
By the way, I think you can build that file in 8179 fewer loops.

Code:
printf "\x52\x49\x46\x46\x24\x00\x01\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x10\x00\x00\x00\x01\x00\x01\x00\x40\x1f\x00\x00\x40\x1f\x00\x00\x01\x00\x08\x00\x64\x61\x74\x61\x00\x00\x01\x00" > /tmp/pulse.wav
printf "\xFF\xFF\x00\x00\x00\x00\x00\x00" | tee -a /tmp/pulse.wav > /tmp/0.wav
# File size doubles every loop
for ((N=0; N<13; N++))
do
        # The - causes it to print the data twice.
        tee -a /tmp/pulse.wav - < /tmp/0.wav > /tmp/1.wav
        mv /tmp/1.wav /tmp/0.wav
done

rm /tmp/0.wav

# 4  
Old 06-27-2014
Hi Corona688...
I could also use this:-
Code:
#!/bin/bash --posix
> /tmp/pulse.wav
data="\xFF\xFF\x00\x00\x00\x00\x00\x00"
printf "\x52\x49\x46\x46\x24\x00\x01\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x10\x00\x00\x00\x01\x00\x01\x00\x40\x1f\x00\x00\x40\x1f\x00\x00\x01\x00\x08\x00\x64\x61\x74\x61\x00\x00\x01\x00" >> /tmp/pulse.wav
for n in {0..12}
do
	data=$data$data
done
printf "$data" >> /tmp/pulse.wav
afplay /tmp/pulse.wav
exit 0

But my point is that .WAV, .RAW, (.AIFF??), are definitive and have been for decades.

Heck even the AMIGA follows the same course although signed 8 bit data; that is a high
number translates to a low signal point and vice versa.

Why is the Apple gear quoted different? Deliberate, accidental or maybe unaware?

The .WAV and .RAW formats are good for signal generation and that is why I used them
albeit 8 bit unsigned MONO...

Modifying the AudioScope.sh code is easy but I should not have to allow for it...

Oh well I'll put it down to experience and plod on...

I will try CygWin today and in /dev/dsp mode...
# 5  
Old 07-01-2014
Hi Corona688...
Quote:
Actually, you could put a switch in your circuit to invert, couldn't you? To flip the secondary side of the transformer.
Absolutely except I have since found a Windows machine that does the same as the Apple gear.
The problem is that this now changes the goalposts as CygWin follows the host Windows OS and the HW it is on.
So therefore one will never know whether the single pulse generator is correct or not SO......

Now I have to assume that the person(s) experimenting with the script do(es) NOT have access to a (semi-)professional oscilloscope but DO have access to a simple multimeter.

So generate two versions of the pulse generator, one '+ve' going and the other '-ve' going named pulse1.wav and pulse2.wav respectively.
Using CCT 3, the voltage doubler, connect the multimeter across the DC output and run each one in turn. The lower voltage one will be +ve going and vice versa.

In fact the Arduino access is already a voltmeter so even a multimeter is not a requirement...

Neat eh! ;o)

Version 0.30.xx to be released soon...
# 6  
Old 07-04-2014
Hmm, if the voltage doubler has current enough to drive a small LED, the multimeter might not be necessary. One signal would light, and the inverted one would not.

It would have to be buffered, of course, or the signal would "float" up to whatever point averages out to zero volts because of the capacitor in the way.

And if it's buffered/amplified, why not use it to drive the LED directly?

Last edited by Corona688; 07-04-2014 at 12:47 PM..
This User Gave Thanks to Corona688 For This Post:
# 7  
Old 07-04-2014
Hi Corona688...

Quote:
And if it's buffered/amplified, why not use it to drive the LED directly?
Indeed. Leave it with me I already have a test piece I built years ago for my AMIGA so with a little jiggery pokery will see how it progresses... ;o)

Also just received this baby ready for Raspberry Pi, (Raspian):-

Sound Blaster Play! External USB Sound Card - Creative Labs (Asia)

Works out of the box on Linux Mint...
Yup, you guessed it I am going to attempt to include RP too! <Shock horror.>

It defaults to /dev/dsp and /dev/audio so gives me basic access.

Dunno if SOX installs/compiles on RP yet but at least /dev/dsp is a possibility...
Will know in the next few days... ;o)
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. Slackware

Problems with audio recording in Audacity 2.0.5. Slackware64 14.1; Intel HD Audio.

I'm trying to record audio using Audacity 2.0.5 installed from SlackBuilds. My system is 64-bit Slackware 14.1 and a sound card is Intel HD Audio. I didn't change my sound system to OSS. (Default sound system in Slackware 14.1 is ALSA, isn't it?) First, I set Internal Microphone slider in KMix... (2 Replies)
Discussion started by: qzxcvbnm
2 Replies

2. Solaris

Solaris 10,audio don't work and unrar needed

Hi, I'm here again for newbie questions :) I've installed Solaris 10 but audio don't work.I've a Realtek integrated peripheral,listed in Sun Hcl.The volume control is ok also.But nothing came from speakers. I need to install unrar also,I've download it from here Freeware for Solaris with... (1 Reply)
Discussion started by: bgf0
1 Replies
Login or Register to Ask a Question