-
-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add audio streaming support for generic PCM devices. #209
base: master
Are you sure you want to change the base?
Conversation
charlyreen
commented
Mar 19, 2023
- Allow generic PCM devices to stream audio from ALSA via piKVM
- New config parameters in janus.plugin.ustreamer.jcfg:
- pcm_path: Path in /dev/snd/ to PCM device
- pcm_sampling_rate: Sampling rate
- pcm_channels: Number of PCM channels
@@ -95,7 +95,7 @@ us_audio_s *us_audio_init(const char *name, unsigned pcm_hz) { | |||
|
|||
SET_PARAM("Can't initialize PCM params", snd_pcm_hw_params_any); | |||
SET_PARAM("Can't set PCM access type", snd_pcm_hw_params_set_access, SND_PCM_ACCESS_RW_INTERLEAVED); | |||
SET_PARAM("Can't set PCM channels numbre", snd_pcm_hw_params_set_channels, 2); | |||
SET_PARAM("Can't set PCM channels numbre", snd_pcm_hw_params_set_channels, pcm_channels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also fix numbre -> number
?
US_JLOG_INFO("config", "Missing config value: audio.tc358743 OR audio.pcm_path"); | ||
goto error; | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use } else {
on the same line
@@ -53,8 +53,21 @@ us_config_s *us_config_init(const char *config_dir_path) { | |||
} | |||
if ((config->audio_dev_name = _get_value(jcfg, "audio", "device")) != NULL) { | |||
if ((config->tc358743_dev_path = _get_value(jcfg, "audio", "tc358743")) == NULL) { | |||
US_JLOG_INFO("config", "Missing config value: audio.tc358743"); | |||
goto error; | |||
if((config->pcm_path = _get_value(jcfg, "audio", "pcm_path")) == NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use just "pcm"
for the config option name: config->pcm_path = _get_value(jcfg, "audio", "pcm")
Also the space required after if
.
@@ -39,6 +39,9 @@ typedef struct { | |||
|
|||
char *audio_dev_name; | |||
char *tc358743_dev_path; | |||
char *pcm_path; | |||
char *pcm_sampling_rate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why char *
@@ -39,6 +39,9 @@ typedef struct { | |||
|
|||
char *audio_dev_name; | |||
char *tc358743_dev_path; | |||
char *pcm_path; | |||
char *pcm_sampling_rate; | |||
char *pcm_channels; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Has this code been tested? And also, if I remember correctly, OPUS in RTP should always be stereo, shouldn't it? |
Sup? Please take a look to my notes, and change type of |
b6fc13b
to
ef47fa4
Compare
677fbbf
to
e558b0f
Compare
6e85e11
to
1803879
Compare