summaryrefslogtreecommitdiff
path: root/src/seq
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2002-06-21 12:24:58 +0000
committerTakashi Iwai <tiwai@suse.de>2002-06-21 12:24:58 +0000
commit84730c976f7f5d51b32f80964e252a43e477e198 (patch)
tree037f380f7cd9cca9c191d365da20df68d354bc1d /src/seq
parent5541c7a31eab0b554be1dfa3c7c72eea71fdf403 (diff)
initialize the running mode (if exists).
Diffstat (limited to 'src/seq')
-rw-r--r--src/seq/seq_hw.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/seq/seq_hw.c b/src/seq/seq_hw.c
index 79939c0b..22296b98 100644
--- a/src/seq/seq_hw.c
+++ b/src/seq/seq_hw.c
@@ -504,6 +504,28 @@ int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode)
return client;
} else
seq->client = client;
+
+#ifdef SNDRV_SEQ_IOCTL_RUNNING_MODE
+ {
+ struct sndrv_seq_running_info run_mode;
+ /* check running mode */
+ memset(&run_mode, 0, sizeof(run_mode));
+ run_mode.client = client;
+#ifdef SNDRV_BIG_ENDIAN
+ run_mode.big_endian = 1;
+#else
+ run_mode.big_endian = 0;
+#endif
+ run_mode.cpu_mode = sizeof(long);
+ if (ioctl(fd, SNDRV_SEQ_IOCTL_RUNNING_MODE, &run_mode) < 0) {
+ int err = errno;
+ SYSERR("Invalid OS running mode");
+ snd_seq_close(seq);
+ return -err;
+ }
+ }
+#endif
+
*handle = seq;
return 0;
}