em28xx: Terratec Grabby no sound
Hi,
I recently bought a Terratec Grabby. The device has a S-Video and 3 Cinch cables (sound left, sound right, video). I want to record some video cassettes with it. (with a cinch-scart adapter).
I checked the signal, there is audio and video on it.
When I try to "play" the capture device with e.g. mplayer, I see "no sound", even with various options.
I can hear sound only by doing "arecord -D hw:2,0 -r 32000 -c 2 -f S16_LE | aplay -", but as soon as mplayer is starting, I can't hear anything anymore.
...which means that using alsa as the sound device with mplayer doesn't work either.
Am I missing something?
I checked the source code, Terratec Grabby support was introduced with 4557af9c5338605c85fe54f5ebba3d4b14a60ab8:
-----------------------------------------
drivers/media/video/em28xx/em28xx-cards.c +18 -0
@@ -1347,6 +1347,22 @@ struct em28xx_board em28xx_boards[] = { .amux = EM28XX_AMUX_VIDEO, } }, }, + [EM2860_BOARD_TERRATEC_GRABBY ] = { + .name ="Terratec Grabby" , + .vchannels =2 , + .tuner_type =TUNER_ABSENT , + .decoder =EM28XX_SAA711X , + .xclk =EM28XX_XCLK_FREQUENCY_12MHZ , + .input = { { + .type =EM28XX_VMUX_COMPOSITE1 , + .vmux =SAA7115_COMPOSITE0 , + .amux =EM28XX_AMUX_VIDEO2 , + }, { + .type =EM28XX_VMUX_SVIDEO , + .vmux =SAA7115_SVIDEO3 , + .amux =EM28XX_AMUX_VIDEO2 , + } }, + }, };const unsigned int em28xx_bcount =ARRAY_SIZE (em28xx_boards);
@@ -1410,6 +1426,8 @@ struct usb_device_id em28xx_id_table[] = { .driver_info = EM2870_BOARD_TERRATEC_XS }, { USB_DEVICE(0x0ccd, 0x0047), .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS }, + { USB_DEVICE(0x0ccd, 0x0096), + .driver_info = EM2860_BOARD_TERRATEC_GRABBY }, { USB_DEVICE(0x185b, 0x2870), .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE }, { USB_DEVICE(0x185b, 0x2041),
drivers/media/video/em28xx/em28xx.h +1 -0
@@ -103,6 +103,7 @@#define EM2860_BOARD_EASYCAP 64#define EM2820_BOARD_IODATA_GVMVP_SZ 65#define EM2880_BOARD_EMPIRE_DUAL_TV 66 +#define EM2860_BOARD_TERRATEC_GRABBY 67/* Limits minimum and default number of buffers */ #define EM28XX_MIN_BUF 4
-----------------------------------------
Is there maybe a wrong amux set? Which one could it be? Is sound-usb-audio somehow conflicting with em28xx module?
I hope you have an idea what is wrong here!
Florian Klink
Em 25-10-2010 15:24, Florian Klink escreveu:
Quoted 11 lines
Hi,
I recently bought a Terratec Grabby. The device has a S-Video and 3 Cinch cables (sound left, sound right, video). I want to record some video cassettes with it. (with a cinch-scart adapter).
I checked the signal, there is audio and video on it.
When I try to "play" the capture device with e.g. mplayer, I see "no sound", even with various options.
Quoted 8 lines
I can hear sound only by doing "arecord -D hw:2,0 -r 32000 -c 2 -f
S16_LE| aplay -", but as soon as mplayer is starting, I can't hear anything anymore....which means that using alsa as the sound device with mplayer doesn't work either.
Am I missing something?
Maybe the amux is wrong. The only way to know for sure is to check the used GPIO's, via a USB snoop dump. Please take a look at linuxtv.org Wiki (search for usbsnoop). After getting the dump, please parse it and send me.
Quoted 62 lines
I checked the source code, Terratec Grabby support was introduced with
4557af9c5338605c85fe54f5ebba3d4b14a60ab8:-----------------------------------------
drivers/media/video/em28xx/em28xx-cards.c +18
-0@@ -1347,6 +1347,22 @@ struct em28xx_board em28xx_boards[] = { .amux = EM28XX_AMUX_VIDEO, } }, }, + [EM2860_BOARD_TERRATEC_GRABBY ] = { + .name ="Terratec Grabby" , + .vchannels =2 , + .tuner_type =TUNER_ABSENT , + .decoder =EM28XX_SAA711X , + .xclk =EM28XX_XCLK_FREQUENCY_12MHZ , + .input = { { + .type =EM28XX_VMUX_COMPOSITE1 , + .vmux =SAA7115_COMPOSITE0 , + .amux =EM28XX_AMUX_VIDEO2 , + }, { + .type =EM28XX_VMUX_SVIDEO , + .vmux =SAA7115_SVIDEO3 , + .amux =EM28XX_AMUX_VIDEO2 , + } }, + }, };const unsigned int em28xx_bcount =ARRAY_SIZE (em28xx_boards);@@ -1410,6 +1426,8 @@ struct usb_device_id em28xx_id_table[] = { .driver_info = EM2870_BOARD_TERRATEC_XS }, { USB_DEVICE(0x0ccd, 0x0047), .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS }, + { USB_DEVICE(0x0ccd, 0x0096), + .driver_info = EM2860_BOARD_TERRATEC_GRABBY }, { USB_DEVICE(0x185b, 0x2870), .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE }, { USB_DEVICE(0x185b, 0x2041),drivers/media/video/em28xx/em28xx.h +1
-1@@ -103,6 +103,7 @@#define EM2860_BOARD_EASYCAP 64#define EM2820_BOARD_IODATA_GVMVP_SZ 65#define EM2880_BOARD_EMPIRE_DUAL_TV 66 +#define EM2860_BOARD_TERRATEC_GRABBY 67/* Limits minimum and default number of buffers */ #define EM28XX_MIN_BUF 4 -----------------------------------------Is there maybe a wrong amux set? Which one could it be? Is sound-usb-audio somehow conflicting with em28xx module?
I hope you have an idea what is wrong here!
Florian Klink
A message that is not in the archive (sent off-list or not yet received): [email protected]
Em 25-10-2010 18:24, Florian Klink escreveu:
Quoted 3 lines
Hi Mauro,
thanks for your answer!
I'm c/c the mailing list, as this info may be useful for the others. It would be nice to have this added to wiki, but I won't have time for it, unfortunately.
Quoted 7 lines
Quoted 6 lines
Maybe the amux is wrong. The only way to know for sure is to check the used GPIO's,
via a USB snoop dump. Please take a look at linuxtv.org Wiki (search for usbsnoop).
After getting the dump, please parse it and send me.
Quoted 5 lines
I did the usbsnooping and hope I did the parsing right (At least the log file shrinked from 100MB to some KB, and there are plenty of EM28XX strings inside ;-))
You can get it here: http://pastebin.com/SXKfLUny
There are a few things that are relevant:
First of all, GPIO's. They enable/disable parts of the board:
$ grep GPIO /tmp/dump em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff); em28xx_read_reg(dev, EM28XX_R08_GPIO); /* read 0xff */ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); em28xx_read_reg(dev, EM28XX_R08_GPIO); /* read 0xfd */ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); em28xx_read_reg(dev, EM28XX_R08_GPIO); /* read 0xfd */ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d); em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x2a); em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x2a);
Currently, they're not touched for this device. Perhaps, we might need to initialize them to 0xfd for capture mode, and 0x2a for sleep mode.
In this specific case, maybe it is just safe to keep it as-is, as I suspect that GPIO's are not used on this device. I may be wrong, though. A simple test will tell.
The audio entries are related to the ac97 chip.
The driver will basically run this code:
amux = EM28XX_AMUX_VIDEO2; /* from Terratec Grabby entry, at em28xx-cards.c */
static struct em28xx_vol_table inputs[] = {
{ EM28XX_AMUX_VIDEO, AC97_VIDEO_VOL },
{ EM28XX_AMUX_LINE_IN, AC97_LINEIN_VOL },
{ EM28XX_AMUX_PHONE, AC97_PHONE_VOL },
{ EM28XX_AMUX_MIC, AC97_MIC_VOL },
{ EM28XX_AMUX_CD, AC97_CD_VOL },
{ EM28XX_AMUX_AUX, AC97_AUX_VOL },
{ EM28XX_AMUX_PCM_OUT, AC97_PCM_OUT_VOL },if (amux == inputs[i].mux)
ret = em28xx_write_ac97(dev, inputs[i].reg, 0x0808); /* Put the volume in 50% */ else ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000); /* Mute the volume */
Any mixer entry equal or bigger than 0x8000 is muted.
$ grep 97 dump em28xx_read_ac97(dev, AC97_VENDOR_ID1); /* read 0x0x8384 */ em28xx_read_ac97(dev, AC97_VENDOR_ID2); /* read 0x0x7652 */ em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_reg(dev, EM28XX_R42_AC97ADDR, 0x16); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010);
Quoted 1 line
From the logs, the only mixer line used on this device is:
em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808);
So, I think that the correct value, at em28xx-cards.c is:
amux = EM28XX_AMUX_LINE_IN,
Ok, could you please test the enclosed patch? Please test it with both Composite and S-Video entries.
Cheers,
Mauro
---
em28xx: fix Terratec Grabby lack of sound
Audio mux were pointing to the wrong line entry.
drivers/media/video/em28xx/em28xx-cards.c +2 -2
@@ -1633,11 +1633,11 @@ struct em28xx_board em28xx_boards[] = { .input = { { .type = EM28XX_VMUX_COMPOSITE1, .vmux = SAA7115_COMPOSITE0, - .amux = EM28XX_AMUX_VIDEO2, + .amux = EM28XX_AMUX_LINE_IN, }, { .type = EM28XX_VMUX_SVIDEO, .vmux = SAA7115_SVIDEO3, - .amux = EM28XX_AMUX_VIDEO2, + .amux = EM28XX_AMUX_LINE_IN, } }, }, [EM2860_BOARD_TERRATEC_AV350] = {
Hi,
I'm not very familiar with mailing lists, sorry!
Patched em28xx-cards.c, but no luck with
mplayer -v -tv driver=v4l2:input=0:device=/dev/video1:forceaudio tv:// (/dev/video0 is webcam). I'm able to see the video, but still no sound in mplayer
playing the sound with arecord works (i think it goes over the snd-usb-audio module,
but don't know why some "mplayer -v -tv driver=v4l2:input=0:device=/dev/video1:alsa:adevice=hw.2,0:forceaudio tv://" magic won't do the job.
And shouldn't the sound go over v4l, too?
Florian
Quoted 246 lines · Mauro Carvalho Chehab
Em 25-10-2010 18:24, Florian Klink escreveu:
Quoted 3 lines
Hi Mauro,
thanks for your answer!
I'm c/c the mailing list, as this info may be useful for the others. It would be nice to have this added to wiki, but I won't have time for it, unfortunately.
Quoted 7 lines
Quoted 6 lines
Maybe the amux is wrong. The only way to know for sure is to check the used GPIO's,
via a USB snoop dump. Please take a look at linuxtv.org Wiki (search for usbsnoop).
After getting the dump, please parse it and send me.Quoted 5 lines
I did the usbsnooping and hope I did the parsing right (At least the log file shrinked from 100MB to some KB, and there are plenty of EM28XX strings inside ;-))
You can get it here: http://pastebin.com/SXKfLUny
There are a few things that are relevant:
First of all, GPIO's. They enable/disable parts of the board:
$ grep GPIO /tmp/dump em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff); em28xx_read_reg(dev, EM28XX_R08_GPIO); /* read 0xff */ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); em28xx_read_reg(dev, EM28XX_R08_GPIO); /* read 0xfd */ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); em28xx_read_reg(dev, EM28XX_R08_GPIO); /* read 0xfd */ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d); em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x2a); em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x2a);Currently, they're not touched for this device. Perhaps, we might need to initialize
them to0xfdfor capture mode, and0x2afor sleep mode.In this specific case, maybe it is just safe to keep it as-is, as I suspect that GPIO's
are not used on this device. I may be wrong, though. A simple test will tell.The audio entries are related to the ac97 chip.
The driver will basically run this code:
amux =
EM28XX_AMUX_VIDEO2; /* from Terratec Grabby entry, atem28xx-cards.c*/static struct em28xx_vol_table inputs[] = { { EM28XX_AMUX_VIDEO, AC97_VIDEO_VOL }, { EM28XX_AMUX_LINE_IN, AC97_LINEIN_VOL }, { EM28XX_AMUX_PHONE, AC97_PHONE_VOL }, { EM28XX_AMUX_MIC, AC97_MIC_VOL }, { EM28XX_AMUX_CD, AC97_CD_VOL }, { EM28XX_AMUX_AUX, AC97_AUX_VOL }, { EM28XX_AMUX_PCM_OUT, AC97_PCM_OUT_VOL },if (amux == inputs[i].mux)
ret = em28xx_write_ac97(dev, inputs[i].reg, 0x0808); /* Put the volume in 50% */ else ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000); /* Mute thevolume */
Any mixer entry equal or bigger than
0x8000is muted.$ grep 97 dump em28xx_read_ac97(dev, AC97_VENDOR_ID1); /* read 0x0x8384 */ em28xx_read_ac97(dev, AC97_VENDOR_ID2); /* read 0x0x7652 */ em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_reg(dev, EM28XX_R42_AC97ADDR, 0x16); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010);From the logs, the only mixer line used on this device is:
em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808);So, I think that the correct value, at
em28xx-cards.cis:amux = EM28XX_AMUX_LINE_IN,Ok, could you please test the enclosed patch? Please test it with both Composite and S-Video entries.
Cheers,
Mauro---
em28xx: fix Terratec Grabby lack of sound
Audio mux were pointing to the wrong line entry.
Reported-by Florian Klink <[email protected]>drivers/media/video/em28xx/em28xx-cards.c +2
-3@@ -1633,11 +1633,11 @@ struct em28xx_board em28xx_boards[] = { .input = { { .type = EM28XX_VMUX_COMPOSITE1, .vmux = SAA7115_COMPOSITE0, - .amux = EM28XX_AMUX_VIDEO2, + .amux = EM28XX_AMUX_LINE_IN, }, { .type = EM28XX_VMUX_SVIDEO, .vmux = SAA7115_SVIDEO3, - .amux = EM28XX_AMUX_VIDEO2, + .amux = EM28XX_AMUX_LINE_IN, } }, }, [EM2860_BOARD_TERRATEC_AV350] = { --To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Em 25-10-2010 20:06, Florian Klink escreveu:
Quoted 4 lines
Hi,
I'm not very familiar with mailing lists, sorry!
Quoted 8 lines
Patched
em28xx-cards.c, but no luck with
mplayer -v -tv driver=v4l2:input=0:device=/dev/video1:forceaudio tv:// (/dev/video0is webcam). I'm able to see the video, but still no sound in mplayerplaying the sound with arecord works (i think it goes over the snd-usb-audio module,
but don't know why some "mplayer -v -tv driver=v4l2:input=0:device=/dev/video1:alsa:adevice=hw.2,0:forceaudio tv://" magic won't do the job.And shouldn't the sound go over v4l, too?
The sound comes from alsa device. Several em28xx types provide standard USB audio. So, snd-usb-audio handles it. That's why you need alsa:adevice=hw.2,0:forceaudio at mplayer.
Quoted 253 lines
Florian
Quoted 246 lines · Mauro Carvalho Chehab
Em 25-10-2010 18:24, Florian Klink escreveu:
Quoted 3 lines
Hi Mauro,
thanks for your answer!
I'm c/c the mailing list, as this info may be useful for the others. It would be nice to have this added to wiki, but I won't have time for it, unfortunately.
Quoted 7 lines
Quoted 6 lines
Maybe the amux is wrong. The only way to know for sure is to check the used GPIO's,
via a USB snoop dump. Please take a look at linuxtv.org Wiki (search for usbsnoop).
After getting the dump, please parse it and send me.Quoted 5 lines
I did the usbsnooping and hope I did the parsing right (At least the log file shrinked from 100MB to some KB, and there are plenty of EM28XX strings inside ;-))
You can get it here: http://pastebin.com/SXKfLUny
There are a few things that are relevant:
First of all, GPIO's. They enable/disable parts of the board:
$ grep GPIO /tmp/dump em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff); em28xx_read_reg(dev, EM28XX_R08_GPIO); /* read 0xff */ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); em28xx_read_reg(dev, EM28XX_R08_GPIO); /* read 0xfd */ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); em28xx_read_reg(dev, EM28XX_R08_GPIO); /* read 0xfd */ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d); em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x2a); em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x2a);Currently, they're not touched for this device. Perhaps, we might need to initialize
them to0xfdfor capture mode, and0x2afor sleep mode.In this specific case, maybe it is just safe to keep it as-is, as I suspect that GPIO's
are not used on this device. I may be wrong, though. A simple test will tell.The audio entries are related to the ac97 chip.
The driver will basically run this code:
amux =
EM28XX_AMUX_VIDEO2; /* from Terratec Grabby entry, atem28xx-cards.c*/static struct em28xx_vol_table inputs[] = { { EM28XX_AMUX_VIDEO, AC97_VIDEO_VOL }, { EM28XX_AMUX_LINE_IN, AC97_LINEIN_VOL }, { EM28XX_AMUX_PHONE, AC97_PHONE_VOL }, { EM28XX_AMUX_MIC, AC97_MIC_VOL }, { EM28XX_AMUX_CD, AC97_CD_VOL }, { EM28XX_AMUX_AUX, AC97_AUX_VOL }, { EM28XX_AMUX_PCM_OUT, AC97_PCM_OUT_VOL },if (amux == inputs[i].mux)
ret = em28xx_write_ac97(dev, inputs[i].reg, 0x0808); /* Put the volume in 50% */ else ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000); /* Mute thevolume */
Any mixer entry equal or bigger than
0x8000is muted.$ grep 97 dump em28xx_read_ac97(dev, AC97_VENDOR_ID1); /* read 0x0x8384 */ em28xx_read_ac97(dev, AC97_VENDOR_ID2); /* read 0x0x7652 */ em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_reg(dev, EM28XX_R42_AC97ADDR, 0x16); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200); em28xx_write_ac97(dev, AC97_RECORD_SELECT, 0x0505); em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031); em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x8000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_RECORD_GAIN, 0x0000); em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808); em28xx_write_ac97(dev, AC97_VIDEO_VOL, 0x9010); em28xx_write_ac97(dev, AC97_AUX_VOL, 0x9010); em28xx_write_ac97(dev, AC97_MIC_VOL, 0x9010);From the logs, the only mixer line used on this device is:
em28xx_write_ac97(dev, AC97_LINEIN_VOL, 0x0808);So, I think that the correct value, at
em28xx-cards.cis:amux = EM28XX_AMUX_LINE_IN,Ok, could you please test the enclosed patch? Please test it with both Composite and S-Video entries.
Cheers,
Mauro---
em28xx: fix Terratec Grabby lack of sound
Audio mux were pointing to the wrong line entry.
Reported-by Florian Klink <[email protected]>drivers/media/video/em28xx/em28xx-cards.c +2
-2@@ -1633,11 +1633,11 @@ struct em28xx_board em28xx_boards[] = { .input = { { .type = EM28XX_VMUX_COMPOSITE1, .vmux = SAA7115_COMPOSITE0, - .amux = EM28XX_AMUX_VIDEO2, + .amux = EM28XX_AMUX_LINE_IN, }, { .type = EM28XX_VMUX_SVIDEO, .vmux = SAA7115_SVIDEO3, - .amux = EM28XX_AMUX_VIDEO2, + .amux = EM28XX_AMUX_LINE_IN, } }, }, [EM2860_BOARD_TERRATEC_AV350] = {Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
Quoted 4 lines
The sound comes from alsa device. Several em28xx types provide standard USB audio. So,
snd-usb-audio handles it. That's why you need alsa:adevice=hw.2,0:forceaudio at mplayer.
... but thats my problem.
sound doesn't appear inside mplayer, even with the command line options set to use the "external" alsa device. However, "arecord -D hw:2,0 -r 32000 -c 2 -f S16_LE | aplay -" plays the sound, but only before mplayer tried to access the sound card
When trying to play sound with arecord again after mplayer tried to access it, I have to re-plug the card to get it playing sound over arecord again, video only seems to not break it. There is no error message or something in arecord when it's not playing anything, just silence and the same command line output.
Is there maybe anything with the sample format S16_LE or something that confuses mplayer/the driver/whatever?
Strange problem...
mplayer output (mplayer -v -tv driver=v4l2:input=0:device=/dev/video1:alsa:adevice=hw.2,0:forceaudio tv://):
http://pastebin.com/yTV300iG
Florian
Em 26-10-2010 10:58, Florian Klink escreveu:
Quoted 9 lines
Hi,
Quoted 4 lines
The sound comes from alsa device. Several em28xx types provide standard USB audio. So,
snd-usb-audio handles it. That's why you need alsa:adevice=hw.2,0:forceaudio at mplayer.... but thats my problem.
sound doesn't appear inside mplayer, even with the command line options set to use the "external" alsa device. However, "arecord -D hw:2,0 -r 32000 -c 2 -fS16_LE| aplay -" plays the sound, but only before mplayer tried to access the sound card
Have you tried my patch?
If you're using alsa:adevice=hw.2,0:forceaudio at mplayer, you should not be running arecord/aplay. You need to use one solution or the other.
Quoted 15 lines
When trying to play sound with arecord again after mplayer tried to access it, I have to re-plug the card to get it playing sound over arecord again, video only seems to not break it. There is no error message or something in arecord when it's not playing anything, just silence and the same command line output.
Is there maybe anything with the sample format
S16_LEor something that confuses mplayer/the driver/whatever?Strange problem...
mplayer output (mplayer -v -tv driver=v4l2:input=0:device=/dev/video1:alsa:adevice=hw.2,0:forceaudio tv://):
http://pastebin.com/yTV300iGFlorian
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html