Skip to contentSkip to conversation

change some parameters for tlg2300

PATCH In review Huang Shijie 1 participant 3 messages Mar 15, 2010 – Mar 16, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 change some parameters for tlg2300

The orgin parameters may cause a bug : The audio may lost in certain situation (such as open the VLC at the first time).

The origin parameters set a small stop_threshold for snd_pcm_runtime{}. So a xrun occurs in some situation.

---
 drivers/media/video/tlg2300/pd-alsa.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
drivers/media/video/tlg2300/pd-alsa.c +0 -10
index 6f42621..e9ad715 100644
@@ -21,9 +21,6 @@
 static void complete_handler_audio(struct urb *urb);
 #define AUDIO_EP	(0x83)
 #define AUDIO_BUF_SIZE	(512)
-#define PERIOD_SIZE	(1024 * 8)
-#define PERIOD_MIN	(4)
-#define PERIOD_MAX 	PERIOD_MIN
 
 static struct snd_pcm_hardware snd_pd_hw_capture = {
 	.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -38,18 +35,11 @@ static struct snd_pcm_hardware snd_pd_hw_capture = {
 	.rate_max = 48000,
 	.channels_min = 2,
 	.channels_max = 2,
-	.buffer_bytes_max = PERIOD_SIZE * PERIOD_MIN,
-	.period_bytes_min = PERIOD_SIZE,
-	.period_bytes_max = PERIOD_SIZE,
-	.periods_min = PERIOD_MIN,
-	.periods_max = PERIOD_MAX,
-	/*
 	.buffer_bytes_max = 62720 * 8,
 	.period_bytes_min = 64,
 	.period_bytes_max = 12544,
 	.periods_min = 2,
 	.periods_max = 98
-	*/
 };
 
 static int snd_pd_capture_open(struct snd_pcm_substream *substream)
Signature · 1 line
1.6.6
#1 lore raw

Hi Mauro:
Please ignore this patch.
This patch has side effect : the radio does not run well with this patch.

Best Regards
Huang Shijie.

Quoted 45 lines

The orgin parameters may cause a bug : The audio may lost in certain situation (such as open the VLC at the first time).

The origin parameters set a small stop_threshold for snd_pcm_runtime{}. So a xrun occurs in some situation.

---
 drivers/media/video/tlg2300/pd-alsa.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
drivers/media/video/tlg2300/pd-alsa.c +0 -10
index 6f42621..e9ad715 100644
@@ -21,9 +21,6 @@
 static void complete_handler_audio(struct urb *urb);
 #define AUDIO_EP	(0x83)
 #define AUDIO_BUF_SIZE	(512)
-#define PERIOD_SIZE	(1024 * 8)
-#define PERIOD_MIN	(4)
-#define PERIOD_MAX 	PERIOD_MIN
 
 static struct snd_pcm_hardware snd_pd_hw_capture = {
 	.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -38,18 +35,11 @@ static struct snd_pcm_hardware snd_pd_hw_capture = {
 	.rate_max = 48000,
 	.channels_min = 2,
 	.channels_max = 2,
-	.buffer_bytes_max = PERIOD_SIZE * PERIOD_MIN,
-	.period_bytes_min = PERIOD_SIZE,
-	.period_bytes_max = PERIOD_SIZE,
-	.periods_min = PERIOD_MIN,
-	.periods_max = PERIOD_MAX,
-	/*
 	.buffer_bytes_max = 62720 * 8,
 	.period_bytes_min = 64,
 	.period_bytes_max = 12544,
 	.periods_min = 2,
 	.periods_max = 98
-	*/
 };
 
 static int snd_pd_capture_open(struct snd_pcm_substream *substream)
#2 lore raw

Hi Mauro:

Quoted 2 lines

This patch has side effect : the radio does not run well with this patch.

I tested the patch carefully.
If I listen the radio with mplayer in the root account, the radio does not run well ( a xrun occurs);
if I listen the radio with mplayer in the normal account (not root). the radio runs well.

Do you have any advice ? Do you think this is a problem?

thanks.

Quoted 51 lines

Best Regards
Huang Shijie.

Quoted 46 lines

The orgin parameters may cause a bug : The audio may lost in certain situation (such as open the VLC at the first time).

The origin parameters set a small stop_threshold for snd_pcm_runtime{}. So a xrun occurs in some situation.

---
 drivers/media/video/tlg2300/pd-alsa.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
drivers/media/video/tlg2300/pd-alsa.c +0 -10
index 6f42621..e9ad715 100644
@@ -21,9 +21,6 @@
 static void complete_handler_audio(struct urb *urb);
 #define AUDIO_EP	(0x83)
 #define AUDIO_BUF_SIZE	(512)
-#define PERIOD_SIZE	(1024 * 8)
-#define PERIOD_MIN	(4)
-#define PERIOD_MAX 	PERIOD_MIN
 
 static struct snd_pcm_hardware snd_pd_hw_capture = {
 	.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -38,18 +35,11 @@ static struct snd_pcm_hardware snd_pd_hw_capture = {
 	.rate_max = 48000,
 	.channels_min = 2,
 	.channels_max = 2,
-	.buffer_bytes_max = PERIOD_SIZE * PERIOD_MIN,
-	.period_bytes_min = PERIOD_SIZE,
-	.period_bytes_max = PERIOD_SIZE,
-	.periods_min = PERIOD_MIN,
-	.periods_max = PERIOD_MAX,
-	/*
 	.buffer_bytes_max = 62720 * 8,
 	.period_bytes_min = 64,
 	.period_bytes_max = 12544,
 	.periods_min = 2,
 	.periods_max = 98
-	*/
 };
 
 static int snd_pd_capture_open(struct snd_pcm_substream *substream)