Alsa asynchronous callback

alsacallback

I was using asynchronous callback for capturing sound signals from IC-7410 and from Soft66LC4. It was working fine before, but with some unknown reasons, my program became less and less stable in the process of my improvement, namely the refinement of the program structure and some additional fancy features.

Is Alsa asynchronous callback not compatible with gtkmm especially with its own callback functions? Not likely, I supoose.

Anyway, I decided to modify the program not to use Alsa callbacks, and it works fine now.

void asound_async_callback0_wrapper(snd_async_handler_t * ahandler) {
//	mysound[0]->asound_async_callback(ahandler);
}

void asound_async_callback1_wrapper(snd_async_handler_t * ahandler) {
//	mysound[1]->asound_async_callback(ahandler);
}
bool Waterfall::on_draw(const Cairo::RefPtr<Cairo::Context> &cr) {
	bool ready[2] = {false, false};
	for(int irep=0;irep<2;irep++) {
		ready[irep] = mysound[irep]->asound_myread();
	}
bool Sound::asound_myread() {
	avail = snd_pcm_avail_update(handle);
	if (avail == -EPIPE) {    /* under-run */
		int err = snd_pcm_recover(handle, -EPIPE, 0);
		return false;
	}

	int loop_count = 0;
	while (avail >= (snd_pcm_sframes_t) period_size) {
		frames_actually_read = snd_pcm_readi(handle, samples, period_size);
		if (frames_actually_read < 0) {
			exit(EXIT_FAILURE);
		}
		if (frames_actually_read != (int) period_size) {
			exit(EXIT_FAILURE);
		}
		for (int i = 0; i < (int) (period_size * channels); i++) {
			audio_signal[i] = samples[i];
		}
		avail = snd_pcm_avail_update(handle);
		cout << myid << "in the while loop, avail = " << avail << endl;
	}
	if(loop_count > 0) {
		return true;
	} else {
		return false;
	}
}

Saturday Mornings

thumb_russian

I wake up rather early on Saturdays and watch some TV programs recorded during the weekdays.

First comes Russian.

У вас есть борщ? (Do you have borscht?)

220px-Borshch2

Then other languages.

thumb_french

thumb_italian

thumb_spanish

thumb_german

The order reflects my current state of interests.

This is my DX time in the morning trying to getting in touch with different cultures.

Anna Karenina

AnnaKareninaTitle
http://en.wikipedia.org/wiki/Anna_Karenina

They often talk in French, so I need to be efficient in two languages to fully enjoy the novel.

AnnaKarenina2

O.K. At least I can read the title. I think I have made good progress.

The first sentence reads “Happy families are all alike; every unhappy family is unhappy in its own way.”, but I have seen none of the words before..

I do not know why the author’s name, Лев Никола́евич Толсто́й, is spelled differently in the first figure.

Timeout Intervals (2)

timer10

We have two windows for waterfall display, one for IC-7410, and one for Soft66LC4, and if we set the timer intervals to 50mS and 70mS, respectively, we have this kind of histogram, which looks reasonable.

Timeout Intervals

timer

Checking timer intervals for waterfall display.

Glib::signal_timeout().connect(sigc::mem_fun(*this, &Waterfall::on_timeout), 70 );

The timeout interval is set to 70mS.

void cout_gettimeofday_diff(string myid, timeval t0, timeval t1) {
  if (t1.tv_usec < t0.tv_usec) {
    cout << myid << t1.tv_sec  - t0.tv_sec -1
          << "." << setfill('0') << setw(6) <<  1000000 + t1.tv_usec - t0.tv_usec << endl;
  } else {
    cout << myid << t1.tv_sec  - t0.tv_sec
          << "." << setfill('0') << setw(6) <<            t1.tv_usec - t0.tv_usec << endl;
  }
}

bool Waterfall::on_timeout() {
  static struct timeval t1, t1b4;
  gettimeofday(&t1, NULL);
  cout_gettimeofday_diff("Waterfall::on_timeout: interval: ", t1b4, t1);
  t1b4 = t1;
}
Waterfall::on_timeout: interval: 0.080361
Waterfall::on_timeout: interval: 0.073704
Waterfall::on_timeout: interval: 0.070262
Waterfall::on_timeout: interval: 0.070617
Waterfall::on_timeout: interval: 0.070572
Waterfall::on_timeout: interval: 0.070265
Waterfall::on_timeout: interval: 0.073217
Waterfall::on_timeout: interval: 0.070718
Waterfall::on_timeout: interval: 0.070061
Waterfall::on_timeout: interval: 0.070185
Waterfall::on_timeout: interval: 0.070964
Waterfall::on_timeout: interval: 0.074634
Waterfall::on_timeout: interval: 0.070707
Waterfall::on_timeout: interval: 0.070519
Waterfall::on_timeout: interval: 0.070174
Waterfall::on_timeout: interval: 0.070825
Waterfall::on_timeout: interval: 0.073477
Waterfall::on_timeout: interval: 0.070414
Waterfall::on_timeout: interval: 0.070088
Waterfall::on_timeout: interval: 0.070097
Waterfall::on_timeout: interval: 0.071018
Waterfall::on_timeout: interval: 0.070920
Waterfall::on_timeout: interval: 0.070908
Waterfall::on_timeout: interval: 0.070211

timer2

timer3

% R
> x <- read.csv("ttt.txt")
> hist(x[,1], col="orange", breaks=200)

nginx

nginx

I have been using Apache for many many years, and this is my first time to use nginx.

Here is a test page with a very simple html file.

nginx2

Triple Monitors

tripledisplay

Now I have three monitors on my desk. Hopefully this increases my productivity especially in programming.

I have relatively a small desk in my shack, so I thought I can only use two monitors, because I also need a space for my rig.

DSC_9529y

But, after using the rig control program, sprigmm, for a while, I found that I rarely touch the front panel of my rig. Therefore, I decided that I do not have to keep my rig on the desk.

Test Signals for Waterfall

calib

Audacity is used to generate the tones, 0.7kHz, 3kHz, 5kHz, 7kHz, 11kHz, 13kHz, 17kHz, 19kHz, 20kHz, and 21kHz with and without some amount of white noise. The signal from the Line Out connector of the motherboard is looped back into the line In connector with a cable, which is usually connected to the analog output of the Soft66LC4.

IC7410x

Antenna Here is a Half Dipole

I did not notice for several days that my antenna was a half dipole. The center feed point was on the ground, because the left side of the antenna element was disconnected from the feed line perhaps due to fatigue.

It is interesting that the SWR was always around 1.0 (Yes, I have a nice ATU.), and that I observed no degradation while watching (Yes, I have nice ears.).

Anyway, it is back in the air now, and what I hear is … lots of “CQ TEST” again.