Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#359470 - 23/08/2013 10:26 Empeg Tuners: how does player interface with them?
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
This is actually a question from Jon, which he sent to me via private / hidden email. I'm answering it here, so that any information won't get lost in the way that emails do.

Originally Posted By: Jon
Do you have any example for controlling the mark1 and mark2 empeg
tuners.

I know the MK2 one is serial but I don't know what it all looks like to
user space. I seem to remember the MK1 tuner is I2C ?

Anything you have would be useful. I've added support for a tea5767
tuner to my raspberry pi board and code, this works ok. I was hoping to
add tuner support to my software for both mk1 and mk2 players. I have
some hardware into from Patrick but he has nothing code wise relating to
the host.


The player app communicates directly with the tuner, through the serial_sa1100.c kernel driver. Within that driver code, are two routines that get called: transmit_chars() for sending stuff to the tuner, and receive_chars() for handling bytes receive from the tuner. These routines are shared with the non-tuner serial port, so anything one does there has to first check which port is being accessed.

If you dig into there, you'll notice that Hijack already has its grubby little fingers into those functions, so that it can implement the fake_tuner=1 option from the config.ini file. This flag, when set, allows one to explore the player's tuner "GUI" without a tuner installed. You may find that useful. To do this, the code has to recognize, intercept, and fake responses to a few of the tuner commands.

That's about all I know. But were one armed with the tuner chip datasheet, it should be straightforward to add code to remap commands/responses intended for the factory tuner chip, into appropriate format for the teac5767 chip. There are only a handful of commands used, so not as bad perhaps as it first sounds.

Cheers

Top
#359471 - 23/08/2013 10:29 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Oh, there's also the very useful hijack_trace_tuner=1 flag, to dump out every byte exchanged between the player and the tuner/radio module.

Cheers

Top
#359472 - 23/08/2013 10:34 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
I also have these notes in my collection of tuner stuff:

http://empegbbs.com/ubbthreads.php/ubb/s...face#Post102561

Originally Posted By: altman
Ok, the basics: 19200bps, 8n1

Commands of the form:

0x01 <command> [<command data>]

Commands are answered with replies of the form
0x01 <command> <result> <command+result>

There's no checksum on commands.
There are 2 special commands, 0xf0 and 0xf1 (single bytes, not prefixed with 0x01)
which tune to frequency A and B respectively - this is for quick switching to do RDS updates.
The tuner acknowleges these by echoing them back.

Other replies from the tuner are:

0x02 <shift> <key> <shift+key>
Stalk response. Shift indicates the shift state of the track skip part
(which can be pushed in, binary 0/1) and key indicates the adc value.

0x03 0x01 0x00 0x01
Overcurrent indication on antenna supply.
Current limit exceeded, foldback in operation.
This indicates a likely short on the antenna output (load <25ohms attached).

command 0: tuner enumerate
1 parameter (0=tuner off/led off, 1=tuner on/led on).
If turned on, result is the tuner id (0x03=am/fm module rev 1) otherwise it's 0.

command 1:
Full tuner setup
8 parameters. Full tuner setup sent to tuner chip (8 bytes).
Result 0

command 2:
Full tuner setup and tuneto
8 parameters. Does tuner setup then resends first 3 bytes with bit 7 of 3rd byte cleared
(unmute audio). Saves frequency as frequency A.
Result 0

command 3:
Tuneto
3 parameters sent as first 3 bytes to tuner. Saves as frequency A.
Result 0

command 4:
read eeprom
1 parameter (address in i2c eeprom to read.
i2c eeprom is inside the canned module and contains antenna calibration values
which are individually calibrated & stored).
Result is the read byte

command 5:
antenna power on/off
1 parameter: 0=antenna down, 1=antenna up
Result 0

command 6:
AM/FM switch direct control
1 parameter, 0=fm/1=am (I think).
Usually, tuneto sets the analogue switch automatically so that the FM-MPX/AM-AF wire
to the empeg carries the appropriate tuner output; this allows it to be overridden
just in case you want to get freaky with the output.
Result 0

command 7:
Force a stalk poll
0 parameters
NO REPLY: well, no normal format reply. You will get a stalk response.

command 8:
set stalk fuzz/stable time
2 parameters: fuzz then stabletime.
Fuzz defines the range within which the stalk adc readings have to stay within
(eg 2 will mean that the reading has to wobble <= +/- 2 from the last ADC read)
for <stable time> loops before it's classified as stable enough to send to the host.
Default is 2/100.
Result 0

command 9:
read tuner module ID
0 parameters
Result is tuner module ID (on rotary dial)

command 10:
read IF counter from tuner
0 parameters
Result is IF counter byte read from tuner module.

command 11:
LED mode
1 parameter, on/off.
If LED mode is set, the LED on the tuner is PWM'ed with relative signal strength - brighter=better signal.
This does not affect any other tuner operation, it's just an installation debug tool.

command 12:
set frequency B
3 parameters, 3 bytes to send to tuner when 0xf1 command is received.
Result 0

command 13: (patrick's tuner only, version 0x28 onwards)
set outputs
1 parameter: low 2 bits control the 2 user output ports
Result 0

command 14: (patrick's tuner only, version 0x28 onwards)
read inputs
0 parameters
Result is state of 4 user inputs in bits 0-3

command 255:
read version
0 parameters
Result is tuner version number. I believe production units are 0x27 (v2.7)

..that's about the size of it! ... The 8 byte setups are very much like the TEA6840 ISTR,
though the chip is a later model.
You really want the UFC1384 module datasheet from Temic.


Edited by mlord (23/08/2013 10:39)

Top
#359484 - 24/08/2013 02:15 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
jonshouse
journeyman

Registered: 18/09/2012
Posts: 55
Loc: Somerset UK
Quote:
You really want the UFC1384 module datasheet from Temic.

Thanks for the useful information. I have made some progress. I am a little stuck without the datasheet at the moment, PCA is away but I will try and catch up with him and ask for more data soon :-)

For the centro box project I have written some code to drive tea5767 modules connected to the P5 connector of the raspberry pi. The 10 pin modules are on ebay for about $1.50, FM only though, it does work with just a passive mixer (4 resistors) but I was going to make a small PCB with a mixer and opamp so that the audio level is the same with or without the added tuner. The cost should be fairly low.

I am trying to add code to drive the MK1 and MK2 empeg tuners via my code. Its slow going but I at least have serial setup, audio source selection working (thanks to published code examples) and am sending/getting data from the pcats tuner module.

Quote:

it should be straightforward to add code to remap commands/responses intended for the factory tuner chip, into appropriate format for the teac5767 chip. There are only a handful of commands used, so not as bad perhaps as it first sounds.

I had considered this but it is not my intention to do it (well ok, if I am completely honest it was my intention to do this, but externally with a PIC rather than with a hijack shim layer - and just for myself). I built a number of tuner kits for other people but I never did buy one of my own, I borrowed one to write the code. It is not my intention to compete with Patrick on the empeg hardware.

The tea5767 driver is intended for the Raspberry Pi board, I was not going to add any new hardware to the empeg unit. What I need to do is add support to my code for the MK1 and MK2 tuners just for completeness.

I will publish what I have soon, as well as listing the kits on ebay. I am sorry for the delays, turns out this project is a little bit more involved than I maybe considered, I am still working on it though. I also have 6 built centro boxes here.

Does anyone have any details of the MK1 tuner software interface, the tuner module itself uses a shift register type arrangement (assuming the board I was looking at is the correct one, TEA5757H) - I guess it has some kind of driver but I have not seen any information on it, I admit I have not dug through the hijack sources yet. I am not always the worlds best programer, my project might be a useful reference for someone else to have a go.


Quote:

The 8 byte setups are very much like the TEA6840 ISTR, though the chip is a later model.

Ok, I will search for that, thanks :-)

Jon


Attachments
centro_tuner_screenshot.jpg

DSCF5684.JPG (379 downloads)


Top
#359485 - 24/08/2013 02:25 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
jonshouse
journeyman

Registered: 18/09/2012
Posts: 55
Loc: Somerset UK
Quote:
Oh, there's also the very useful hijack_trace_tuner=1 flag, to dump out every byte exchanged between the player and the tuner/radio module

Aha, I can see me making use of this :-) Thanks

Top
#359486 - 24/08/2013 12:53 Re: Empeg Tuners: how does player interface with them? [Re: jonshouse]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Originally Posted By: jonshouse
Quote:
You really want the UFC1384 module datasheet from Temic.

Thanks for the useful information. I have made some progress. I am a little stuck without the datasheet at the moment


The datasheet is on riocar.org, and I thought I had placed a direct link to it from my most recent posting in the original thread. But it's not there today, so I'm unsure where it went too.. will look for it here now.

http://empegbbs.com/ubbthreads.php/ubb/s...face#Post102561

Cheers


Edited by mlord (24/08/2013 12:55)

Top
#359487 - 24/08/2013 12:56 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Ahh.. wrong thread. It's in here:

http://empegbbs.com/ubbthreads.php/topics/359473/Re_Tuner_serial_interface#Post359473

And a direct datasheet link for convenience:

http://riocar.org/download.php?op=getit&lid=43

That's the original from Hugo, though it appears to be for the tuner module, rather than simply the Temic chip itself.


Edited by mlord (24/08/2013 12:58)

Top
#359488 - 24/08/2013 20:31 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
jonshouse
journeyman

Registered: 18/09/2012
Posts: 55
Loc: Somerset UK
Quote:
That's the original from Hugo, thoug

Thanks :-) That datasheet does the trick for the MK2 PCATS tuner nicely, I can code that now I think :-) Even if I have problems the hijack feature to dump serial will fill in the blanks. I see a /dev/rds device, I take it if I just do a read() I get the current RDS string?


Any ideas on how to talk to the tuner on the MK1 player? The tuner module on the MK1 contains a TEA5757H, the interface is 25 bits serially loaded into a shift register. At the moment I have no idea how linux on the player does it. I am lazy and would probably have bit banged it from user space but Hugo has more skill than me and probably did it with some device driver?

Thanks,
Jon

Top
#359489 - 24/08/2013 23:57 Re: Empeg Tuners: how does player interface with them? [Re: jonshouse]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
I don't know much at all about the RDS or Mk1 tuners. I *think* your're correct in just reading from /dev/rds to retrieve stuff -- Hijack had some contributed patches for that way way way back when. smile

Top
#359671 - 12/09/2013 12:46 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
jonshouse
journeyman

Registered: 18/09/2012
Posts: 55
Loc: Somerset UK
https://sourceforge.net/projects/centroplayer/files/

srv_v0.59 adds support for tuner in FM mode only at the moment.

Cant figure out how to read signal strengt, anyone know ?

See "player_tuner_empeg.c"

Thanks,
Jon

Top
#359674 - 12/09/2013 18:07 Re: Empeg Tuners: how does player interface with them? [Re: jonshouse]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Dunno, but reports are that reading sig strength (or maybe just AGC control) is broken in current Hijack. Back up to Hijack-v504 for full functionality.

Top
#359682 - 13/09/2013 08:32 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
jonshouse
journeyman

Registered: 18/09/2012
Posts: 55
Loc: Somerset UK
Originally Posted By: mlord
broken in current Hijack. Back up to Hijack-v504 for full functionality.


I didnt know Hijack had that functionality. I seem to miss a lot of what Hijack offers?

I was reading the "IF Counter" from the tuner module via the serial link. This claims to reflect (in some way I dont understand) "signal quality". I guess this is not RSSI. Does the DSP take RSSI by measuring the mpx signal level, that had not occured to me.

I can find "radio-empeg.c" in the hijack source, but once again I have idea what hardware this relates to (does the include the empeg mk1 tuner?) or how to use it from user space. Looking at it I guess I use some kind of IOCTL to read some kind of value using some kind of constants defined in some .h somewhere .... how do you cope with the sprawling mess of tables and zero useful documentation and even worse (and unforgivible from my perspective) the driver soruces dont have any comments to tell you WHAT devices, which hardware - kernel code is like some kind masonic club, I guess I dont yet know the secret handshake to make reading it useful to me .

/* Sonja has an I2Cesque radio data interface */
#define RADIO_DATAOUT GPIO_GPIO10
#define RADIO_DATAIN GPIO_GPIO14
#define RADIO_WRITE GPIO_GPIO13
#define RADIO_CLOCK GPIO_GPIO12


/* Clock out a 25-bit frame */
for(a=24;a>=0;a--) empeg_radio_philips_write_bit(data&(1<<a));
Ok, this is the interface to the MK1 tuner I was missing - its NOT I2C though so I have no idea what the comments are banging on about ...


Ok this looks useful:
unsigned signal = empeg_mixer_get_fm_level();

static void empeg_radio_philips_write_word(int data)
This might be my missing interface to the MK1 tuner, don't know how to use it though?

Its all very confusing unless you already know the internals and interfaces in detail. Seems the empeg has an audio dsp, a mixer and either a gpio connected tuner or a serially connected tuner, I have yet to make sense of how to drive all this with code though ?

This is what I have done to date:
http://www.jonshouse.co.uk/player_tuner_empeg.c

To solve are:
Talking to MK1 tuner from user space. I do have datasheet though.
I can read /dev/rds0 - I assume this is some fixed block length structure not investigated yet, I just need to extract the text fields.
How to read signal level from empeg audio dsp.
AM - not touched that so far.

Thanks,
Jon


Edited by jonshouse (13/09/2013 18:23)

Top
#359683 - 13/09/2013 08:38 Re: Empeg Tuners: how does player interface with them? [Re: jonshouse]
jonshouse
journeyman

Registered: 18/09/2012
Posts: 55
Loc: Somerset UK
As a useful asside, anyone trying to read write data to the serial tuner this is what the data looks like. My code reads the same bytes from the tuners internal EEPROM as the original software, these are used to generate a mystical and poorly documented DAA value - that does something ... maybe ...

Code:
player: just did setup for /dev/ttyS0 (radio) on empeg machine, baud=19200
player: tuner_empeg_get_version() - Sent [ 01 FF 01 ]  Got  [ 01 FF 28 27 ] Version = 28
player: tuner_empeg_initialise() - A tuner of version 28 is present
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 0A  Sent [ 01 04 0A ]  Got [01 04 07 0B ]  ADD 0A = 07
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 0B  Sent [ 01 04 0B ]  Got [01 04 00 04 ]  ADD 0B = 00
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 0C  Sent [ 01 04 0C ]  Got [01 04 58 5C ]  ADD 0C = 58
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 0D  Sent [ 01 04 0D ]  Got [01 04 22 26 ]  ADD 0D = 22
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 0E  Sent [ 01 04 0E ]  Got [01 04 55 59 ]  ADD 0E = 55
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 0F  Sent [ 01 04 0F ]  Got [01 04 44 48 ]  ADD 0F = 44
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 10  Sent [ 01 04 10 ]  Got [01 04 52 56 ]  ADD 10 = 52
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 11  Sent [ 01 04 11 ]  Got [01 04 66 6A ]  ADD 11 = 66
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 12  Sent [ 01 04 12 ]  Got [01 04 4F 53 ]  ADD 12 = 4F
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 13  Sent [ 01 04 13 ]  Got [01 04 89 8D ]  ADD 13 = 89
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 14  Sent [ 01 04 14 ]  Got [01 04 4E 52 ]  ADD 14 = 4E
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 15  Sent [ 01 04 15 ]  Got [01 04 AB AF ]  ADD 15 = AB
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 16  Sent [ 01 04 16 ]  Got [01 04 4E 52 ]  ADD 16 = 4E
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 17  Sent [ 01 04 17 ]  Got [01 04 CD D1 ]  ADD 17 = CD
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 18  Sent [ 01 04 18 ]  Got [01 04 50 54 ]  ADD 18 = 50
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 39  Sent [ 01 04 39 ]  Got [01 04 66 6A ]  ADD 39 = 66
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 43  Sent [ 01 04 43 ]  Got [01 04 75 79 ]  ADD 43 = 75
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 4A  Sent [ 01 04 4A ]  Got [01 04 33 37 ]  ADD 4A = 33
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 4E  Sent [ 01 04 4E ]  Got [01 04 0A 0E ]  ADD 4E = 0A
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 51  Sent [ 01 04 51 ]  Got [01 04 0A 0E ]  ADD 51 = 0A
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 3F  Sent [ 01 04 3F ]  Got [01 04 03 07 ]  ADD 3F = 03
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 40  Sent [ 01 04 40 ]  Got [01 04 DE E2 ]  ADD 40 = DE
player: tuner_empeg_read_eeprom() - Ask EEPROM ADDR 48  Sent [ 01 04 48 ]  Got [01 04 5C 60 ]  ADD 48 = 5C
player: tuner_empeg_set_freq() - F=93.500000    Sent [  01 01 08 24 53 88 A0 75 B3 2A ]  Got [ 01 01 00 01 ] 
player: tuner_empeg_set_freq() - F=93.500000    Sent [  01 03 08 24 53 ]  Got [ 01 03 00 03 ] 

Top
#359684 - 13/09/2013 11:24 Re: Empeg Tuners: how does player interface with them? [Re: jonshouse]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Hijack does not have anything special for getting the radio signal levels, but anything the stock player does to the radio, has to pass through hijack. And after v505, something in Hijack has slightly broken that pathway, making signal levels incorrect (or the AGC turned off, or something).

To see what the factory player does when reading signal levels, just turn on the "trace_tuner=1" flag in the [hijack] section of the player's config.ini.

After initial tuning and whatnot, there may be a periodic polling of signal level. If not, then the player must be getting it from the empeg's DSP rather than directly from the tuner itself.

Cheers

Top
#359685 - 13/09/2013 12:27 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
jonshouse
journeyman

Registered: 18/09/2012
Posts: 55
Loc: Somerset UK
Quote:
he empeg's DSP rather than directly from the tuner itself.

It doesn't seem to be coming directly from the tuner so I guess its via the dsp device.

Any idea how I use the radio device, do you have any examples of reading signal strength from dsp (even if its wrong !)

I used trace_tuner=1 to work out what the software was doing, I used than information to write my radio code. I need to do it all again for AM but one thing at a time.

My code is now tuning in FM, seems to work but looks a little naff on the screen without the signal strength.

Thanks,
Jon


Edited by jonshouse (13/09/2013 12:29)

Top
#359686 - 13/09/2013 17:01 Re: Empeg Tuners: how does player interface with them? [Re: jonshouse]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Looks like ioctl(,EMPEG_MIXER_READ_SIGNAL_STRENGTH) to the /dev/mixer (DSP) device.
Code:
include/linux/empeg.h:#define EMPEG_MIXER_READ_SIGNAL_STRENGTH _IOR(EMPEG_MIXER_MAGIC, 18, int)
include/linux/empeg.h:#define EMPEG_MIXER_READ_SIGNAL_STEREO  _IOR(EMPEG_MIXER_MAGIC, 19, int)
include/linux/empeg.h:#define EMPEG_MIXER_READ_SIGNAL_NOISE   _IOR(EMPEG_MIXER_MAGIC, 21, int)
include/linux/empeg.h:#define EMPEG_MIXER_READ_SIGNAL_MULTIPATH _IOR(EMPEG_MIXER_MAGIC, 22, int)
include/linux/empeg.h:#define EMPEG_MIXER_READ_SIGNAL_STRENGTH_FAST _IOR(EMPEG_MIXER_MAGIC, 24, int)


Top
#359687 - 13/09/2013 17:25 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Here is full stand-alone sample code:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#define EMPEG_MIXER_MAGIC 'm'
#define EMPEG_MIXER_READ_SIGNAL_STRENGTH _IOR(EMPEG_MIXER_MAGIC, 18, int)
#define EMPEG_MIXER_READ_SIGNAL_STEREO  _IOR(EMPEG_MIXER_MAGIC, 19, int)
#define EMPEG_MIXER_READ_SIGNAL_NOISE   _IOR(EMPEG_MIXER_MAGIC, 21, int)
#define EMPEG_MIXER_READ_SIGNAL_MULTIPATH _IOR(EMPEG_MIXER_MAGIC, 22, int)
#define EMPEG_MIXER_READ_SIGNAL_STRENGTH_FAST _IOR(EMPEG_MIXER_MAGIC, 24, int)

int main (int argc, char *argv[])
{
        const char devpath[] = "/dev/mixer";
        int fd, result;

        fd = open(devpath, O_RDWR);
        if (fd == -1) {
                perror(devpath);
                exit(1);
        }
        if (-1 == ioctl(fd, EMPEG_MIXER_READ_SIGNAL_STRENGTH, &result)) {
                perror("EMPEG_MIXER_READ_SIGNAL_STRENGTH");
                exit(1);
        }
        printf("EMPEG_MIXER_READ_SIGNAL_STRENGTH = %d\n", result);
        if (-1 == ioctl(fd, EMPEG_MIXER_READ_SIGNAL_STEREO, &result)) {
                perror("EMPEG_MIXER_READ_SIGNAL_STEREO");
                exit(1);
        }
        printf("EMPEG_MIXER_READ_SIGNAL_STEREO = %d\n", result);
        if (-1 == ioctl(fd, EMPEG_MIXER_READ_SIGNAL_NOISE, &result)) {
                perror("EMPEG_MIXER_READ_SIGNAL_NOISE");
                exit(1);
        }
        printf("EMPEG_MIXER_READ_SIGNAL_NOISE = %d\n", result);
        if (-1 == ioctl(fd, EMPEG_MIXER_READ_SIGNAL_MULTIPATH, &result)) {
                perror("EMPEG_MIXER_READ_SIGNAL_MULTIPATH");
                exit(1);
        }
        printf("EMPEG_MIXER_READ_SIGNAL_MULTIPATH = %d\n", result);
        if (-1 == ioctl(fd, EMPEG_MIXER_READ_SIGNAL_STRENGTH_FAST, &result)) {
                perror("EMPEG_MIXER_READ_SIGNAL_STRENGTH_FAST");
                exit(1);
        }
        printf("EMPEG_MIXER_READ_SIGNAL_STRENGTH_FAST = %d\n", result);
        return 0;
}


Running on Hijack v504, tuned to a mono-FM station, I see this output:

EMPEG_MIXER_READ_SIGNAL_STRENGTH = 38658
EMPEG_MIXER_READ_SIGNAL_STEREO = 0
EMPEG_MIXER_READ_SIGNAL_NOISE = 1526
EMPEG_MIXER_READ_SIGNAL_MULTIPATH = 1782
EMPEG_MIXER_READ_SIGNAL_STRENGTH_FAST = 38832

Top
#359688 - 13/09/2013 17:29 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
On latest Hijack, which is known to have tuner/radio issues, I get this output:

EMPEG_MIXER_READ_SIGNAL_STRENGTH = 0
EMPEG_MIXER_READ_SIGNAL_STEREO = 262143
EMPEG_MIXER_READ_SIGNAL_NOISE = 1
EMPEG_MIXER_READ_SIGNAL_MULTIPATH = 1
EMPEG_MIXER_READ_SIGNAL_STRENGTH_FAST = 0

Top
#359689 - 13/09/2013 18:09 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
jonshouse
journeyman

Registered: 18/09/2012
Posts: 55
Loc: Somerset UK
Thank you for the code, first rate - exactly what I need :-) Thanks !

I guess its a bit late in the day to do another Hijack release ?

Any idea what broke it, looks like a structure doesn't match between a couple of calls or something ?

Top
#359691 - 13/09/2013 19:45 Re: Empeg Tuners: how does player interface with them? [Re: jonshouse]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
The only changes were to (1) fine-tune timing in the I2C transactions, and (2) locking around I2C to prevent two threads from trying to use it simultaneously. From the evidence (other thread), it appears that (2) is what broke it. Weird.

I'll just have to revert the lot and leave the I2C code "as was" in the next release.

Top
#359692 - 13/09/2013 20:01 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Okay, I'll see about issuing Hijack v516 here shortly. Just trying out various levels of "reverting" the I2C patches now.

Top
#359758 - 18/09/2013 12:26 Re: Empeg Tuners: how does player interface with them? [Re: mlord]
jonshouse
journeyman

Registered: 18/09/2012
Posts: 55
Loc: Somerset UK
Thanks for the 516 release, I can confirm the tuner signel level seems to give sensible values.

Top