Opened 4 years ago

Closed 4 years ago

#92 closed enhancement (fixed)

USB Mic Support for C-Media

Reported by: Martin Iturbide Owned by: Lars Erdmann
Priority: minor Component: USBAUDIO
Version: 10.237 Keywords:
Cc: martiniturbide@…

Description

This is a ticket to discuss and test two audio devices that are not working with USB Audio.

  • C-Media Electronics USB Mic (0D8C:013C).
  • Karaoke USB Adapter - Only audio Inputs - This thing has a switch with two modes.

-- 1) 046D:0A03 - Logitech USB Microphone according to some sites) -- 2) 1415:0000 - Sony SingStar USBMIC by Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc.

Both devices produce a "Hardware Error" with DTAPE and record.exe with usbdrv237.zip.

Follow up of the forum thread: https://www.os2world.com/forum/index.php/topic,2707.15.html

Regards

Attachments (58)

USBAudio-10-238-0D8C_013C-2021-01-17.ftf (67.0 KB ) - added by Martin Iturbide 4 years ago.
USBAudio-10-237-0D8C_013C-2020-01-17.ftf (37.1 KB ) - added by Martin Iturbide 4 years ago.
usbaudio.zip (96.7 KB ) - added by Lars Erdmann 4 years ago.
swap cap/init check from "playback" to "record" operation for "record only" devices, remove hardware mix flag
USBAudio-10-238-0D8C_013C-2021-01-18.ftf (42.7 KB ) - added by Martin Iturbide 4 years ago.
usbaudio.2.zip (96.9 KB ) - added by Lars Erdmann 4 years ago.
revert Cap IOCTL back to original
USBAudio-10-238-0D8C_013C-2021-01-19.zip (102.0 KB ) - added by Martin Iturbide 4 years ago.
C-MEDIA_DTAPE_2021-01-19.ftf (41.4 KB ) - added by Martin Iturbide 4 years ago.
C-MEDIA_RECORD_2021-01-19.ftf (26.0 KB ) - added by Martin Iturbide 4 years ago.
usbaudio.3.zip (96.9 KB ) - added by Lars Erdmann 4 years ago.
check pStream at end of Init IOCTL, do not reset Caps flags on best fit after Caps IOCTL, please take trace
USBAudio3-2021-01-19.ftf (8.8 KB ) - added by Martin Iturbide 4 years ago.
USBAudio3-Dtape-ERROR.png (21.2 KB ) - added by Martin Iturbide 4 years ago.
test4.WAV (44 bytes ) - added by Martin Iturbide 4 years ago.
MMPM2.INI (6.2 KB ) - added by Martin Iturbide 4 years ago.
audSVN2200.zip (97.0 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2200
usbSVN2201.zip (97.0 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2201
C-MEDIA_DTAPE_2021-01-20.ftf (5.9 KB ) - added by Martin Iturbide 4 years ago.
audSVN2204.zip (96.9 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2204
audSVN2204_C-MEDIA_DTAPE_2021-01-21.ftf (8.5 KB ) - added by Martin Iturbide 4 years ago.
USBAUDIF_237-C-MEDIA_DTAPE_2021-01-21.ftf (11.3 KB ) - added by Martin Iturbide 4 years ago.
audSVN2205.zip (96.9 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2205
audSVN2206.zip (96.9 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2206
ARCAOS-013FC5D-20210121-generic.log (132.5 KB ) - added by Martin Iturbide 4 years ago.
audSVN2204-witholdDLL_C-MEDIA_DTAPE_2021-01-22.ftf (46.0 KB ) - added by Martin Iturbide 4 years ago.
INIFiles.png (10.6 KB ) - added by Martin Iturbide 4 years ago.
audSVN2207.zip (96.9 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2207
audSVN2207-CMedia_2021-01-22.ftf (238.8 KB ) - added by Martin Iturbide 4 years ago.
USBAudio_238_CMedia-Mic-Playback_2021-01-23.ftf (21.8 KB ) - added by Martin Iturbide 4 years ago.
audSVN2209.zip (96.8 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2209
AudSVN229-INI-Error-DTAPE-CMEDIA-2021-01-23.ftf (5.9 KB ) - added by Martin Iturbide 4 years ago.
AudSVN229-NoError-Old_DLL-DTAPE-CMEDIA-2021-01-23.ftf (141.2 KB ) - added by Martin Iturbide 4 years ago.
audSVN2210.zip (96.8 KB ) - added by Lars Erdmann 4 years ago.
svn rev 2210
audSVN2211.zip (96.8 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2211
AudSVN2211-NoError_Record-DTAPE-CMEDIA-2021-01-23.zip (15.2 KB ) - added by Martin Iturbide 4 years ago.
AudSVN2211-Playback-DTAPE-HPHeadet-2021-01-23.ftf (239.9 KB ) - added by Martin Iturbide 4 years ago.
audSVN2212.zip (96.8 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2212
audSVN2212-CmediaMic-HPPlayback-2021-01-24.ftf (241.9 KB ) - added by Martin Iturbide 4 years ago.
audSVN2212-CmediaMic-HPPlayback-BOTH-2021-01-24.zip (24.9 KB ) - added by Martin Iturbide 4 years ago.
audSVN2213.zip (96.8 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2213
3_Traces-2021-01-24.zip (65.3 KB ) - added by Martin Iturbide 4 years ago.
Wav-Hangs.png (13.6 KB ) - added by Martin Iturbide 4 years ago.
4USBAudio-WavApplause-Hangs.ftf (98.1 KB ) - added by Martin Iturbide 4 years ago.
audSVN2214.zip (96.8 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2214
audSVN2215.zip (96.8 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2215
Aud2215_CMedia-RecordingDTape-2021-01-26.ftf (172.1 KB ) - added by Martin Iturbide 4 years ago.
Aud2215_HP-PlaybackDTape-2021-01-26.ftf (239.5 KB ) - added by Martin Iturbide 4 years ago.
Applause-HPHeadet-DTAPE-OnePlayback.zip (30.9 KB ) - added by Martin Iturbide 4 years ago.
Applause-MusicFairy-DTAPE-OnePlayback.ftf (54.1 KB ) - added by Martin Iturbide 4 years ago.
audSVN2217.zip (96.8 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2217
AudSVN2217_CMedia-DTAPE-OnlyRecording-2021-01-27.ftf (132.6 KB ) - added by Martin Iturbide 4 years ago.
AudSVN2217_HPHeadset-Playback-Applause-Error-2021-01-27.ftf (161.2 KB ) - added by Martin Iturbide 4 years ago.
usbdrv237_HPHeadset-Playback-Applause-NoError-2021-01-27.ftf (202.9 KB ) - added by Martin Iturbide 4 years ago.
usbdrv237_Working-WPSPlay-Applause.ftf (69.6 KB ) - added by Martin Iturbide 4 years ago.
audSVN2217_NON-Working-WPSPlay-Applause.ftf (47.2 KB ) - added by Martin Iturbide 4 years ago.
WPSPlay-Error.png (11.0 KB ) - added by Martin Iturbide 4 years ago.
audSVN2218.zip (96.9 KB ) - added by Lars Erdmann 4 years ago.
SVN rev 2218
audSVN2218_HP_Working-DTape-Applause.ftf (77.8 KB ) - added by Martin Iturbide 4 years ago.
audSVN2218_HP_Working-WPSPlay-Applause.ftf (71.1 KB ) - added by Martin Iturbide 4 years ago.
audSVN2218_HP_PLAYCMD-MIDI-Bach.ftf (254.9 KB ) - added by Martin Iturbide 4 years ago.

Change History (144)

by Martin Iturbide, 4 years ago

by Martin Iturbide, 4 years ago

comment:1 by Martin Iturbide, 4 years ago

Version: 10.237

by Lars Erdmann, 4 years ago

Attachment: usbaudio.zip added

swap cap/init check from "playback" to "record" operation for "record only" devices, remove hardware mix flag

by Martin Iturbide, 4 years ago

comment:2 by Martin Iturbide, 4 years ago

Hi Lars

I just tried the usbaudio.zip. I included the trace.

It is not working yet for the mic. I get the error "Unsupported Format mode" in DTAPE and record.exe.

Regards

by Lars Erdmann, 4 years ago

Attachment: usbaudio.2.zip added

revert Cap IOCTL back to original

comment:3 by Lars Erdmann, 4 years ago

Try again. Take trace. Please also add "lsusb" output for both of these devices. It's likely that I'll need that info once this first problem is fixed. If that one device has 2 modes selectable by a switch, then take "lsusb" output for BOTH modes (provided that there is a HW switch in order to switch).

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:4 by Lars Erdmann, 4 years ago

milestone: Next Version

Milestone deleted

comment:5 by Martin Iturbide, 4 years ago

Hi Lars

C-Media Electronics USB Mic

https://www.os2world.com/wiki/index.php/C-Media_Electronics_USB_Mic

Bus 001 Device 004: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller

Karaoke USB Adapter

https://www.os2world.com/wiki/index.php/Karaoke_USB_Adapter

Mode 1 :C-Media Electronics USB Mic Singstar

Bus 001 Device 004: ID 1415:0000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony SingStar USBMIC

Mode 2 : PS3/Wii

Bus 001 Device 004: ID 046d:0a03 Logitech, Inc. Logitech USB Microphone

Since I started this ticket I had been only testing the "C-Media Electronics USB Mic" with the traces.

I will report about usbmic.zip in a while.

Regards

Last edited 4 years ago by Martin Iturbide (previous) (diff)

comment:6 by Martin Iturbide, 4 years ago

Testing "C-Media Electronics USB Mic". There had been some changes with usbaudio2.zip.

There is no longer error on DTape, but it does not record the audio.

Record.exe also change it message, but it quits after some seconds. It also did not record.

[X:\programs\audrec]record /a2 /b16 /c1 /f44100
started.
 opening ampmixer device
 informing dart being used
 allocating dart buffers
 creating event semaphore
 opening audio output file
 writing audio output file
[00000280]
 writing audio output file
 closing audio output file
 closing event semaphore
 deallocating dart buffers
 informing dart use ended
 closing ampmixer device
stopped.

Last edited 4 years ago by Martin Iturbide (previous) (diff)

by Martin Iturbide, 4 years ago

in reply to:  5 comment:7 by Lars Erdmann, 4 years ago

Replying to martini:

Hi Lars

C-Media Electronics USB Mic

https://www.os2world.com/wiki/index.php/C-Media_Electronics_USB_Mic

Bus 001 Device 004: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller

Karaoke USB Adapter

https://www.os2world.com/wiki/index.php/Karaoke_USB_Adapter

Mode 1 :C-Media Electronics USB Mic Singstar

Bus 001 Device 004: ID 1415:0000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony SingStar USBMIC

Mode 2 : PS3/Wii

Bus 001 Device 004: ID 046d:0a03 Logitech, Inc. Logitech USB Microphone

Since I started this ticket I had been only testing the "C-Media Electronics USB Mic" with the traces.

I will report about usbmic.zip in a while.

Regards

I need detailed "lsusb" outputs (with the -v flag). I need all USB detailed descriptor information.

comment:8 by Lars Erdmann, 4 years ago

Please do not trace directly from bootup (do not set TRACE in config.sys). Instead, start trace: ("trace on 238"), then run app, then stop trace ("trace off"). Obviously, the multimedia is caught in an infinite loop sending the same message over and over again. If the trace file is longer than a few 100 kBytes, it is most likely useless. You can look into it.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:9 by Martin Iturbide, 4 years ago

in reply to:  8 comment:10 by Martin Iturbide, 4 years ago

Replying to erdmann:

Please do not trace directly from bootup (do not set TRACE in config.sys). Instead, start trace: ("trace on 238"), then run app, then stop trace ("trace off"). Obviously, the multimedia is caught in an infinite loop sending the same message over and over again. If the trace file is longer than a few 100 kBytes, it is most likely useless. You can look into it.

Hi Lars. It is the first time I do a trace. I followed your instructions on "usbread.txt" on the USB drivers, that is why I put them on the config.sys.

I just let "TRACEBUF=2048 /M=W,Q,NODTI /D=ALL" on the config.sys and did a "trace on 238" on the command line.

Let me know if it is ok now.

Regards

by Martin Iturbide, 4 years ago

by Martin Iturbide, 4 years ago

comment:11 by Lars Erdmann, 4 years ago

Yes, the trace settings are ok this way. I looked at the traces and they look ok, in contrast to the trace added to #comment:6. Have you changed anything ? Does it now work ?

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:12 by Lars Erdmann, 4 years ago

Does the C-Media 0d8c:013c have a headphone jack so that you can not only record but also monitor your recording via a headphone ?

by Lars Erdmann, 4 years ago

Attachment: usbaudio.3.zip added

check pStream at end of Init IOCTL, do not reset Caps flags on best fit after Caps IOCTL, please take trace

by Martin Iturbide, 4 years ago

Attachment: USBAudio3-2021-01-19.ftf added

by Martin Iturbide, 4 years ago

Attachment: USBAudio3-Dtape-ERROR.png added

comment:13 by Martin Iturbide, 4 years ago

Hi

I installed usbaudio.3.zip and rebooted. It is not working.

Now there is a different error message in DTRACE and RECORD. It says MMPM2.INI file error. I had uploaded the Trace too.

Replying to erdmann:

Does the C-Media 0d8c:013c have a headphone jack so that you can not only record but also monitor your recording via a headphone ?

No, this is just a USB mic without any extra jack. I had tested the device on Windows to be sure it is working fine.

Regards

Last edited 4 years ago by Martin Iturbide (previous) (diff)

comment:14 by Lars Erdmann, 4 years ago

Did it work with usbaudio2.zip ? Because the two ftfs "C-MEDIA_DTAPE_2021-01-19.ftf​" and "C-MEDIA_RECORD_2021-01-19.ftf​" are looking OK. Was it ok ?

As to MMPM2.INI file error: can you attach MMPM2.INI ? I cannot see that I am doing anything that would lead to that error.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:15 by Lars Erdmann, 4 years ago

By the way: as I already stated, for the time being, you do not need to go through the full install. It is sufficient, if you copy over USBAUDIO.SYS|USBAUDIO.SYM and USBAUD2.SYS|USBAUD2.SYM and USBAUDIF.DLL|USBAUDIF.SYM (the SYM files are not strictly necessary but might help in case of trap).

Also check your config.sys: unfortunately, the MMINSTALL leaves some clutter in config.sys. You might want to clean that up (that's why you should not install too often ...)

in reply to:  14 ; comment:16 by Martin Iturbide, 4 years ago

Replying to erdmann:

Did it work with usbaudio2.zip ? Because the two ftfs "C-MEDIA_DTAPE_2021-01-19.ftf​" and "C-MEDIA_RECORD_2021-01-19.ftf​" are looking OK. Was it ok ?

As to MMPM2.INI file error: can you attach MMPM2.INI ? I cannot see that I am doing anything that would lead to that error.

There was no audio recording with the usbaudi2.file. There was no error, but DTAPE produced a 44kb wav file that freeze when try to be reproduced.

by Martin Iturbide, 4 years ago

Attachment: test4.WAV added

comment:17 by Martin Iturbide, 4 years ago

I'm attaching the MMPM2.INI that produce the error on DTAPE after the install of usbaudio3.zip.

by Martin Iturbide, 4 years ago

Attachment: MMPM2.INI added

by Lars Erdmann, 4 years ago

Attachment: audSVN2200.zip added

SVN rev 2200

comment:18 by Lars Erdmann, 4 years ago

Your MMPM2.INI is ok. I have a suspicion of what goes wrong. By the way: this version of USBAUDIO.SYS might crash or hang. Be aware of it and take precautions (boot config with USBAUDIO etc.)

by Lars Erdmann, 4 years ago

Attachment: usbSVN2201.zip added

SVN rev 2201

comment:19 by Lars Erdmann, 4 years ago

ignore audSVN2200.zip (uploaded the wrong version) and take audSVN2201.zip.

by Martin Iturbide, 4 years ago

comment:20 by Martin Iturbide, 4 years ago

Hi. I tried the "usbSVN2201.zip​" and I get the same MMPM2.INI error.

Just in case I reverted back to usbaudio2.zip and didn't get the MMPM2.INI error. From that point I replaced USBAUDIO.*, USBAUD2.* and USBAUDIF.* from the "usbSVN2201.zip​", rebooted and got the MMPM2.INI error again.

Check C-MEDIA_DTAPE_2021-01-20.ftf

Regards

comment:21 by Lars Erdmann, 4 years ago

Please leave everything in place but replace USBAUDIF.DLL with the one from the official 10.237 package and retry. Take trace.

by Lars Erdmann, 4 years ago

Attachment: audSVN2204.zip added

SVN rev 2204

comment:22 by Lars Erdmann, 4 years ago

directly step to audSVN2204.zip. If that does not work, revert USBAUDIF.DLL to 10.237 and retry. Take traces and screen shots where necessary and tell me what works (if any).

Last edited 4 years ago by Lars Erdmann (previous) (diff)

in reply to:  16 comment:23 by Lars Erdmann, 4 years ago

Replying to martini:

Replying to erdmann:

Did it work with usbaudio2.zip ? Because the two ftfs "C-MEDIA_DTAPE_2021-01-19.ftf​" and "C-MEDIA_RECORD_2021-01-19.ftf​" are looking OK. Was it ok ?

As to MMPM2.INI file error: can you attach MMPM2.INI ? I cannot see that I am doing anything that would lead to that error.

There was no audio recording with the usbaudi2.file. There was no error, but DTAPE produced a 44kb wav file that freeze when try to be reproduced.

A zero length data file was produced. If you try the lousy Wave File Editor that comes with OS/2, it will trap on zero length data files (the file header was properly produced and valid)

comment:24 by Lars Erdmann, 4 years ago

Cc: martiniturbide@… added

by Martin Iturbide, 4 years ago

by Martin Iturbide, 4 years ago

comment:25 by Martin Iturbide, 4 years ago

Hi

audSVN2204_C-MEDIA_DTAPE_2021-01-21.ftf​ is the trace with audSVN2204.zip​. Only with DTAPE testing. MMPM2.INI Error showed up while trying to record in DTAPE.

For "USBAUDIF_237-C-MEDIA_DTAPE_2021-01-21.ftf" I only replaced the USBAUDIF.DLL to 10.237. It gaves me a hardware error while trying to record in DTAPE. (just like in the past).

Last edited 4 years ago by Martin Iturbide (previous) (diff)

comment:26 by Lars Erdmann, 4 years ago

Owner: set to Lars Erdmann
Status: newaccepted

by Lars Erdmann, 4 years ago

Attachment: audSVN2205.zip added

SVN rev 2205

comment:27 by Lars Erdmann, 4 years ago

please redo trace. I only updated USBAUDIF.DLL, it would be sufficient to unlock and replace that.

by Lars Erdmann, 4 years ago

Attachment: audSVN2206.zip added

SVN rev 2206

comment:28 by Lars Erdmann, 4 years ago

after you tried 2205, do the same with 2206. Please always trace. For 2206, you need to update USBAUDIO.SYS and USBAUDIF.DLL (also see file timestamps in ZIP).

Last edited 4 years ago by Lars Erdmann (previous) (diff)

in reply to:  17 comment:29 by Lars Erdmann, 4 years ago

Replying to martini:

I'm attaching the MMPM2.INI that produce the error on DTAPE after the install of usbaudio3.zip.

Hallo Martin: after looking at your MMPM2.INI, I see an entry: workpath=X:\MMOS2

Are you sure that you have installed your system to drive X: ?

Because from what I can say, it is not the audio driver and not USBAUDIF.DLL that are generating error "invalid MMPM2.INI". It must be AMPMXMCD.DLL and it will do so if something is wrong with the MMPM2.INI.
Also make sure that MMPM2.INI is not set to readonly.Because MMPM2.INI will be modified if you change the volume !

Please also attach your config.sys.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

by Martin Iturbide, 4 years ago

comment:30 by Martin Iturbide, 4 years ago

Hi. I'm attaching the testlog generic report that I think it will give you a better idea of my system (it includes the config.sys). I use x:\ as the main drive, the OS is there.

Regards

comment:31 by Lars Erdmann, 4 years ago

Have you also ensured that X:\MMOS2\MMPM2.INI is not readonly but readwrite ?

comment:32 by Martin Iturbide, 4 years ago

Hi.

I just checked and X:\MMOS2\MMPM2.INI is not read only. Only A.

Regards

Last edited 4 years ago by Martin Iturbide (previous) (diff)

comment:33 by Martin Iturbide, 4 years ago

Hi

Just one thing. I have installed "audSVN2206.zip", but if I get back to "USBAUDIF.DLL|USBAUDIF.SYM" from usbaudio.2.zip, the MMPM2.INI error is gone. But it still does not record audio from the mic. It create a 44b wav file that is not readable.

Regards

Last edited 4 years ago by Martin Iturbide (previous) (diff)

by Martin Iturbide, 4 years ago

Attachment: INIFiles.png added

by Lars Erdmann, 4 years ago

Attachment: audSVN2207.zip added

SVN rev 2207

comment:34 by Lars Erdmann, 4 years ago

I hope it actually starts streaming now (I found a bug at position Y emerging out of the changes I made at position X). There are still some quirks to fix. This time, replace USBAUDIO.SYS, also replace TRC00EE.TFF (in the \os2\system\trace directory) but keep the "working" USBAUDIF.DLL for the moment.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

by Martin Iturbide, 4 years ago

comment:35 by Martin Iturbide, 4 years ago

Hi

Good News. I just tested it with "C-Media Electronics USB Mic (0D8C:013C)" and it worked. No error on DTape, the audio bars moved while I was talking, and the .wav file recorded my audio.

Later I will test the other device that has two modes.

Regards

comment:36 by Martin Iturbide, 4 years ago

Hi

I'm also happy to announce that the other device also worked:

Karaoke USB Adapter - Only audio Inputs - This thing has a switch with two modes.

  • 1) 046D:0A03 - Logitech USB Microphone
  • 2) 1415:0000 - Sony SingStar

Both modes worked.

Thanks a lot !!

comment:37 by Lars Erdmann, 4 years ago

good to hear. Can you do me a favor and now try to use a playback/record device and attempt playback and then maybe also record (if available). For Playback, also try to change volume, that should also and even work for record (if someone can explain to me what a volume control does when it is connected to a microphone input: your mic device has a volume control). In any case and always, please take TRACE !

I hope I did not break anything.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:38 by Martin Iturbide, 4 years ago

The USB Mic I have and the other audio input device does not has volume control.

While using DTape, I can record audio from the USB Mic. If I do a playback, it does not produce sound, because the USB Mic is still attached. I have to disconnect the mic, restart DTape and I can do playback of the wav file.

I guess this is because of the "aswitch.exe" on ArcaOS, that switch the audio output to the USB when you attach a sound device on it. On this case is just a mic (Audio input) and not an input/output device.

If you are referring to the Thinkpad L420 headset line input, it works fine me for headphones, but if I try to use it to record audio from a standard mic I get a distorted sound. I don't know how to fix that, but it is not an issue of the USB driver.

Regards

in reply to:  38 comment:39 by Lars Erdmann, 4 years ago

Replying to Martin Iturbide:

The USB Mic I have and the other audio input device does not has volume control.

While using DTape, I can record audio from the USB Mic. If I do a playback, it does not produce sound, because the USB Mic is still attached. I have to disconnect the mic, restart DTape and I can do playback of the wav file.

I guess this is because of the "aswitch.exe" on ArcaOS, that switch the audio output to the USB when you attach a sound device on it. On this case is just a mic (Audio input) and not an input/output device.

If you are referring to the Thinkpad L420 headset line input, it works fine me for headphones, but if I try to use it to record audio from a standard mic I get a distorted sound. I don't know how to fix that, but it is not an issue of the USB driver.

Regards

About volume: I was talking about the SW volume control in OS/2: volume.exe. In theory, you are potentially able to control input gain for your "record only" device with this volume control. Try it out and tell me if that works.

By the way: have you actually opened the recorded WAV file and see if that really contains sound ?

Please take trace with your playback device !

comment:40 by Lars Erdmann, 4 years ago

forgot: revert back the .TFF file to an older version. I need to fix something to it.

comment:41 by Martin Iturbide, 4 years ago

Hi.

Volume.exe is not affecting in any way the volume of the recording with the USB Mic.

I had set back the .TFF to the one on usbaudio.2.zip

I'm not sure how to take the trace of the playback device. To play de wav file I recorded, I unplug the USB Mic and hear the audio on my speakers. I guess it is no longer the "238" code.

Or you want me to take the trace making a playback with the USB mic attached, which of course does not provide playback sound?

Regards

Last edited 4 years ago by Martin Iturbide (previous) (diff)

by Martin Iturbide, 4 years ago

comment:42 by Martin Iturbide, 4 years ago

Just in case "USBAudio_238_CMedia-Mic-Playback_2021-01-23.ftf" is the trace of USB 238 for trying to make the playback a wav with DTAPE with the USB mic attached. Of course it does not produce any sound. But the wav file is ok.

by Lars Erdmann, 4 years ago

Attachment: audSVN2209.zip added

SVN rev 2209

comment:43 by Lars Erdmann, 4 years ago

please try the attached. Replace all (to be sure). Take trace. Mostly there are changes to USBAUDIF.DLL (as we know, the driver is working ok by now).

comment:44 by Lars Erdmann, 4 years ago

How do you do playback: do you have a USB device or do you do playback via UNIAUD ? I am completely lost. I am only interested in playback via USB.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

in reply to:  42 comment:45 by Lars Erdmann, 4 years ago

Replying to Martin Iturbide:

Just in case "USBAudio_238_CMedia-Mic-Playback_2021-01-23.ftf" is the trace of USB 238 for trying to make the playback a wav with DTAPE with the USB mic attached. Of course it does not produce any sound. But the wav file is ok.

Somehow the TFF file is not in the right place. I cannot use that trace. Make sure the TFF file is at the right place.

comment:46 by Martin Iturbide, 4 years ago

Hi Lars

I just made a full install of "audSVN2209.zip" with minstall. The MMPM2.INI error is back.

by Martin Iturbide, 4 years ago

comment:47 by Martin Iturbide, 4 years ago

Hi

If I take the USBAUDIF DLL and SYM from usbaudio.2.zip, no INI error and Mic get backs to work. Here it is the trace.

For Playback, I'm using UNIAud. Do you need me to test and trace some playback with an USB headset?

Regards

Last edited 4 years ago by Martin Iturbide (previous) (diff)

by Lars Erdmann, 4 years ago

Attachment: audSVN2210.zip added

svn rev 2210

comment:48 by Lars Erdmann, 4 years ago

Unfortunately, I cannot reproduce the USBAUDIF from usbaudio2.zip (I did not yet have it under SVN control). But please try 2210.

Yes, please use your USB headset to do playback. Do not forget to take a trace (and make sure that the proper TR00EE.TFF is in \os2\system\trace). Please update everything, just to be sure.

by Lars Erdmann, 4 years ago

Attachment: audSVN2211.zip added

SVN rev 2211

comment:49 by Lars Erdmann, 4 years ago

Found another thing that might go wrong. Try 2211.

comment:50 by Martin Iturbide, 4 years ago

Hi

I did a full "audSVN2211.zip" install with minstall. It worked fine. No errors on recording with the C-Media microphone. I uploaded the "AudSVN2211-NoError_Record-DTAPE-CMEDIA-2021-01-23" trace with just recording a wav file on Dtape.

After that I unplugged the C-Media Mic, and plugged the USB "HP Gaming Headset H320GS". Enable trace on and did a playback of the recorded wav file on Dtape. It also worked as supposed and I had attached the "AudSVN2211-Playback-DTAPE-HPHeadet-2021-01-23" trace file.

Regards

Last edited 4 years ago by Martin Iturbide (previous) (diff)

comment:51 by Lars Erdmann, 4 years ago

I see some quirky thing. When you do the playback, the driver claims that your device cannot do playback which of course is nonsense.

When you attached the headset for playback, did you STILL have the USB microphone connected ? As a test, when you attach the headset, can you then detach the microphone BEFORE you start the playback ? Please take trace.

There are some peculiarities with this sound driver as it actually can handle MORE than just 1 physical device (in contrast to UNIAUD). That seems to confuse the logic that determines if your device can do playback or record (or both).

Version 1, edited 4 years ago by Lars Erdmann (previous) (next) (diff)

by Lars Erdmann, 4 years ago

Attachment: audSVN2212.zip added

SVN rev 2212

comment:52 by Lars Erdmann, 4 years ago

I think I found the error. Use SVN rev 2212 and take trace. Disconnect devices to your heart's content, it should properly work (if not I still have to fix something ...).

The logic now is that the FIRST device to claim recording capability will REMAIN the device being used for recording even if another device is plugged in that could do recording. Analogous, the FIRST device to claim playback capability will REMAIN the device being used for playback even if another device is plugged in that could do playback.

Therefore, if you plug in a "recording only" device (your USB mic) and then you plug in a "playback and record" device (potentially your USB headset, if it has a microphone) that then your USB mic will continue to be used for recording even if you intented to use your headset's microphone. If you subsequently remove the USB mic, the driver is smart enough to then switch over to your headset's microphone.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

in reply to:  51 comment:53 by Martin Iturbide, 4 years ago

Replying to Lars Erdmann:

When you attached the headset for playback, did you STILL have the USB microphone connected ? As a test, can you detach the microphone BEFORE you attach the headset ?

For the later trace, I first recorded with the C-Media USB mic. De-attached the Mic and connected the HP USB headset (has mic and headphones). At that point I took the trace.

I will take the trace again with the audSVN2212 and let you know.

Regard

Last edited 4 years ago by Martin Iturbide (previous) (diff)

by Martin Iturbide, 4 years ago

comment:54 by Martin Iturbide, 4 years ago

I installed AudSVN2212 with minstall.

audSVN2212-CmediaMic-HPPlayback-2021-01-24.ftf​: Connected USB C-Media mic, record with DTAPE the wav, close DTAPE. Connected the HP Headset, run DTAPE and playback the wav file.

audSVN2212-CmediaMic-HPPlayback-BOTH-2021-01-24.zip: With both devices connected at the same time. First C-Media, later the HP Headset. Recorded with DTAPE the wav (From C-Media Mic) and playback it with DTAPE to hear the wav (On HP Headset).

Regards

comment:55 by Martin Iturbide, 4 years ago

Hi

From what I understand, DTAPE will take the first USB mic attached as a recorded preference. Right? Is this something that the driver sets, or a DTAPE software limitation?

Regards

comment:56 by Lars Erdmann, 4 years ago

Thanks for the trace. They helped very much. The problem is also fixed with the change I did in SVN2212.
But in general, it revealed a new problem, however this is just an abnormal condition/error case: if you rip out a USB device while you are playing/recording and if there is another USB audio device attached, the driver should automatically hand over to that other device. But for once, there was an error in the implementation and also, there is no serialization protection (which is necessary: if one part of the driver signals a device is detached, another part of the driver should not try to find out if that device exists at the very same point in time: this needs to be serialized)
As this is a problem that has nothing to do with the original problem, how about starting a new bug on this problem ?
You could raise a bug named "problems with protecting device detach and/or handing over streaming to another device".

As to what USB device is used: it will always be the "first" device that is used.
"first" is fluctuating: if you remove a device which used to be "first", then the "next" device that the driver finds will become the "first".
This logic is managed separately for playback and record: you can have one USB audio device do the playback while another one does the record.
As to why: The driver HAS to make a decision what device to use because OS/2 has no concept of one audio driver serving multiple audio devices. The only thing OS/2 can do is load more instances of one driver but one such instance will only be able to handle one device. This does not go together with the way the USB drivers work in general: one class driver can manage multiple USB devices. The answer to your last question therefore is: it's a driver limitation.

comment:57 by Lars Erdmann, 4 years ago

I'll make some final changes to USBAUDIF and USBAUDIO for the current problem. Once I did I want you to:
1) test USB audio playback AND record
2) test with multiple USB audio devices inserted, best would be to rip out a device and reattach and see if you can then still record and playback (but keep in mind my last explanation)
3) attempt to play a MIDI file. That will produce no sound, but it's an error case that the driver needs to properly handle (as in: it must not crash)

Once I attach the final version, please take 1 trace for each of the listed test cases.

by Lars Erdmann, 4 years ago

Attachment: audSVN2213.zip added

SVN rev 2213

comment:58 by Lars Erdmann, 4 years ago

ok, please test and trace.

comment:59 by Martin Iturbide, 4 years ago

Hi.

I installed audSVN2213.zip with minstall and rebooted.

1) test USB audio playback AND record Plugged CMedia Mic first and later HP Headset. I run a wav file first with DTAPE, later I recorded a wav with DTAPE from the CMedia mic. I found some strange here. I run the applause.wav (double click, not DTAPE) as testing, with the audio coming out from the HP headset, it did not play completely. The sound is like 2 sec and playback broke after the first second.

2)Tested un-plugging the CMedia Mic and HP Headset, reattaching first CMedia Mic and later HP Headset. Same issue with applause.wav while double clicking it.

3)The TP L420 has no MIDI support. I double click and it did not reproduce anything. Later I run some wav files by double clicking them, applause.wav also stops in the middle. (Check screenshot).

Regards

by Martin Iturbide, 4 years ago

Attachment: 3_Traces-2021-01-24.zip added

by Martin Iturbide, 4 years ago

Attachment: Wav-Hangs.png added

comment:60 by Martin Iturbide, 4 years ago

Hi

I tried an extra trace. Trace on, attached only the HP Headset, run doorcls.wav by double clicking it, it runs fine because its short. Later I run "applause.wav" (double click) and it stops reproducing it in the middle with the same visual result than the screenshot.

Regards

by Martin Iturbide, 4 years ago

comment:61 by Lars Erdmann, 4 years ago

In the past, I also had this issue with one WAV file (I think it was called twip.wav) but not with the others. And since twip.wav is a very short file, I had the reverse effect than you. I am therefore pretty sure, it has nothing to do with the sound driver (but with the WPS, see below).

What you can try: switch to the folder where these WAV files are located and run eautil to REMOVE all EAs from these files: for %F in (*.wav) do @eautil %F NUL /S

Then, retry again. I think, it has to do with the EAs that the CWMM classes add to the WAV files. Don't worry, these EAs will be regenerated where necessary.

By the way: I propose to do the same for all MID files.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:62 by Lars Erdmann, 4 years ago

as to 3): I cannot see any clicking on a MID file, at least I cannot identify it.
I just realized that you have no MIDI (Sequencer) related entry which could be expected. Please back up your MMPM2.INI, install Timidity MCD and retry. I know Timidity MCD works badly (and you should eventually uninstall it) but it will make it possible to check for an error condition (background: the system will attempt to use the default ampmixer even for MIDI and with your current MMPM2.INI settings, the default ampmixer is implemented by the USB audio driver. But the USB audio driver knows nothing about MIDI but needs to handle this case gracefully).

Start Trace, ONLY doubleclick a MID file (please do not doubleclick any other sound file) and stop trace. I just need to check that doubleclicking a MID file will not lead to an error.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:63 by Martin Iturbide, 4 years ago

Hi

I installed timidityMCD_2104.zip.

I have some problems running the MID file since Timidity MCD has conflict with the WPS and CWMM classes. If I try to open the SOUNDS and it restart the WPS desktop.

Can you help me with the EAUTIL command to remove the EA? I don't have experience with it.

How will be a good way to play a MIDI file from command line? I don't know how to use the "play" command.

"[X:\mmos2\sounds]play back.mid

This command file plays a file or device using the MultiMedia REXX string interface.

play [FILE="filename"] [DEV=device] [TIMEFMT=timefmt]

[FROM=from_position] [TO=to_position]

"

Regards

Last edited 4 years ago by Martin Iturbide (previous) (diff)

in reply to:  63 comment:64 by Lars Erdmann, 4 years ago

Replying to Martin Iturbide:

Hi

I installed timidityMCD_2104.zip.

I have some problems running the MID file since Timidity MCD has conflict with the WPS and CWMM classes. If I try to open the SOUNDS and it restart the WPS desktop.

Can you help me with the EAUTIL command to remove the EA? I don't have experience with it.

How will be a good way to play a MIDI file from command line? I don't know how to use the "play" command.

"[X:\mmos2\sounds]play back.mid

This command file plays a file or device using the MultiMedia REXX string interface.

play [FILE="filename"] [DEV=device] [TIMEFMT=timefmt]

[FROM=from_position] [TO=to_position]

"

Regards

1) deleting EAs: I already told you how, from a commandline: for %F in (*.wav) do @eautil %F NUL /S
2) playing MID: doing a <play FILE="theMidiFile.MID"> should do. Ignore the other parameters.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:65 by Martin Iturbide, 4 years ago

Hi

Sorry but I don't get what %F is in EAUTIL.

[X:\mmos2\sounds]eautil *.wav NULL /S
SYS1003: The syntax of the command is incorrect.

Play MIDI does not work. (I guess). I get no error or comment.

[X:\mmos2\sounds]play bach.mid

This command file plays a file or device using the MultiMedia
REXX string interface.

play [FILE="filename"] [DEV=device] [TIMEFMT=timefmt]
         [FROM=from_position] [TO=to_position]

comment:66 by Lars Erdmann, 4 years ago

1) see help for "for" command: help for
2) reread the progs output: play FILE="bach.mid"

by Lars Erdmann, 4 years ago

Attachment: audSVN2214.zip added

SVN rev 2214

comment:67 by Lars Erdmann, 4 years ago

please use SVN2214. To be sure, update all, take trace for playback and record.

by Lars Erdmann, 4 years ago

Attachment: audSVN2215.zip added

SVN rev 2215

comment:68 by Lars Erdmann, 4 years ago

Sorry, overlooked something, use SVN rev 2215 instead.

by Martin Iturbide, 4 years ago

by Martin Iturbide, 4 years ago

comment:69 by Martin Iturbide, 4 years ago

Hi

Aud2215_CMedia-RecordingDTape-2021-01-26.ftf: I connected the C-Media mic, started the trace, run Dtape and recorded a test1.wav. Everything went alright. Audio is working.

Aud2215_HP-PlaybackDTape-2021-01-26.ftf: I connected the HP headset (without unpluggin the C-Media mic). Stated the trace. Run Dtape, run the test1.wav, it reproduced ok. Later I openned applause.wav (also with DTape) and it only reproduce it half way. Maybe is thing about the wav file, because the test1.wav keeps working.

Later I disconnected all USB devices, open up DTape and reproduced with UniAud applause.wav without any issue.

Regards

comment:70 by Lars Erdmann, 4 years ago

please remove EAs from applause.wav:

eautil applause.wav NUL /S

I have played all OS/2 provided sound files with the USB audio driver in the past and they would all play ok. But as I said: for one file it was an EA problem. You need to remove all EAs. The fact it plays with UNIAUD is still no proof.

comment:71 by Lars Erdmann, 4 years ago

I will need to make some final changes to USBAUDIO:
1) minor change to use up-to-date format types instead of the AUDIODD format types used in OS/2 2.x (this change is not critical but will ease maintenance)
2) fix device detach (properly hand over to other USB device, if exists)
3) serialize device detach (with ongoing streaming)

As soon as all that is done and working, I'd consider the fix complete.

by Martin Iturbide, 4 years ago

comment:72 by Martin Iturbide, 4 years ago

Hi

I run "eautil applause.wav NUL /S " No message, so I guess it worked.

I tried only with the HP Headset.

  • Plugged the HP Headset
  • Enable Trace
  • Run Dtape
  • Open Applause.wav. It stopped in the middle. Close Dtrace.
  • Took the trace.

by Martin Iturbide, 4 years ago

comment:73 by Martin Iturbide, 4 years ago

Hi

I had the same results with the USB Music Fairy.

  • Plugged the USB Fairy (with a speaker and mic)
  • Enable Trace
  • Run Dtape
  • Open Applause.wav. It stopped in the middle. Close Dtrace.
  • Took the trace.

Will this be some DTAPE limitation?

Last edited 4 years ago by Martin Iturbide (previous) (diff)

by Lars Erdmann, 4 years ago

Attachment: audSVN2217.zip added

SVN rev 2217

comment:74 by Lars Erdmann, 4 years ago

Please replace all with SVN rev 2217 and take trace.

About the sound file: I don't yet know why it wouldn't play as I have not changed anything regarding playback or record.
After testing the SVN2217 and taking trace, revert back to USB Drivers 10.237 (the whole of usbaudio.zip) and check if it did play with those audio drivers.
What you can also test is to use play:

 play FILE=applause.wav

or you could doubleclick the file and have the WPS play it. If either works, then you know that there is a problem with DTAPE.

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:75 by Martin Iturbide, 4 years ago

"AudSVN2217_CMedia-DTAPE-OnlyRecording-2021-01-27.ftf​" is for recording a wav file with DTAPE with AudSVN2217. I install it with minstall. It worked fine to record the wav file.

comment:76 by Martin Iturbide, 4 years ago

For the Applause Error. I had tested AudSVN2217 and the same error persist. It stops reproducing in the middle. For the trace I tried:

  • Double click on the file. Stops reproducing on the middle.
  • Play command line (thanks for letting me know the right way). Stops reproducing on the middle.
  • From DTAPE. Stops reproducing on the middle.

I reinstalled usbdrv237 audio with minstall. Rebooted and the error was gone. For the trace I also tried 1)Double click, 2)Play.cmd and 3)Dtrace.

Regards

comment:77 by Lars Erdmann, 4 years ago

Can you try with any other file that is as long as applause.wav ? Do they all stop playing in the middle ?
I have to admit that currently I have no clue why this problem pops up. I have not changed anything regarding data streaming. I simply don't know what broke it.
Looking at "AudSVN2217_HPHeadset-Playback-Applause-Error-2021-01-27.ftf" I can even see that the system properly terminates the stream. Therefore, the audio driver does what it is supposed to do and stops playing. Need to find out why all of a sudden the system prematurely terminates the stream ...

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:78 by Lars Erdmann, 4 years ago

Ok, I found the difference between "good" and "bad":

for reasons I don't know, a stream is registered with bogus/default values for samplerate/numchannels/numbits (but not started).

For the good case, this very same stream is used with the correct samplerate/numchannels/numbits to actually play the stream.

For the bad case, a NEW stream is used with the correct samplerate/numchannels/numbits to actually play the stream.

Since the driver reports that it can only play one stream at a time, the second stream will interrupt the first. And I suspect that it will then stream the amount of data that it would have initially streamed for the first stream.

I will have to investigate why now the system starts 2 streams all of a sudden.

comment:79 by Lars Erdmann, 4 years ago

For BOTH of the cases ("bad" and "good") did you attempt to play in this sequence:
1) doubleclick (via WPS) 2) play FILE="applause.wav" (from commandline) 3) via DTAPE (application)

?

If this is true then it's a bit different: in the "good" case, all these 3 runs will use one and the same stream number (1), for the "bad" case, the first run will use stream number 1 and the other runs will use stream number 2. The first stream is never ended which likely confuses the system.

by Martin Iturbide, 4 years ago

by Martin Iturbide, 4 years ago

by Martin Iturbide, 4 years ago

Attachment: WPSPlay-Error.png added

comment:80 by Martin Iturbide, 4 years ago

Hi

I did another very basic trace. Just turning trace on and double clicking on the applause.wav file (WPSPlay).

  • 1) First trace works with usbdrv237 - No issie
  • 2) Second trace with audSVN2217. Wav playing stops in the middle and the WPS shows the wav as "in use" but locks there. (Check picture).

Regards

Last edited 4 years ago by Martin Iturbide (previous) (diff)

by Lars Erdmann, 4 years ago

Attachment: audSVN2218.zip added

SVN rev 2218

comment:81 by Lars Erdmann, 4 years ago

I think I found the bug. Please try SVN2218. Replace everything, take trace.

by Martin Iturbide, 4 years ago

by Martin Iturbide, 4 years ago

by Martin Iturbide, 4 years ago

comment:82 by Martin Iturbide, 4 years ago

Hi

Good news with Applause.wav. It completely play from PLAY.CMD and from WPSPLay with the "audSVN2218" driver.

I also made a "PLAY FILE=Bach.mid" to take the third trace. It was not reproduced, of course, but it didn't give any error on the command line. I did a Ctrl+C and take the trace.

Regards

comment:83 by Martin Iturbide, 4 years ago

I also tested the C-Media mic and it is also working with "audSVN2218"

Regards

comment:84 by Lars Erdmann, 4 years ago

ok, that's good news.
As to the MID file: actually it would not lead to the error case that I was expecting because TimidityMCD will actually create a PCM stream of 32 kHz, 2 channels, 16 bits out of the MIDI data (an error in thinking on my part). But I therefore wonder why you did not hear anything. The trace clearly shows that data is in fact streaming to your audio device. It should play.
What is important though is to not only install TimidityMCD but also to install patch files (these will create PCM fragments from the MIDI data so that you can actually stream PCM (WAV) data).

Anyways, please close this ticket if you consider the original problem fixed and open a new one called:

problems with protecting device detach and/or handing over streaming to another device

Then, I'll work on improvements to ensure that USB audio device attach or detach won't disturb ongoing streaming via USB (for the cases that you are using > 1 USB audio device at a time).

Last edited 4 years ago by Lars Erdmann (previous) (diff)

comment:85 by Martin Iturbide, 4 years ago

Ok. Let's close this one and I will create the other ticket.

comment:86 by Martin Iturbide, 4 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.