Skip to content
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

Modify ALSA default max devices #4251

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pjmedia/include/pjmedia-audiodev/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ PJ_BEGIN_DECL
* @{
*/

/**
* This setting controls the maximum number of supported audio devices.
*
* Default: 64
*/
#ifndef PJMEDIA_AUD_DEV_MAX_DEVS
# define PJMEDIA_AUD_DEV_MAX_DEVS 64
#endif

/**
* This setting controls the buffer length of audio device name.
*
Expand Down
3 changes: 1 addition & 2 deletions pjmedia/include/pjmedia/audiodev.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ typedef pj_int32_t pjmedia_aud_dev_index;
#define PJMEDIA_AUD_INVALID_DEV -3

#define PJMEDIA_AUD_MAX_DRIVERS 16
#define PJMEDIA_AUD_MAX_DEVS 64


/** Forward declaration for pjmedia_aud_stream */
Expand Down Expand Up @@ -117,7 +116,7 @@ typedef struct pjmedia_aud_subsys
pjmedia_aud_driver drv[PJMEDIA_AUD_MAX_DRIVERS];/* Array of drivers. */

unsigned dev_cnt; /* Total number of devices. */
pj_uint32_t dev_list[PJMEDIA_AUD_MAX_DEVS];/* Array of dev IDs. */
pj_uint32_t dev_list[PJMEDIA_AUD_DEV_MAX_DEVS];/* Array dev IDs.*/

} pjmedia_aud_subsys;

Expand Down
2 changes: 1 addition & 1 deletion pjmedia/src/pjmedia-audiodev/alsa_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define ALSASOUND_CAPTURE 2
#define MAX_SOUND_CARDS 5
#define MAX_SOUND_DEVICES_PER_CARD 5
#define MAX_DEVICES 32
#define MAX_DEVICES PJMEDIA_AUD_DEV_MAX_DEVS
#define MAX_MIX_NAME_LEN 64

/* Set to 1 to enable tracing */
Expand Down
6 changes: 3 additions & 3 deletions pjmedia/src/pjmedia/audiodev.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ PJ_DEF(pj_status_t) pjmedia_aud_driver_init(unsigned drv_idx,

/* Get number of devices */
dev_cnt = f->op->get_dev_count(f);
if (dev_cnt + aud_subsys.dev_cnt > PJMEDIA_AUD_MAX_DEVS) {
if (dev_cnt + aud_subsys.dev_cnt > PJMEDIA_AUD_DEV_MAX_DEVS) {
PJ_LOG(4,(THIS_FILE, "%d device(s) cannot be registered because"
" there are too many devices",
aud_subsys.dev_cnt + dev_cnt -
PJMEDIA_AUD_MAX_DEVS));
dev_cnt = PJMEDIA_AUD_MAX_DEVS - aud_subsys.dev_cnt;
PJMEDIA_AUD_DEV_MAX_DEVS));
dev_cnt = PJMEDIA_AUD_DEV_MAX_DEVS - aud_subsys.dev_cnt;
}

/* enabling this will cause pjsua-lib initialization to fail when there
Expand Down
Loading