From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
To: ALSA development <alsa-devel@alsa-project.org>
Cc: "Robert Steffens" <robert.steffens@iosono-sound.com>,
"Fredrik Lingvall" <fredrik.lingvall@gmail.com>,
"Andre Schramm" <andre.schramm@iosono-sound.com>,
"Jörn Nettingsmeier" <nettings@stackingdwarves.net>
Subject: Re: [RME MADI/RayDAT/AIO/AES] Changing hdspm_config and hdspm_status
Date: Mon, 22 Aug 2011 18:31:04 +0200 [thread overview]
Message-ID: <4E528448.4020902@drcomp.erfurt.thur.de> (raw)
In-Reply-To: <4E5283CB.7070902@drcomp.erfurt.thur.de>
On 08/22/11 18:28, Adrian Knoth wrote:
> I'll post the changes to hdspm.c in a second, but that's just a
> preview for discussion, not necessarily the final patch.
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 493e394..0518cfe 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -918,6 +918,7 @@ struct hdspm {
int last_external_sample_rate; /* samplerate mystic ... */
int last_internal_sample_rate;
+ uint32_t dds;
int system_sample_rate;
int dev; /* Hardware vars... */
@@ -1355,6 +1356,7 @@ static void hdspm_set_dds_value(struct hdspm
*hdspm, int rate)
if (rate >= 112000)
rate /= 4;
+ hdspm->dds = (u32) n;
else if (rate >= 56000)
rate /= 2;
@@ -6093,7 +6095,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep
*hw, struct file *file,
void __user *argp = (void __user *)arg;
struct hdspm *hdspm = hw->private_data;
struct hdspm_mixer_ioctl mixer;
- struct hdspm_config info;
+ struct hdspm_config config;
struct hdspm_status status;
struct hdspm_version hdspm_version;
struct hdspm_peak_rms *levels;
@@ -6199,21 +6201,36 @@ static int snd_hdspm_hwdep_ioctl(struct
snd_hwdep *hw, struct file *file,
case SNDRV_HDSPM_IOCTL_GET_CONFIG:
- memset(&info, 0, sizeof(info));
+ memset(&config, 0, sizeof(config));
spin_lock_irq(&hdspm->lock);
- info.pref_sync_ref = hdspm_pref_sync_ref(hdspm);
- info.wordclock_sync_check = hdspm_wc_sync_check(hdspm);
-
- info.system_sample_rate = hdspm->system_sample_rate;
- info.autosync_sample_rate =
- hdspm_external_sample_rate(hdspm);
- info.system_clock_mode = hdspm_system_clock_mode(hdspm);
- info.clock_source = hdspm_clock_source(hdspm);
- info.autosync_ref = hdspm_autosync_ref(hdspm);
- info.line_out = hdspm_line_out(hdspm);
- info.passthru = 0;
+ config.dds = hdspm->dds;
+ if (hdspm->system_sample_rate <= 48000) {
+ config.freq = hdspm->system_sample_rate;
+ config.wck_mul = 1;
+ } else if (hdspm->system_sample_rate <= 96000) {
+ config.freq = hdspm->system_sample_rate/2;
+ config.wck_mul = 2;
+ } else {
+ config.freq = hdspm->system_sample_rate/4;
+ config.wck_mul = 4;
+ }
+ config.clock_mode = hdspm_system_clock_mode(hdspm);
+
+ switch (hdspm->io_type) {
+ case MADI:
+ config.card_specific.madi.line_out = hdspm_line_out(hdspm);
+ config.card_specific.madi.tms = hdspm_c_tms(hdspm);
+ config.card_specific.madi.input_select = hdspm_input_select(hdspm);
+ config.card_specific.madi.output_mode = hdspm_tx_64(hdspm);
+ config.card_specific.madi.sync_ref = hdspm_pref_sync_ref(hdspm);
+ break;
+
+ default:
+ break;
+ }
+
spin_unlock_irq(&hdspm->lock);
- if (copy_to_user((void __user *) arg, &info, sizeof(info)))
+ if (copy_to_user((void __user *) arg, &config, sizeof(config)))
return -EFAULT;
break;
@@ -6239,10 +6256,8 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep
*hw, struct file *file,
statusregister =
hdspm_read(hdspm, HDSPM_statusRegister);
- status.card_specific.madi.madi_input =
- (statusregister & HDSPM_AB_int) ? 1 : 0;
status.card_specific.madi.channel_format =
- (statusregister & HDSPM_TX_64ch) ? 1 : 0;
+ (statusregister & HDSPM_RX_64ch) ? 1 : 0;
/* TODO: Mac driver sets it when f_s>48kHz */
status.card_specific.madi.frame_format = 0;
next prev parent reply other threads:[~2011-08-22 16:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 16:28 [RME MADI/RayDAT/AIO/AES] Changing hdspm_config and hdspm_status Adrian Knoth
2011-08-22 16:31 ` Adrian Knoth [this message]
2011-08-22 16:42 ` Adrian Knoth
2011-08-23 10:53 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E528448.4020902@drcomp.erfurt.thur.de \
--to=adi@drcomp.erfurt.thur.de \
--cc=alsa-devel@alsa-project.org \
--cc=andre.schramm@iosono-sound.com \
--cc=fredrik.lingvall@gmail.com \
--cc=nettings@stackingdwarves.net \
--cc=robert.steffens@iosono-sound.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.