-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc86215
commit 06aefae
Showing
10 changed files
with
557 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,19 @@ | |
* @file hdspe.h | ||
* @brief RME HDSPe driver user space API. | ||
* | ||
* Note: The definitions and structs defined in this header file are used | ||
* within the driver as well as in IOCTLs. As they are used within the | ||
* driver, they are up to date. However, the IOCTLs should be considered | ||
* obsolete: the same information on the driver can be obtained via | ||
* standard ALSA control mechanisms, except for the mixer and level | ||
* meters at this time. To my knowledge (PhB), the only (public) application | ||
* still using the IOCTL interface is hdspmixer. hdspeconf is fully based on | ||
* the ALSA control mechanism. Do not use the IOCTLs for new development - | ||
* inform [email protected] in case you wouldn't be able to do | ||
* without. | ||
* | ||
* 20210728 ... 0813 - [email protected] | ||
* 20220329,30 - PhB : API version 3 (TCO related additions) | ||
* | ||
* Based on earlier work by Winfried Ritsch (IEM, 2003) and | ||
* Thomas Charbonnel ([email protected]), | ||
|
@@ -21,7 +33,7 @@ | |
* Structs returned by the HDSPe driver ioctls contain the API version with which the | ||
* kernel driver has been compiled. API users should check that version against | ||
* HDSPE_VERSION and take appropriate action in case versions differ. */ | ||
#define HDSPE_VERSION 2 | ||
#define HDSPE_VERSION 3 | ||
|
||
/* Maximum hardware input, software playback and hardware output | ||
* channels is 64 even on 56Mode you have 64playbacks to matrix. */ | ||
|
@@ -460,11 +472,41 @@ enum hdspe_video_format { | |
}; | ||
|
||
#define HDSPE_VIDEO_FORMAT_NAME(i) \ | ||
(i == HDSPE_VIDEO_FORMAT_NO_VIDEO ? "No Video" : \ | ||
(i == HDSPE_VIDEO_FORMAT_NO_VIDEO ? "" : \ | ||
i == HDSPE_VIDEO_FORMAT_NTSC ? "NTSC" : \ | ||
i == HDSPE_VIDEO_FORMAT_PAL ? "PAL" : \ | ||
"???") | ||
|
||
enum hdspe_video_fps { /* TCO firmware version 11 and above */ | ||
HDSPE_VIDEO_FPS_NO_VIDEO =0, | ||
HDSPE_VIDEO_FPS_23_98 =1, | ||
HDSPE_VIDEO_FPS_24 =2, | ||
HDSPE_VIDEO_FPS_25 =3, | ||
HDSPE_VIDEO_FPS_29_97 =4, | ||
HDSPE_VIDEO_FPS_30 =5, | ||
HDSPE_VIDEO_FPS_47_95 =6, | ||
HDSPE_VIDEO_FPS_48 =7, | ||
HDSPE_VIDEO_FPS_50 =8, | ||
HDSPE_VIDEO_FPS_59_94 =9, | ||
HDSPE_VIDEO_FPS_60 =10, | ||
HDSPE_VIDEO_FPS_COUNT =11, | ||
HDSPE_VIDEO_FOS_FORCE_32BIT = 0xffffffff | ||
}; | ||
|
||
#define HDSPE_VIDEO_FPS_NAME(i) \ | ||
(i == HDSPE_VIDEO_FPS_NO_VIDEO ? "" : \ | ||
i == HDSPE_VIDEO_FPS_23_98 ? "23.98" : \ | ||
i == HDSPE_VIDEO_FPS_24 ? "24" : \ | ||
i == HDSPE_VIDEO_FPS_25 ? "25" : \ | ||
i == HDSPE_VIDEO_FPS_29_97 ? "29.97" : \ | ||
i == HDSPE_VIDEO_FPS_30 ? "30" : \ | ||
i == HDSPE_VIDEO_FPS_47_95 ? "47.95" : \ | ||
i == HDSPE_VIDEO_FPS_48 ? "28" : \ | ||
i == HDSPE_VIDEO_FPS_50 ? "50" : \ | ||
i == HDSPE_VIDEO_FPS_59_94 ? "59.94" : \ | ||
i == HDSPE_VIDEO_FPS_60 ? "60" : \ | ||
"???") | ||
|
||
enum hdspe_tco_source { | ||
HDSPE_TCO_SOURCE_WCK =0, | ||
HDSPE_TCO_SOURCE_VIDEO =1, | ||
|
@@ -612,6 +654,12 @@ struct hdspe_tco_status { | |
// LTC output control | ||
enum hdspe_bool ltc_run; | ||
enum hdspe_bool ltc_flywheel; | ||
|
||
// HDSPE_VERSION 3: | ||
uint32_t fw_version; | ||
uint32_t fs_period_counter; | ||
enum hdspe_video_fps video_in_fps; // if fw_version >= 11 | ||
enum hdspe_speed wck_out_speed; | ||
}; | ||
|
||
#define SNDRV_HDSPE_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspe_tco_status) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* hdspe-control.c | ||
* @brief RME HDSPe sound card driver status and control interface. | ||
* | ||
* 20210727,28,29,30,0908,09,10 - [email protected] | ||
* 20210727,28,29,30,0908,09,10,20220330 - [email protected] | ||
* | ||
* Based on earlier work of the other MODULE_AUTHORS, | ||
* information kindly made available by RME (www.rme-audio.com), | ||
|
@@ -195,17 +195,20 @@ void hdspe_status_work(struct work_struct *work) | |
|
||
if (hdspe->last_status_change_jiffies == 0) | ||
hdspe->last_status_change_jiffies = jiffies; | ||
|
||
if (changed || jiffies > hdspe->last_status_change_jiffies + 2*HZ) { | ||
if (jiffies > hdspe->last_status_change_jiffies + 2*HZ) | ||
dev_dbg(hdspe->card->dev, | ||
"%s: polling timeout expired.\n", __func__); | ||
|
||
if (changed) { | ||
hdspe->last_status_change_jiffies = 0; | ||
hdspe->status_polling = 0; /* disable - user must re-enable */ | ||
HDSPE_CTL_NOTIFY(status_polling); | ||
} else if (jiffies > hdspe->last_status_change_jiffies + 2*HZ) { | ||
dev_dbg(hdspe->card->dev, | ||
"%s: polling timeout expired: jiffies=%lu, last_status_change_jiffied=%lu, delta=%ld, 2*HZ=%d.\n", __func__, | ||
jiffies, hdspe->last_status_change_jiffies, | ||
jiffies - hdspe->last_status_change_jiffies, 2*HZ); | ||
hdspe->last_status_change_jiffies = 0; | ||
hdspe->status_polling = 0; /* disable - user must re-enable */ | ||
HDSPE_CTL_NOTIFY(status_polling); | ||
} | ||
|
||
if (changed) | ||
hdspe->last_status_change_jiffies = jiffies; | ||
} | ||
|
||
|
||
|
@@ -809,7 +812,7 @@ int snd_hdspe_create_controls(struct snd_card *card, | |
HDSPE_ADD_RV_CONTROL_ID(CARD, "Running", running); | ||
HDSPE_ADD_RV_CONTROL_ID(CARD, "Buffer Size", buffer_size); | ||
|
||
HDSPE_ADD_RW_CONTROL_ID(CARD, "Status Polling", status_polling); | ||
HDSPE_ADD_RWV_CONTROL_ID(CARD, "Status Polling", status_polling); | ||
HDSPE_ADD_RV_CONTROL_ID(HWDEP, "Raw Sample Rate", raw_sample_rate); | ||
HDSPE_ADD_RW_CONTROL_ID(HWDEP, "DDS", dds); | ||
HDSPE_ADD_RW_CONTROL_ID(CARD, "Internal Frequency", internal_freq); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* @file hdspe-control.h | ||
* @brief RME HDSPe sound card driver status and control interface helpers. | ||
* | ||
* 20210728,0907,08,09,10 - [email protected] | ||
* 20210728,0907,08,09,10,20220330 - [email protected] | ||
* | ||
* Based on earlier work of the other MODULE_AUTHORs, | ||
* information kindly made available by RME (www.rme-audio.com), | ||
|
@@ -72,6 +72,23 @@ | |
.put = snd_hdspe_put_##prop \ | ||
} | ||
|
||
/** | ||
* HDSPE_RWV_KCTL - generate a snd_kcontrol_new struct for a read-write | ||
* volatile property. | ||
* @xface: MIXER, CARD, etc... | ||
* @xname: display name for the property. | ||
* @prop: source code name for the property. | ||
*/ | ||
#define HDSPE_RWV_KCTL(xface, xname, prop) \ | ||
{ .iface = SNDRV_CTL_ELEM_IFACE_##xface, \ | ||
.name = xname, \ | ||
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ | ||
SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ | ||
.info = snd_hdspe_info_##prop, \ | ||
.get = snd_hdspe_get_##prop, \ | ||
.put = snd_hdspe_put_##prop \ | ||
} | ||
|
||
/** | ||
* HDSPE_WO_KCTL - generate a snd_kcontrol_new struct for a write-only property. | ||
* @xface: MIXER, CARD, etc... | ||
|
@@ -444,5 +461,8 @@ static int snd_hdspe_put_##prop(struct snd_kcontrol *kcontrol, \ | |
#define HDSPE_ADD_RW_BOOL_CONTROL_ID(iface, name, prop) \ | ||
HDSPE_ADD_CONTROL_ID(HDSPE_RW_BOOL_KCTL(iface, name, prop), prop) | ||
|
||
#define HDSPE_ADD_RWV_CONTROL_ID(iface, name, prop) \ | ||
HDSPE_ADD_CONTROL_ID(HDSPE_RWV_KCTL(iface, name, prop), prop) | ||
|
||
|
||
#endif /* _HDSPE_CONTROL_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.